SMTPfast's MCP server now has a second URL, https://smtpfa.st/api/mcp/compact. It is the same server with two tools, search_api and call_api, in place of the 109 tools of the full list. We measured what that changes, on two Claude models and five tasks, and the answer is less simple than "fewer tokens, so cheaper":
- Context: the tool list goes from 33,743 tokens to 634. Over whole tasks, compact mode sent 6.6 to 7.1 times fewer input tokens through the model.
- Success: 100 of 100 runs passed, 50 in each mode, checked against the API afterwards.
- Speed: compact mode was slower in every task. The model searches before it calls, which adds a turn. Adding up the median time of each task, it took about 50% longer on Claude Opus 5.5 and 75% longer on Claude Sonnet 5.5.
- Cost: with a warm prompt cache, about the same in both modes. Without a cache, compact mode was about 6 times cheaper. So it saves money when the tool list is not cached, and it always saves context.
We build SMTPfast. The numbers below come from our own account, the prices are Anthropic's list prices on 24 November 2026, and the method section says exactly what we ran.
What compact mode is
The full server gives the model one tool per job: send_email, list_domains, create_contact, get_email_metrics and 105 more. Each tool has a name, a description and a JSON schema, and an MCP client that loads them all sends every definition with every request, before the model has done anything.
Compact mode gives the model two tools:
search_api(query, limit?)finds operations of the SMTPfast API by what they do ("send email", "delete contact") or by operation id. Each result has the operation id, method, path, a summary, whether it is read-only or destructive, and its params.call_api(operation_id, params)runs one operation.
A task looks like this. The model searches, then calls what it found:
{"name": "search_api", "arguments": {"query": "list domains"}}
{"name": "call_api", "arguments": {"operation_id": "listDomains", "params": {}}}
call_api does not call the REST API by itself. It runs the same tool the full list has for that operation, so the params, the schema check, the scopes, the rate limits, the OAuth scope step-up and the ChatGPT restrictions are the same as a direct call. An operation that is not available through MCP (API keys, team invitations) is refused, and so is an operation the ChatGPT profile hides. A write must also be the operation the model named: call_api("deleteInbox", ...) with params that would create an inbox is refused before any request leaves.
Two things are only in the full list: the task tools that combine several calls, such as explain_email and deliverability_report, and the way each tool shows up on its own in your client's approval prompt. In compact mode the client sees call_api, which can send email or delete data, so clients mark it destructive and ask before each call. search_api marks each operation, and destructive ones keep their "confirm with the user first" rules in the description.
Why we did not run the model's code
The idea is not new. Cloudflare's Code Mode MCP server (February 2026) puts the whole Cloudflare API, more than 2,500 endpoints, behind two tools, search() and execute(), in about 1,000 tokens. Both tools take JavaScript that the model writes, and Cloudflare runs it in a V8 isolate. Anthropic's Code execution with MCP (November 2025) makes the same case from the client side: present MCP servers as code APIs, load only what the task needs, and filter data in code before it reaches the model. Their example went from 150,000 tokens to 2,000.
Running the model's code is what makes those designs strong. One execute() can page through a list, filter it, and call a second endpoint for each match, all in one step, and only the result comes back to the model.
We chose not to run code on our servers. SMTPfast sends email to real people, and a loop in model-written code can send a lot of it. Running that code safely means a sandbox, resource limits and monitoring, which Anthropic's post also lists as the cost of the approach, and every API rule would need to hold inside it. With call_api, one call is one operation, through the code path that already enforces the rules.
The price of that choice is real, and it shows in the numbers below:
- No chaining or filtering inside one step. Each operation is its own tool call, so the model needs a turn to search and a turn per dependent call. In our multi-step task, compact mode made 9 to 10 calls over 6 turns on average.
- Results come back whole. A list call returns the full page to the model. Code Mode could filter it first.
How we measured
We ran a small Python script against the live server, using the Anthropic API through the official SDK:
- Models:
claude-opus-5-5andclaude-sonnet-5-5, effortmedium, thinking left at its default (adaptive). Output tokens include thinking. - Modes: full (
/api/mcp, 109 tools) and compact (/api/mcp/compact, 2 tools), with the same API key. - Like a real client: the script called
initializeand put the server's instructions in the system prompt, as MCP clients do, then passed thetools/listresult as Claude tool definitions. - Prompt caching: tools and system prompt cached with a breakpoint, warmed once per mode before the runs, and the conversation cached turn to turn. So the measured runs saw a warm cache, like a client in the middle of a session. We count the cold cache write separately.
- Five tasks, five runs each, per model and mode: 100 runs in total, with the modes taking turns.
- Checks through the REST API, not the model's word: the test email had to arrive in our own test inbox, the verified domains had to be named, created contacts and segments had to be gone at the end (the script cleaned up anything left behind), and the bounce rate had to match the API's own numbers within 0.2 points.
The tasks:
| Task | Prompt (shortened) | Why |
|---|---|---|
| send | Send a short plain test email to our test inbox | One write |
| domains | List my sending domains, say which are verified | One read |
| contact | Create a contact, confirm it exists, then delete it | Three dependent calls |
| bounces | What share of the email I sent in the last 7 days bounced? | The model has to find the right endpoint |
| segment | Create a segment, add a new contact to it, check it has one contact, delete both | Five dependent calls, two resource types |
Results: tool list size
Counted with Anthropic's token counting API (the same count on both models), as the tools a client passes to the model:
| Endpoint | Tools | JSON bytes | Tokens |
|---|---|---|---|
/api/mcp |
109 | 110,941 | 33,743 |
/api/mcp/compact |
2 | 1,332 | 634 |
/api/mcp/chatgpt (ChatGPT's list) |
71 | 66,288 | 20,062 |
Results: tokens, turns and time
Mean input tokens per task (uncached, cache write and cache read added up, over every turn), mean model turns, and median seconds from the first request to the final answer:
Claude Opus 5.5
| Task | Tokens full | Tokens compact | Fewer | Turns full / compact | Seconds full / compact |
|---|---|---|---|---|---|
| send | 75,136 | 9,606 | 7.8x | 2.2 / 3.2 | 5.3 / 7.5 |
| domains | 68,489 | 6,528 | 10.5x | 2 / 3 | 4.4 / 5.4 |
| contact | 136,902 | 18,745 | 7.3x | 4 / 5 | 5.5 / 9.0 |
| bounces | 91,071 | 11,441 | 8.0x | 2.6 / 3.6 | 6.5 / 9.6 |
| segment | 174,076 | 30,043 | 5.8x | 5 / 6 | 11.8 / 18.6 |
Claude Sonnet 5.5
| Task | Tokens full | Tokens compact | Fewer | Turns full / compact | Seconds full / compact |
|---|---|---|---|---|---|
| send | 68,205 | 8,981 | 7.6x | 2 / 3 | 4.4 / 5.9 |
| domains | 68,489 | 6,499 | 10.5x | 2 / 3 | 3.4 / 3.9 |
| contact | 136,904 | 21,873 | 6.3x | 4 / 5 | 5.0 / 12.9 |
| bounces | 69,944 | 9,310 | 7.5x | 2 / 3 | 4.2 / 11.9 |
| segment | 187,964 | 33,486 | 5.6x | 5.4 / 6 | 12.2 / 16.4 |
Every task passed 5 of 5 times in both modes on both models, and no tool call returned an error.
The token saving is largest on short tasks, where the tool list is most of the request, and smallest on the multi-step task, where the search results and API responses add up. Even there, compact mode sent 5.6 to 5.8 times fewer tokens.
Results: cost, warm and cold
This is where our first, smaller run misled us. In that run almost every task started with a cold cache, so the full list was written to the cache again and again, and compact mode looked 6 times cheaper. With a warm cache the picture changes. Totals over 25 runs per model and mode:
| Opus 5.5 full | Opus 5.5 compact | Sonnet 5.5 full | Sonnet 5.5 compact | |
|---|---|---|---|---|
| Input tokens | 2,728,362 | 381,817 | 2,657,533 | 400,747 |
| Output tokens | 8,282 | 14,296 | 7,349 | 13,526 |
| Cost, warm cache | $0.84 | $0.81 | $0.40 | $0.43 |
| Cost, nothing cached | $11.08 | $1.81 | $5.39 | $0.94 |
| Total time | 175 s | 250 s | 140 s | 273 s |
The Sonnet 5.5 compact total includes one slow run (42.6 seconds, against a 12.9-second median for that task); the medians in the tables above leave it out.
Why the warm costs are so close: a cached token costs $0.20 per million on Opus 5.5 and $0.10 on Sonnet 5.5, so re-reading 34,000 cached tokens costs less than a cent per turn. Compact mode saves that, then spends it on an extra turn and 1.7 to 1.8 times the output tokens (searching, reading search results, more thinking).
The cold write is where compact mode wins on cost. Writing the full tool list and system prompt to the cache costs about $0.17 on Opus 5.5 and $0.085 on Sonnet 5.5 (33,846 tokens at the 5-minute write price). For compact mode it is under half a cent. A client pays that write at the start of a session, after five minutes without a request, and whenever the tools or system prompt change. And a client that does not use prompt caching at all pays full input price for the list on every turn, which is the "nothing cached" row.
Search decides the answer
The bounces task showed something we did not plan for. Two endpoints can answer "what share of my email bounced in the last 7 days". /v1/analytics?days=7 uses a rolling window that ends now. /v1/emails/metrics takes a start and end date, and a start date of 2026-11-17 means midnight, about six hours before the rolling window starts. On our account those six hours held 17 bounces, so the answer was 1.4% from the first and 2.5% from the second.
With the full list, both models picked get_analytics and said 1.4%. In compact mode, searches like "email statistics bounces last 7 days" returned getEmailMetrics among the results, and both models used it every time. Sonnet 5.5 passed plain dates and answered 2.5% in all five runs. Opus 5.5 did that once; in two runs it passed exact timestamps for a rolling window, and in two it passed no dates and got the endpoint's default range (from 18 November). Those four came to 1.4%. Both models also noticed that the bounce_rate field counts hard bounces only (as Amazon SES does) and added the soft bounces themselves, as the task asked. Our check accepted an answer within 0.2 points of either endpoint's figure for the last 7 days, so both 1.4% and 2.5% passed. The lesson for compact mode, and for any search-based tool layer: the search ranking picks the endpoint, and the endpoint's defaults shape the answer.
When to use which endpoint
Use compact mode (/api/mcp/compact) when:
- your assistant has many MCP servers connected, and their tool lists together take a real share of the context window;
- you use a model or client with a small context window;
- your client does not cache the tool list, or your sessions are short with long gaps, so you pay the cold write often.
Use the full list (/api/mcp) when:
- latency matters most. The full list was faster in every task;
- you want each tool in your client's approval prompt, so you can allow
list_domainsand still be asked aboutsend_email; - you want the task tools (
explain_email,deliverability_report,check_before_send), which compact mode does not have.
Check what your client does first. Claude Code defers MCP tool definitions by default and loads them through its own tool search, so there the full list costs little context until a tool is used. Compact mode helps most in clients that send every tool definition up front.
How to connect
Compact mode takes the same OAuth sign-in or API key as /api/mcp. Only the URL changes.
Claude Code:
# OAuth: sign in when Claude Code asks
claude mcp add --scope user --transport http smtpfast-compact https://smtpfa.st/api/mcp/compact
# Or with an API key
claude mcp add --scope user --transport http smtpfast-compact https://smtpfa.st/api/mcp/compact \
--header "Authorization: Bearer sf_your_api_key"
claude.ai and Claude Desktop: open Customize > Connectors, click + Add, then Add custom connector, and use https://smtpfa.st/api/mcp/compact as the URL. Sign in with SMTPfast when asked.
ChatGPT: where your plan and workspace allow custom MCP servers, open chatgpt.com/plugins, click +, then Add custom MCP server. Enter https://smtpfa.st/api/mcp/compact as the Server URL, choose OAuth, select Create as a plugin, and install it. ChatGPT connections get the ChatGPT tool profile in compact mode too: search_api only finds the operations that profile allows.
Cursor: in .cursor/mcp.json (one project) or ~/.cursor/mcp.json (every project):
{
"mcpServers": {
"smtpfast-compact": {
"url": "https://smtpfa.st/api/mcp/compact",
"headers": { "Authorization": "Bearer ${env:SMTPFAST_API_KEY}" }
}
}
}
Remove the headers line to sign in with OAuth instead. We ran compact mode through the API for this post; we did not test the ChatGPT and Cursor steps in their apps. The MCP docs have the rest.
A bug the review found: ".." as an id
Before compact mode shipped, the code review found a bug that also affected the full tool list. Our MCP tools build API paths from ids the model passes, with encodeURIComponent. That function leaves dots alone, so an id of .. stays .., and the URL parser then resolves it. A call like "delete thread .. in inbox X" became a request to /inboxes/X/threads/.., which the parser turns into /inboxes/X, a different route from the one the tool was meant to reach. The key's scopes still applied, but the operation was not the one the client had shown the user.
The fix is one check in the client that every tool uses: refuse a path segment that is . or .., after decoding, so %2e%2e is caught too. The lesson is short: validate ids before you build API paths from them. Encoding is not validation, and an MCP server takes its ids from a model, which takes them from whatever it read.
What we did not measure
- Other clients and models. We ran our own script on two Claude models. Clients that defer tools, trim descriptions or cache differently will see different numbers.
- Many servers at once. The case for compact mode grows with every other MCP server in the context. We measured SMTPfast alone.
- Long sessions. Each run was one task in a fresh conversation. In a long session, the full list is written to the cache once and read many times, so compact mode's cost advantage gets smaller.
- Approvals. In our script no person approved calls. In a client that asks before each call, compact mode asks about
call_apievery time, and you read the operation id in the arguments to see what it will do. - Small samples. Five runs per task, model and mode. Fewer tokens, more turns, more output and more time held in all five tasks on both models; warm cost went either way task by task. Treat the exact percentages as rough. One Sonnet 5.5 compact run took 42.6 seconds against a 12.9-second median for that task, which is why we quote medians for time.
The spend for all 100 runs, the cache warm-ups and a pilot was about $2.85 at list prices. The first, smaller round on Opus 5.5 (12 runs and a 3-run trial, mostly cold cache) cost about $1.70 more.
Sources
- Cloudflare: Code Mode, give agents an entire API in 1,000 tokens (February 2026)
- Anthropic: Code execution with MCP, building more efficient agents (November 2025)
- Claude Code: MCP tool search
- OpenAI: adding a custom MCP server in ChatGPT
- SMTPfast MCP docs
- How to send email from your AI agent with MCP
Frequently asked questions
What is MCP compact mode?
It is the SMTPfast MCP server with two tools in place of the full list. search_api finds API operations by what they do and returns their params; call_api runs one operation by its id. It lives at https://smtpfa.st/api/mcp/compact. The full server at https://smtpfa.st/api/mcp is unchanged.
How many tokens does compact mode save?
The tool list goes from 109 tools and 33,743 tokens to 2 tools and 634 tokens, counted with Anthropic's token counting API. Over whole tasks, in 50 runs per model, compact mode sent 7.1 times fewer input tokens through Claude Opus 5.5 and 6.6 times fewer through Claude Sonnet 5.5.
Is compact mode cheaper?
Only when the tool list is not in the prompt cache. With a warm cache, 25 runs per mode cost about the same ($0.81 compact vs $0.84 full on Opus 5.5, $0.43 vs $0.40 on Sonnet 5.5), because cached tokens are cheap and compact mode needs more turns and output. Without caching, compact mode was about 6 times cheaper. Each cache miss of the full list costs about $0.17 on Opus 5.5 and $0.085 on Sonnet 5.5.
Is compact mode slower?
Yes. The model has to search before it calls, which adds one model turn per task. In our runs, adding up the median time of each task, compact mode took about 50% longer on Claude Opus 5.5 and 75% longer on Claude Sonnet 5.5. If latency matters most, use the full tool list.
Does compact mode run code the model writes?
No. Cloudflare's Code Mode runs model-written JavaScript in a V8 isolate; we chose not to run code on our servers. call_api runs exactly one named operation through the same tool as the full list, with the same scopes, rate limits, OAuth step-up and ChatGPT restrictions. The trade-off is that the model cannot chain or filter calls inside one step.
Which MCP clients can use compact mode?
Any client that connects to a remote MCP server over Streamable HTTP: Claude Code, claude.ai and Claude Desktop custom connectors, ChatGPT custom MCP servers and Cursor. Use https://smtpfa.st/api/mcp/compact as the server URL, with OAuth or an API key.
Ready to get started?
Start sending transactional email today. Free to start, no credit card required.
Start freeRelated Posts
Best Email APIs for AI Agents in 2027 (7 Compared, 4 Fully Tested)
For an agent that needs its own inbox, four APIs passed every functional check we ran: SMTPfast, AgentMail, Resend Inboxes and Nylas Agent Accounts. All four sent, received in about 3 seconds, kept reply threads, handled attachments and worked through MCP in Claude Code. AgentMail is the fastest start (an inbox from one API call, no domain, no person); Nylas adds calendars and asks a person to confirm MCP sends; Resend fits if you already send with it; SMTPfast needs your own domain and a paid plan. Postmark received mail but could not send yet while its new-account review was pending. Tested on 22 November 2026.
How to Set Up Email for Better Auth: Custom SMTP or an Email API
Better Auth does not send email itself: you give it functions such as sendVerificationEmail and sendResetPassword, and they call your email provider. Call an email API from them, or use Nodemailer with host smtp.smtpfa.st, port 587, username smtpfast and an API key with the email:send scope. Do not await the send, so response times do not show whether an account exists.