ThreadCamp
Start free
MCP server

ThreadCamp as agent tools

The ThreadCamp MCP server exposes the whole email platform as callable tools for any MCP-compatible agent - Claude, Cursor, OpenAI Agents and others. It is a thin wrapper over the /v1 REST API, so tools behave exactly like the endpoints they call.

Connect

Run the server over stdio with npx tsx mcp/server.ts, or use the hosted server. It reads two environment variables: THREADCAMP_API_KEY (required - a sk_live_ or sk_test_ key; try the public sandbox key sk_test_sandbox_threadcamp_public_demo) and THREADCAMP_BASE_URL (optional, defaults to https://threadcamp.vercel.app).

Add this to your MCP client configuration:

{
  "mcpServers": {
    "threadcamp": {
      "command": "npx",
      "args": ["tsx", "mcp/server.ts"],
      "env": {
        "THREADCAMP_API_KEY": "sk_test_sandbox_threadcamp_public_demo",
        "THREADCAMP_BASE_URL": "https://threadcamp.vercel.app"
      }
    }
  }
}

Tools

The server advertises these ten tools. Your client lists them automatically once connected.

create_inbox(display_name?, username?, domain?, autonomy?)

Create an inbox for an agent. Free tier mints on in.threadcamp.com; pass a verified domain for your own. autonomy is auto, approve-first or notify.

list_inboxes((none))

List every inbox owned by the caller.

send_email(from, to[], subject, text?, html?, cc?, scheduled_at?)

Send a Resend-compatible email. From an approve-first inbox the send is held and returns status pending_approval. scheduled_at (ISO) delays the send.

list_messages(inbox_id, direction?)

List messages in an inbox, optionally filtered by inbound or outbound.

get_message(message_id)

Fetch a single message by id, including thread_id, body and status.

wait_for_message(inbox_id, timeout_seconds?)

Poll an inbox for a new inbound message (e.g. an OTP email) up to timeout_seconds, returning the newest inbound message once one arrives.

add_domain(name)

Add a custom domain and return the MX/SPF/DKIM/DMARC records to place at your DNS host.

check_domain(domain_id)

Verify a domain's DNS after placing the records (POST /v1/domains/:id/verify).

create_route(match, action?, destination, srs?)

Create a forwarding/routing rule. match is a catch-all (*@domain) or alias; action is forward, webhook, inbox or split; srs preserves SPF/DMARC on forwards.

list_routes((none))

List every forwarding/routing rule.

Worked example: retrieve an OTP

The canonical agent email job: create an inbox, use its address to sign up somewhere, then call wait_for_message to pull the verification code out of the inbound email.

// Agent task: sign up for a service and retrieve the OTP.

// 1. Give the agent an inbox
create_inbox({ display_name: "Signup Agent" })
// -> { "id": "inbox_...", "address": "signup-agent@in.threadcamp.com" }

// 2. (agent uses that address to sign up on the target site)

// 3. Wait for the verification email to land
wait_for_message({ inbox_id: "inbox_...", timeout_seconds: 60 })
// -> { "id": "msg_...", "direction": "inbound",
//      "subject": "Your code is 481920",
//      "text": "Your one-time code is 481920." }

// The agent parses the code from the message and continues the flow.

MCP questions

What is MCP?

The Model Context Protocol is an open standard for exposing tools and data to AI agents. An MCP server advertises a set of callable tools; an MCP-compatible client (Claude, Cursor, OpenAI Agents and others) discovers them and calls them during a task. ThreadCamp's MCP server wraps the /v1 REST API as tools so an agent can send and receive email without writing HTTP code.

How do agents discover ThreadCamp?

Point your MCP client at the ThreadCamp server (npx tsx mcp/server.ts over stdio, or the hosted server) with a THREADCAMP_API_KEY. The client lists the available tools automatically. For non-MCP discovery, ThreadCamp also publishes llms.txt, an OpenAPI spec at /openapi.json and machine-readable pricing at /pricing.json.

Can I try it without signing up?

Yes. Use the public sandbox key sk_test_sandbox_threadcamp_public_demo as THREADCAMP_API_KEY. It authenticates against the API in test mode so an agent can create an inbox and exercise the tools before you sign up for a live key.

Wire ThreadCamp into your agent.

Start with the sandbox key, then sign up for a live key when you ship.

Start freeRead the docs