Add Samva to opencode
Add Samva's hosted MCP server to opencode, approve the OAuth connection for one organization, and run a read-only readiness check.
opencode connects to Samva's hosted MCP server at https://mcp.samva.dev and signs in with OAuth.
Once connected, an opencode agent can check your sending setup, send and read email, and work a
mailbox, inside the one organization you approve.
Add the server
Run this in your project:
opencode mcp add samva --url https://mcp.samva.devopencode writes the server to the project's opencode.json. Add --global to write it to your
global configuration instead.
{
"mcp": {
"servers": {
"samva": {
"type": "remote",
"url": "https://mcp.samva.dev"
}
}
}
}opencode mcp list now shows samva with needs authentication.
Connect your account
opencode mcp auth samvaopencode prints an authorization link and opens it in your browser. The browser opens Samva's authorization page. It names the client, shows where the browser returns to, and lists your organizations. Choose one organization and select Authorize. The connection acts as you, with your role in that organization, as Connect an agent over MCP describes. Leave Whole organization selected for the first check below: a connection confined to a namespace cannot read the organization's profile or readiness.
The browser then shows that opencode is connected, and opencode mcp list shows samva as
connected.
Run a first check
Start with a prompt that only reads:
Using Samva, check whether this organization is ready to send email and list what is left to set up.The agent calls profile_get to name the organization and email_check_readiness to report
whether it can send. Neither tool sends email. Tools that send, schedule, publish, or change
settings are writes, so ask for them only when you mean them.
From a terminal, the same prompt runs as opencode run "<prompt>".
Hold mailbox sends for approval
Decision rules apply to mailbox actions. A send from a mailbox, an agent reply, or an integration tool call goes out, waits for a person, or is refused according to the organization's, the mailbox's, and the actor's rules. A held send returns as waiting for approval and goes out only when someone approves it. See Review mailbox actions.
Those rules do not cover messages_send_email, which sends as soon as the agent calls it. To keep
a person in the loop for that tool, set your client to ask before it runs.
Troubleshooting
| What you see | What to do |
|---|---|
samva shows needs authentication | Run opencode mcp auth samva and approve the connection. |
| The agent works in the wrong organization | Run opencode mcp logout samva, then opencode mcp auth samva, and choose the other organization. |
| You want to remove the connection | Run opencode mcp logout samva. It removes the stored OAuth credentials. |