Skip to content

Questions · Published 2026-09-29 · Updated 2026-09-29 · AgentiSend

Send email from OpenCode

To send email from OpenCode, add a remote MCP server for the AgentiSend URL in opencode.json, with the key read from the environment, then ask OpenCode to send.

To send email from OpenCode, add AgentiSend as a remote MCP server and ask OpenCode to send. OpenCode then calls the same API your own code calls. The ceiling is checked before the message is accepted, and a refusal comes back with a fix.

The config file

OpenCode's MCP docs (fetched 29 September 2026) put a remote server directly under mcp, with type remote, a url, and headers. The key below is read from the environment, which is the form that page shows for a bearer token. OpenCode's v2 MCP page nests that same object under mcp.servers. Use the shape your install's schema accepts. capturedOn: 2026-09-29.

{
  "mcp": {
    "agentisend": {
      "type": "remote",
      "url": "https://api.agentisend.com/mcp",
      "enabled": true,
      "headers": { "Authorization": "Bearer {env:AGENTISEND_API_KEY}" }
    }
  }
}

The key is created with POST /api-keys (permission sending_access). The ceiling is PATCH /limits/keys/{id}, read back with GET /limits/keys/{id}. The key cannot raise its own ceiling. A send is POST /emails.

{
  "url": "https://api.agentisend.com/mcp",
  "headers": {
    "Authorization": "Bearer as_YOUR_API_KEY_HERE"
  }
}
Any other agent

Generic remote-MCP configuration: point any streamable-HTTP MCP client at this URL with this Authorization header.

A first prompt

Ask OpenCode to call whoami, then to send a short note to success@simulator.agentisend.com. That address costs nothing and reaches nobody. If a call is refused, quote its code and fix, and stop when retryable is false.

Next

Written by the AgentiSend team.