Mail MCP Server
StateSet Mail ships a Model Context Protocol server, so any
MCP-capable client — Claude Desktop, Cursor, Claude Code, the Anthropic SDK — can drive every
marketing and inbox operation as native tools.
The server advertises tools, resources, and prompts in its initialize response,
so clients enable the Resources panel and Prompts catalog in their UI.
Transports
stdio — recommended for desktop clients
stateset-mail-mcp is a second binary that reads newline-delimited JSON-RPC from stdin and
writes responses to stdout, logging to stderr. It reads the same environment variables as the
main HTTP server — point both binaries at the same SQLite file and the MCP server sees
everything the HTTP API has touched. All tools dispatch in-process, so there is no HTTP
round-trip.
Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
Restart the client and the tools are live in the next chat.
HTTP — recommended for remote clients
POST /v1/mcp accepts a single JSON-RPC request and returns a single response, with the same
bearer-token auth as the rest of /v1. Use this when the MCP client lives on a different
machine from the deployment.
The tool context carries tenant identity, so a multi-tenant deployment scopes calls correctly.
26 marketing tools cover profiles, lists, segments, templates, campaigns, flows,
suppressions, events, webhooks, and the activity log — upsert_profile, add_to_list,
preview_segment, create_campaign, send_campaign, get_campaign_stats,
get_campaign_timeseries, suppress_email, track_event, and more.
A further set of conversation tools covers the agent inbox — see
Conversations.
The same 14-function marketing surface is also available as plain OpenAI- and
Anthropic-format tool schemas at GET /v1/tools, if you’d rather wire it into an agent
directly than go through MCP.
Resources
resources/list enumerates recently-touched entities; resources/read returns the full JSON
body for one. Resources let a model read state without burning a tool call, and clients
render them in a panel so you can attach an entity to a chat with one click.
Prompts
prompts/list advertises server-provided playbooks; prompts/get renders the body with the
caller’s arguments substituted in. Each names the tools to call and the order to call them, so
picking a prompt is a one-shot way to trigger a multi-step workflow.