Cursor and Codex MCP setup: one email server, three clients
Cursor MCP server setup: one email server serves Cursor, Codex, and Claude Code. Config formats differ but the protocol is identical. This guide shows exact config blocks per client, compares transport and approval behavior, and explains why scoped API keys per inbox are production safe.
On this page
TL;DR: One send.io email MCP server can serve Cursor, Codex, and Claude Code simultaneously. The difference isn't the server, it's the config format: Claude Code reads.mcp.json, Cursor reads.cursor/mcp.json, and Codex readsconfig.toml. Transport support differs per client. All three handle stdio, Cursor defaults to Streamable HTTP for remote servers and can also connect to SSE-based servers, and Claude Code still accepts SSE but treats it as deprecated in favor of Streamable HTTP, while Codex defaults to stdio and can also run over unix socket and experimental WebSocket transports. Approval prompts and session persistence behave differently per client. The production-safe pattern is issuing a separate scoped API key per inbox, so each client only touches the mailbox it owns.
You've got one email MCP server. You want it in Cursor, Codex, and Claude Code. The config formats are different, the transport options don't match, and the approval prompts behave differently in each client.
This article shows the exact config blocks for each client, explains how approval policies and session persistence differ, and demonstrates why issuing a separate scoped API key per inbox is the production-safe pattern for multi-client email access.
Standardizing MCP servers for Cursor and Codex
Most MCP setup guides assume you're running one client. The moment you add a second, you discover that "MCP-compatible" doesn't mean "config-compatible." The Model Context Protocol defines how servers expose tools to AI assistants, but it doesn't standardize the config file format each client uses to register those servers.
Decoupling tool logic with MCP servers
MCP servers act as a bridge between your AI assistant and external tools. Instead of writing a custom adapter for each assistant (Claude Code, Cursor, Codex), you register the same MCP server in each client's config file. The server exposes the same tool definitions regardless of which client connects, but the registration mechanism differs.
The official MCP specification defines two standard transports: stdio for local process communication and Streamable HTTP for remote HTTP-based communication, with SSE serving only as an optional streaming mechanism within Streamable HTTP rather than a primary transport of its own. Each transport has different implications for latency, session state, and network overhead.
Mapping MCP server settings per client
Claude Code reads MCP server configs from .mcp.json in your project root or ~/.claude.json for global settings. Each entry specifies a type, a command or URL, and optional environment variables. The JSON format accepts http, sse, stdio, and ws for WebSocket servers, but the claude mcp add --transport CLI flag doesn't take ws, so WebSocket servers have to be registered by editing the file directly.
Cursor reads from ~/.cursor/mcp.json for global tools or .cursor/mcp.json in your project directory for project-specific servers. The config format is JSON, but the key names and structure differ slightly from Claude Code's format.
Codex stores MCP configuration in ~/.codex/config.toml or .codex/config.toml for trusted projects. The format is TOML, not JSON, which changes how you structure server definitions and environment variables.
Scaling MCP across diverse development tools
When you standardize on MCP across your AI tooling, you eliminate per-project adapter code. Instead of writing a custom email integration for Claude Code, then rewriting it for Cursor, you register the same MCP server in both config files.
The trade-off: local MCP servers consume resources. Each stdio server spawns a local process with its own memory footprint, and the size depends on the tool set and language runtime. If you're running three clients locally, that's three separate MCP server processes unless you point all three at one hosted remote endpoint.
How the email MCP server bridges AI clients
The send.io MCP server exposes email operations as MCP tools that any compatible client can call, such as send-email. The server authenticates each request with your API key and executes send, inbox, and thread operations through the send.io API, so your AI assistant can send and read email without you writing REST API calls. The server's tool list gives each tool a name and description.
Mapping email actions to MCP tools
The send.io hosted MCP server exposes 160 tools covering email sending and listing, domains, API keys, webhooks, suppressions, templates, logs, agent inboxes, automations, and events. When you connect an MCP client, it receives a tool list via JSON-RPC and can invoke any tool the API key has permission to access.
For example, when the assistant calls an email-sending tool, the client sends a JSON-RPC request with the tool's parameters, and the MCP server makes the matching call to the send.io API, authenticated with your API key. The exact parameter schema for each tool comes from the tool list the server returns when the client connects.
SSE vs stdio transport differences
Stdio transport runs the MCP server as a local subprocess. The client spawns the server process, communicates over stdin/stdout, and kills the process when the session ends. Stdio has zero network latency but only works on the local machine.
SSE transport connects to a remote HTTP endpoint. The client sends POST requests to the server, and the server streams responses back over a persistent HTTP connection using Server-Sent Events. SSE adds network latency but enables remote access, centralized authentication, and horizontal scaling across multiple clients.
The send.io hosted MCP server uses Streamable HTTP transport. You send a POST request with a JSON-RPC 2.0 payload and your API key as a Bearer token, and the server responds over the same connection.
Configuring session persistence for MCP
Session persistence determines whether the MCP server maintains state between tool calls. For email operations, session state includes the current inbox and active threads.
Stdio servers maintain state in the local process memory. If the client restarts the server (for example, after a config change), all session state is lost. SSE servers can maintain state server-side depending on provider implementation, so check the vendor documentation for the reconnection window before building a workflow that depends on
resuming a dropped session.
Configuring email MCP servers for Cursor and Codex
The config file format determines how you register the MCP server, but the underlying connection parameters are the same: server URL or command, transport type, and authentication credentials.
Mapping email MCP server parameters
Each client config file needs three pieces of information: where the server is, how to connect, and how to authenticate. For the send.io hosted MCP server, the URL is https://api.send.io/mcp, the transport is Streamable HTTP, and authentication is a Bearer token (your send.io API key).
For the local stdio mode, the command is sendio mcp serve --tools free-inbox, the transport is stdio, and no account or API key is required for the free inbox mode.
Securing email credentials in config
Hardcoding API keys in config files is common in tutorials but insecure. Anyone with read access to the config file can extract the key and use it to send email from your domain or read your inbox.
The production-safe pattern: use environment variables. Store the API key in an environment variable (for example, SENDIO_API_KEY), and reference the variable in the config file. Each client supports environment variable substitution, but the syntax differs.
Claude Code uses ${VAR_NAME} syntax. Cursor documents ${env:VAR_NAME} substitution. Verify that your installed Cursor version resolves the variable in headers before relying on it in production. Codex reads config values literally, which means ${VAR_NAME} in a TOML value stays a literal string. Instead, Codex pulls environment values through explicit fields. Set bearer_token_env_var to the name of the variable that holds your API key for an HTTP server. For stdio servers that need to pass environment variables through, confirm the exact field names env_varsagainst your installed Codex version.
Configuring MCP user consent workflows
Approval policies control when the AI assistant must ask for user confirmation before executing a tool call. For email operations, you want approval prompts for sends (to prevent accidental sends) but not for reads (to allow autonomous inbox monitoring).
Each client implements approval policies differently. Claude Code prompts for approval on tool calls that change external state, Cursor shows an approval dialog for any tool that changes external state, and Codex sets approval behavior through an approval_mode field in the config file, whose accepted values vary by release. Treat send and delete operations as the ones that need a human in the loop: set each client's approval policy so those tool calls always prompt. You can relax this in the client config if you trust the AI assistant to send autonomously.
Cursor MCP server setup with mcp.json
Cursor reads MCP server configs from .cursor/mcp.json in your project directory. The config format is JSON, but the structure differs from Claude Code's .mcp.json.
Configuring mcp.json for email servers
Create .cursor/mcp.json in your project root:
{
"mcpServers": {
"sendio-email": {
"url": "https://api.send.io/mcp",
"headers": {
"Authorization": "Bearer ${env:SENDIO_API_KEY}"
}
}
}
}
Cursor substitutes ${env:SENDIO_API_KEY} with whatever the SENDIO_API_KEY environment variable holds at runtime. Set the variable in your shell profile or .env file.
For local stdio mode:
{
"mcpServers": {
"sendio-local": {
"command": "sendio",
"args": ["mcp", "serve", "--tools", "free-inbox"]
}
}
}
Configuring transport for MCP servers
Cursor infers the transport from the config entry. If you specify a url, Cursor connects to a remote server and defaults to Streamable HTTP, which is the protocol the send.io hosted endpoint speaks. If you specify a command, Cursor runs a local stdio server.
The documented send.io Cursor config uses only url and headers, with no transport field, so the examples above omit it. Check Cursor's current documentation before adding an explicit transport field.ssestdio Cursor does not currently support WebSocket transport for MCP servers.
Managing client-specific session state
Cursor's behavior with remote MCP servers varies by connection type, and SSE-based connections in particular have known reliability issues with dropped sessions and manual reconnects, so verify connection stability against your installed Cursor version before building on it.
For stdio servers, Cursor manages the server process per workspace session. Session state does not persist across workspace restarts.
Configuring the Codex MCP server with TOML
Codex reads MCP server configs from ~/.codex/config.toml for global settings or .codex/config.toml in your project root for trusted projects.
TOML syntax for email MCP servers
Create or edit .codex/config.toml:
[mcp_servers.sendio_email]
url = "https://api.send.io/mcp"
bearer_token_env_var = "SENDIO_API_KEY"
TOML uses square brackets for table headers. The [mcp_servers.sendio_email] table defines the server URL and the environment variable that holds your API key. Codex reads the token from SENDIO_API_KEY at connection time, so the key never appears in the config file.
For local stdio mode:
[mcp_servers.sendio_local]
command = "sendio"
args = ["mcp", "serve", "--tools", "free-inbox"]
Registering the email MCP server
Codex loads MCP server configs when you start a new conversation. If you edit config.toml mid-session, you must restart Codex to pick up the changes.
Codex validates the config file on startup. Invalid TOML syntax can prevent Codex from loading the config correctly, so validate the file before launching if the server doesn't appear in the tool list. Codex's exact behavior with unreachable servers varies by version.
Configuring MCP approval policies
Codex controls approval behavior through an approval_mode field, and the approval system applies approval_policy and approvals_reviewer at the application level rather than a per-tool auto_approve flag. The accepted mode values vary by release, so confirm the accepted values against your installed Codex version. In the default configuration, Codex asks for approval only when an action needs broader access than the default workspace-write sandbox, and it doesn't prompt for every tool call. Tools that advertise a destructive annotation always require approval.
Approval applies at the application level rather than per tool, so set the mode once and leave the server entry itself unchanged:
approval_mode = "prompt"
[mcp_servers.sendio_email]
url = "https://api.send.io/mcp"
bearer_token_env_var = "SENDIO_API_KEY"
The approval_mode setting applies to every tool Codex can call rather than to individual tool names, so there is no per-tool allowlist to maintain. With prompt, Codex asks before reads and sends alike, which keeps every outbound email behind a human confirmation.
Implementing unique API tokens for each inbox
The production-safe pattern for multi-client email access is issuing a separate scoped API key per inbox. Each client gets a key that can only access the inbox it owns, so a compromised key doesn't expose your entire email infrastructure.
Isolating MCP credentials per client
A scoped API key works like a keyed entry card: it opens only the inbox it was provisioned for. The send.io agent inbox API lets you create an inbox and receive a scoped API key in the same call.
When you POST to /v0/inboxes, the response includes an api_key field. This key has permission to read, send, and manage email for that inbox only. It can't access other inboxes, create new inboxes, or modify account settings.
Scoped keys carry permission lists and can't grant permissions they don't hold. If you create a key with message_read and message_send permissions, that key can't delete messages or create API keys, even if the client requests those operations.
Configuring unique MCP keys per inbox
To isolate clients, create one inbox per client and issue a separate scoped key for each. For example:
- Cursor inbox:
cursor-agent@yourdomain.com, scoped key stored inCURSOR_SENDIO_API_KEY - Codex inbox:
codex-agent@yourdomain.com, scoped key stored inCODEX_SENDIO_API_KEY - Claude Code inbox:
claude-agent@yourdomain.com, scoped key stored inCLAUDE_SENDIO_API_KEY
If one client's key is compromised, you revoke that key and issue a new one for that inbox only. The other clients continue working unaffected.
Defining inbox permissions for clients
Inbox Pods group inboxes for isolation. A pod's API key can only see that pod's inboxes, and a pod can't be deleted while it still holds inboxes.
For example, create a pod for each client environment (development, staging, production). All development inboxes go in the dev pod, staging inboxes in the staging pod, and production inboxes in the production pod. Issue a pod-scoped API key for each environment.
A pod-scoped key can list, read, and send from any inbox in that pod, but it can't access inboxes in other pods. This is useful when you want a single key per environment but still isolate environments from each other.
Only admin-level keys can create, change, or delete other keys. Inbox-scoped and pod-scoped keys can't create new keys, so a compromised scoped key can't escalate privileges.
Feature matrix for email server interoperability
Here's how the three clients compare on transport, approval, and session persistence:
Feature | Cursor | Codex | Claude Code |
|---|---|---|---|
Config format | JSON | TOML | JSON |
Config file |
|
|
|
Transport default | Streamable HTTP for remote, stdio for local | stdio by default (unix and experimental WebSocket also available) | stdio is the default, with Streamable HTTP used for remote servers |
Approval policy | Prompts on state-changing tools |
| Prompts on destructive tools |
Session persistence | Provider-defined window (SSE), none (stdio) | Provider-defined window (SSE), none (stdio) | Provider-defined window (SSE), none (stdio) |
Scoped key support | Environment variable | Environment variable | Environment variable |
Transport methods for MCP servers
Transport | Process Model | Latency | Use Case |
|---|---|---|---|
stdio | Local subprocess | <1ms | Local testing, offline work |
SSE | Remote HTTP connection | Adds network round-trip time | Production, multi-client, remote access |
Streamable HTTP | Remote HTTP with SSE streaming | Adds network round-trip time | Production, real-time responses |
The send.io hosted MCP server uses Streamable HTTP. The local stdio mode (sendio mcp serve --tools free-inbox) uses stdio.
Managing MCP server approval policies
Approval policies control when the AI assistant must ask before executing a tool call. The defaultalways_ask approval rules and their scope differ per client, so confirm the defaults against your installed version instead of assuming a newly added tool always prompts.
You can override approval behavior per client. Cursor and Claude Code use tool metadata (the server marks tools as destructive or safe). Codex applies its approval_mode setting at the application level rather than per tool.
For email workflows, require approval for sends and deletes but allow autonomous reads. This lets the agent monitor the inbox and draft responses without human intervention, but prevents accidental sends.
State syncing for email agents
Session state includes the current inbox and active threads. SSE servers maintain state server-side for a provider-defined window, so check the vendor documentation for the exact timeout. Stdio servers maintain state in the local process memory, which is lost when the process exits.
For long-running email workflows, use SSE so the agent can pick up where it left off if the connection drops. For one-off operations (send a single email, check for a verification code), stdio is sufficient.
Provision an agent inbox with a scoped API key, then connect it to your MCP-compatible assistant using the quickstart guide. The guide covers the sendio inbox connect flow, which returns a one-use link that joins the inbox to your workspace so the agent can send.
FAQs
Does the same email MCP server work in Cursor and Codex?
Yes. The send.io MCP server uses the standard MCP protocol, so any MCP-compatible client can connect. The difference is the config file format: Cursor uses JSON (.cursor/mcp.json), Codex uses TOML (.codex/config.toml).
How do you configure an email MCP server in Cursor and Codex?
Create a config file with the server URL, transport type, and API key. For Cursor, create .cursor/mcp.json with the server URL and Bearer token. For Codex, create .codex/config.toml with the same information in TOML format. Both support environment variable substitution for API keys.
Can you use different API keys for each client?
Yes, and you should. Issue a separate scoped API key per inbox, so each client can only access the mailbox it owns. Store each key in a separate environment variable and reference the appropriate variable in each client config.
What happens if approval is denied in one client?
If you deny approval for a tool call, the client aborts the call before it runs and the server does not execute the operation.
Is stdio transport supported in Cursor, Codex, and Claude Code?
Yes. Cursor, Codex, and Claude Code all support stdio for local MCP servers and Streamable HTTP for remote servers, including the send.io hosted endpoint. Cursor still accepts SSE-based servers, and Claude Code accepts SSE but treats it as deprecated in favor of Streamable HTTP. Stdio is faster (no network latency) but only works on the local machine. Streamable HTTP enables remote access and multi-client connections.
Key terms glossary
MCP (Model Context Protocol): A protocol that standardizes how AI assistants connect to external tools. MCP servers expose tool definitions via JSON-RPC, and clients (Claude Code, Cursor, Codex) invoke those tools with user approval.
stdio: A transport method where the MCP server runs as a local subprocess and communicates over stdin/stdout. Stdio has zero network latency but only works on the local machine.
SSE (Server-Sent Events): A transport method where the MCP server runs remotely and streams responses over a persistent HTTP connection. SSE enables remote access and multi-client connections but adds network latency.
Scoped API key: An API key with a limited permission set, scoped to a specific inbox or pod. Scoped keys can't grant permissions they don't hold, and only admin-level keys can create or modify other keys.
Inbox pod: A group of inboxes isolated from other pods. A pod's API key can only access inboxes in that pod, and a pod can't be deleted while it still holds inboxes.
Approval policy: A client-side setting that controls when the AI assistant must ask for user confirmation before executing a tool call. Approval policies prevent accidental state-changing operations.
Session persistence: Whether the MCP server maintains state (current inbox, active threads) between tool calls. SSE servers maintain state server-side; stdio servers maintain state in local process memory.
mcp.json: The config file format used by Cursor to register MCP servers. Located at .cursor/mcp.json in the project directory or ~/.cursor/mcp.json globally.
TOML: The config file format used by Codex. Located at .codex/config.toml in the project directory or ~/.codex/config.toml globally.
JSON-RPC: The remote procedure call protocol used by MCP. Clients send JSON-RPC requests to invoke tools, and servers respond with JSON-RPC responses.