API reference
MCP server
Give an agent (Claude Code, Claude Desktop, Cursor) the Refresh API as tools over the Model Context Protocol.
The MCP server is one file, mcp/server.mts. Ask support for it. It speaks the Model Context Protocol over stdio and has no dependencies. Node 24 or later runs it as is.
Every tool calls the public API with your API key. The server adds no permission and removes none. A key that cannot do something with curl cannot do it through a tool.
Configuration
| Variable | Meaning | Default |
|---|---|---|
F5SEND_API_KEY |
The API key (required). | — |
F5SEND_BASE_URL |
The API root. | https://api.f5send.com/api/v1 |
Use a f5_test_ key while an agent explores. The API accepts the same requests and the worker simulates each message (see Test mode). A f5_live_ key sends real mail.
Claude Code
claude mcp add f5send -e F5SEND_API_KEY=f5_test_… -- node /path/to/f5send/mcp/server.mts
Claude Desktop, Cursor and other clients
Add the server to the MCP configuration file of the client:
{
"mcpServers": {
"f5send": {
"command": "node",
"args": ["/path/to/f5send/mcp/server.mts"],
"env": { "F5SEND_API_KEY": "f5_test_…" }
}
}
}
Tools
The server reads the OpenAPI document from the configured API root at the first tools/list. Each operation becomes one tool with the operationId as its name. A new endpoint appears as a tool without a change to the server.
tools/list shows only the tools the key may call. The server reads the tier once from GET /keys/me. A SEND key sees the send-tier tools. A FULL key also sees deleteContact and deleteSuppression. An ADMIN key also sees the management tools.
A hidden tool is a convenience for the agent, not a boundary. tools/call still reaches the API, which answers 403 on its own. When GET /keys/me fails the server lists every tool rather than hide one the key can use.
The tools today: sendEmail, sendBatch, getEmail, listEmails, cancelEmail, createBroadcast, listBroadcasts, getBroadcast, sendBroadcast, cancelBroadcast, upsertContact, getContact, deleteContact, setSubscriptions, postEvent, listSuppressions, createSuppression, deleteSuppression.
The tool input is one object:
- a path parameter is a required string (
id); - a query parameter is an optional field (
status,limit,cursor); - an object request body contributes its fields directly (
from,to,subject, …); - any other request body sits under
body: the array ofsendBatch, the one-change-or-list shape ofsetSubscriptions.
sendEmail has no header argument. Set idempotency_key in the input; it has the same effect as the Idempotency-Key header.
Each tool carries MCP annotations: readOnlyHint on GET operations, destructiveHint on DELETE operations. Clients that honour them ask before a delete.
Results and errors
A successful call returns the API response as JSON text and as structuredContent. An API error returns isError: true with the status, the code and the message from Errors:
{ "error": { "status": 403, "code": "test_key_not_allowed", "message": "…" } }
A protocol problem (unknown tool, missing id, unreadable OpenAPI document) is a JSON-RPC error. The server writes diagnostics to stderr only.
Permissions
deleteContact and deleteSuppression need a FULL key; a SEND key gets 403 forbidden.
A f5_test_ key can call sendEmail, sendBatch, cancelEmail, cancelBroadcast and every read tool. The tools that start or change live state answer 403 test_key_not_allowed: createBroadcast, sendBroadcast, upsertContact, setSubscriptions, postEvent, createSuppression, deleteContact, deleteSuppression. See Authentication.