Files
warmbly/docs/content/docs/api/mcp.mdx
T

258 lines
21 KiB
Plaintext

---
title: MCP server
description: Connect any MCP client (Claude Code, Claude Desktop, Cursor) to Warmbly and use your data and workflows as tools. Sign in with OAuth, or scope a static API key.
---
Warmbly speaks the [Model Context Protocol](https://modelcontextprotocol.io). Point any MCP client at Warmbly's server and it can search contacts, check campaigns, read your inbox, draft replies, and create draft campaigns and automations, all scoped to what you grant it.
- **URL**: `https://api.warmbly.com/v1/mcp`
- **Transport**: streamable HTTP
- **Auth**: an OAuth 2.1 access token (browser sign-in), a static API key (bearer header), or an agency API key (see [Agencies](#agencies)).
There are two ways to connect. OAuth is the one-command path: you run a single `add` command, approve access in the browser, and the client holds a short-lived token it can refresh. An API key is the static path: you mint a key and paste it into the client config. Both reach the exact same tools, gated the exact same way.
## Connect with OAuth
This is the recommended path. You do not paste a key anywhere: the client discovers Warmbly's authorization server, opens a browser for you to sign in and approve the scopes, and stores the resulting token itself.
### Claude Code
```
claude mcp add --transport http warmbly https://api.warmbly.com/v1/mcp
```
Then run `/mcp` inside Claude Code and pick **Authenticate**. A browser opens, you sign in to Warmbly, approve the requested scopes, and you are connected. No header, no key.
### Claude Desktop and Cursor
Add the server with just its URL, and the client runs the OAuth flow on first use:
```json
{
"mcpServers": {
"warmbly": { "type": "http", "url": "https://api.warmbly.com/v1/mcp" }
}
}
```
<Callout type="info" title="What you are approving">
The consent screen marks a self-registered client as **Not affiliated with Warmbly**, names where approving sends access, and shows exactly which scopes the client will get: the ones it asks for that your role in the workspace covers, so a connected client never does more than you could yourself. Sending real mail is never one of them: `SEND_CAMPAIGNS` and API-key management are excluded from OAuth-connected MCP clients by design, and the assistant only ever drafts. You can revoke a connected client at any time from your dashboard under connected apps.
</Callout>
## Connect with an API key
Prefer a static, long-lived credential (CI, a shared script, a client that does not implement OAuth)? Mint an API key and send it as a bearer token:
```
Authorization: Bearer wmbly_...
```
<Callout type="info" title="Scope your key">
Create a dedicated API key for each MCP client and grant it only the scopes it needs (see [Permissions](/api/permissions/)). Grant the read/write scopes for the data you want the client to reach, and `AI_AGENT` if it should search the web or read your playbooks.
</Callout>
### Claude Code
```
claude mcp add --transport http warmbly https://api.warmbly.com/v1/mcp \
--header "Authorization: Bearer wmbly_..."
```
### Claude Desktop
Add to your `claude_desktop_config.json`:
```json
{
"mcpServers": {
"warmbly": {
"type": "http",
"url": "https://api.warmbly.com/v1/mcp",
"headers": { "Authorization": "Bearer wmbly_..." }
}
}
}
```
### Cursor
Add to `.cursor/mcp.json`:
```json
{
"mcpServers": {
"warmbly": {
"url": "https://api.warmbly.com/v1/mcp",
"headers": { "Authorization": "Bearer wmbly_..." }
}
}
}
```
## What is exposed
The server exposes exactly the tools your credential is allowed to use, whether that credential is an OAuth token or an API key. Each tool checks its own scope, and an OAuth token or API key also needs its member to hold the matching organization permission today. A credential with only read scopes sees only the read tools; one with write scopes sees those too, so an MCP client acts with precisely the permissions you granted, and nothing more.
This is a subset of what the in-product assistant can do. Two categories are dashboard-only and never reachable by an API key or OAuth token: sending email (`send_reply`, `compose_email`), and workspace governance (team, workspace settings, and billing). Those routes are session-only and have no API scope to grant, so they never appear over MCP.
Every tool is gated by its API permission. `tools/list` returns only the tools your mask allows. Sending-class tools (anything that transmits a message to a recipient) are never exposed over MCP regardless of scope; over MCP the assistant only produces drafts (`draft_reply`).
### Tool discovery
`tools/list` returns a core set of tools plus two discovery tools, so a client with a tool limit (Cursor, for example) never reaches it however many scopes you grant:
- `find_tools` searches every tool your credential may use by keywords and returns each one's description and input schema. An empty query lists everything, twenty at a time.
- `call_tool` runs a tool found that way, by `name`, with its `arguments`.
Every tool in the table below stays callable directly through `tools/call` whether or not it is listed. To list every tool instead, add `?tools=all` to the server URL (`https://api.warmbly.com/v1/mcp?tools=all`) or send the header `X-Warmbly-Tools: all`. The `initialize` response carries `instructions` that explain how Warmbly fits together and how to use discovery, for clients that pass them to the model.
### Docs and the full API
Six tools give a client the same understanding of the product a person gets from these docs, and reach every documented endpoint without a dedicated tool for each:
- `search_docs` and `read_doc` search and read these docs.
- `find_api` and `describe_api` search the [API reference](/api/) and return an endpoint's parameters, body schema and response.
- `api_read` calls a read-only endpoint (any `GET`, or a `POST` that only searches or previews) and `api_write` calls one that changes data. Both send your own credential through the endpoint's normal checks, so they can do exactly what a direct request with the same key or token could, and each call counts against your rate limits and shows in the key's usage log like any other request.
`api_read` and `api_write` refuse endpoints that send mail or start sending (use the dedicated tools, which are not exposed over MCP), sign-in and account security, API keys, webhooks and OAuth apps (their own tools keep secrets out of the conversation), file uploads, and endpoints that take a credential such as a password or API key. Fields holding a credential are withheld from their results.
| Tool | Does | Required scope |
|------|------|----------------|
| `search_contacts` | Find contacts by text | `READ_CONTACTS` |
| `get_contact` | Read one contact | `READ_CONTACTS` |
| `update_contact_fields` | Update contact fields | `WRITE_CONTACTS` |
| `add_tag` / `remove_tag` | Add or remove a label on a contact | `WRITE_CONTACTS` |
| `list_campaigns` | List campaigns | `READ_CAMPAIGNS` |
| `get_campaign_stats` | Campaign stats, all time or for the emails sent from `from` to `to` | `READ_ANALYTICS` |
| `list_campaign_leads` | A campaign's leads with derived status + totals | `READ_CONTACTS` |
| `create_campaign_draft` | Create a draft campaign | `WRITE_CAMPAIGNS` |
| `set_campaign_status` | Start or stop a campaign | `SEND_CAMPAIGNS` |
| `set_lead_hold` | Hold or resume one contact's flow in one campaign, without unsubscribing them | `WRITE_CAMPAIGNS` |
| `get_dashboard_analytics` | Sending stats for a period, org-wide or for chosen campaigns and campaign folders | `READ_ANALYTICS` |
| `list_mailboxes` | Sender mailboxes with health + warmup state | `READ_ANALYTICS` |
| `list_placement_tests` / `get_placement_test` | Inbox placement tests and where each copy landed | `READ_ANALYTICS` |
| `run_placement_test` | Send a step or template to the seed inboxes from one mailbox | `SEND_CAMPAIGNS` |
| `list_placement_batches` / `get_placement_batch` | Placement batches, their progress, and placement by sending domain, sending provider and recipient provider | `READ_ANALYTICS` |
| `run_placement_batch` | Run the same placement test from a campaign's senders or the whole workspace, optionally sampled. Signed-in members only: an API key starts a batch with `POST /placement/batches`, which applies the key's mailbox limits | `SEND_CAMPAIGNS` |
| `add_contact` / `delete_contact` | Create or delete a contact | `WRITE_CONTACTS` |
| `bulk_edit_contacts` | Label or subscribe many contacts at once | `BULK_CONTACTS` |
| `get_contact_timeline` / `get_contact_sent_emails` | Read a contact's activity and sent mail | `READ_CONTACTS` |
| `list_segments` / `get_segment` / `list_segment_fields` | Read saved audiences, and the fields a condition can name | `READ_CONTACTS` |
| `preview_segment` | Count what a set of conditions would match, saving nothing | `READ_CONTACTS` |
| `create_segment` / `update_segment` / `delete_segment` | Manage saved audiences | `WRITE_CONTACTS` |
| `set_segment_members` | Pin contacts into or out of a segment | `WRITE_CONTACTS` |
| `list_campaign_segments` | Read the segments feeding a campaign | `READ_CAMPAIGNS` |
| `set_campaign_segments` / `add_segment_to_campaign` | Link an audience to a campaign, or enrol its members once | `WRITE_CAMPAIGNS` |
| `list_forms` / `get_form` / `list_form_submissions` / `get_form_stats` | Read hosted forms, their submissions, and their funnel | `READ_CONTACTS` |
| `create_form` / `update_form` / `delete_form` | Manage hosted forms | `WRITE_CONTACTS` |
| `mint_form_link` | Get one contact's personalized form URL | `WRITE_CONTACTS` |
| `get_campaign_forms` | How a campaign's forms performed for its recipients | `READ_CAMPAIGNS` |
| `list_suppressions` | Read the do-not-contact list, and why each entry is on it | `READ_CONTACTS` |
| `add_suppressions` / `remove_suppression` | Suppress an address or domain, or lift one | `WRITE_CONTACTS` |
| `list_pipelines` / `list_deals` / `get_deal` / `list_deals_by_contact` | Read CRM pipelines and deals | `READ_CRM` |
| `create_task` / `create_deal` | Create CRM records | `WRITE_CRM` |
| `update_deal` / `move_deal_stage` / `delete_deal` | Edit, move, or delete a deal | `WRITE_CRM` |
| `list_tasks` / `list_task_types` | Read CRM tasks and task types | `READ_CRM` |
| `update_task` / `complete_task` / `delete_task` | Edit, complete, or delete a task | `WRITE_CRM` |
| `add_contact_note` / `list_contact_notes` | Add or read contact notes | `WRITE_CRM` / `READ_CRM` |
| `update_contact_note` / `delete_contact_note` | Edit or delete a note | `WRITE_CRM` |
| `create_pipeline` / `update_pipeline` / `delete_pipeline` | Manage CRM pipelines | `WRITE_CRM` |
| `create_pipeline_stage` / `update_pipeline_stage` / `delete_pipeline_stage` | Manage pipeline stages | `WRITE_CRM` |
| `get_campaign` / `list_campaign_senders` / `get_campaign_logs` | Read a campaign's config, senders, and logs | `READ_CAMPAIGNS` |
| `update_campaign` / `delete_campaign` | Edit or delete a campaign | `WRITE_CAMPAIGNS` |
| `set_campaign_senders` / `verify_campaign_tracking_domain` | Set senders, verify tracking domain | `WRITE_CAMPAIGNS` |
| `list_campaign_steps` | Read a campaign's sequence steps | `READ_CAMPAIGNS` |
| `add_campaign_step` / `update_campaign_step` / `delete_campaign_step` | Edit a campaign's sequence steps | `WRITE_CAMPAIGNS` |
| `list_threads` / `get_thread` | Read the unified inbox | `READ_UNIBOX` |
| `draft_reply` | Draft a reply (never sends) | `READ_UNIBOX` |
| `list_scheduled_sends` | List queued outbound messages | `READ_UNIBOX` |
| `mark_thread_seen` / `set_thread_labels` | Mark seen, set thread labels | `WRITE_UNIBOX` |
| `snooze_thread` / `unsnooze_thread` / `cancel_scheduled_send` | Snooze a thread, cancel a queued send | `WRITE_UNIBOX` |
| `get_mailbox` / `get_warmup_ban_status` | Read a mailbox's config and warmup standing | `READ_EMAILS` |
| `update_mailbox` / `set_mailbox_warmup` / `set_mailbox_send_hold` / `set_mailbox_tracking_domain` | Edit mailbox settings, warmup, the campaign hold, tracking domain | `WRITE_EMAILS` |
| `submit_warmup_appeal` / `disconnect_mailbox` | Appeal a warmup ban, disconnect a mailbox | `WRITE_EMAILS` |
| `create_automation_draft` / `list_automations` / `get_automation` | Read automations, create a disabled draft | `INTEGRATIONS` |
| `update_automation` / `set_automation_enabled` / `delete_automation` | Edit, enable, or delete an automation | `INTEGRATIONS` |
| `list_api_keys` / `create_api_key` / `update_api_key` / `revoke_api_key` | Manage API keys | `API_KEYS` |
| `list_webhooks` / `list_webhook_deliveries` | Read webhook endpoints and deliveries | `WEBHOOKS` |
| `create_webhook` / `update_webhook` / `delete_webhook` / `rotate_webhook_secret` / `verify_webhook` | Manage webhook endpoints | `WEBHOOKS` |
| `list_migration_providers` | The tools Warmbly migrates from and the credentials each needs | `IMPORT_TOOLS` |
| `create_migration` | Check another tool's API key and scan what it holds. The key is sealed on the server and never returned | `IMPORT_TOOLS` |
| `list_migrations` / `get_migration` | Read migrations, their inventory, progress and follow-up | `IMPORT_TOOLS` |
| `start_migration` | Start a scanned migration. Imported campaigns are drafts and never launch | `IMPORT_TOOLS` |
| `cancel_migration` / `link_migration_senders` | Cancel a migration, or link its draft campaigns to senders connected since | `IMPORT_TOOLS` |
| `get_store_status` / `search_store_domains` | Whether the store is open to the workspace, its prices and balance; search domains with their prices | `READ_STORE` |
| `list_store_orders` / `get_store_order` | Read store orders and their setup progress | `READ_STORE` |
| `list_store_domains` / `get_store_domain` / `list_store_mailboxes` | Read purchased and connected domains, their DNS records, and purchased mailboxes | `READ_STORE` |
| `create_store_quote` | Price domains and mailboxes for 15 minutes. Charges nothing | `MANAGE_STORE` |
| `add_store_dns_record` / `delete_store_dns_record` | Add or delete a DNS record on a store domain | `MANAGE_STORE` |
| `place_store_order` | Pay for a quote from the workspace balance. Needs `expected_due_now_micros`, the total that was shown | `MANAGE_STORE` |
| `renew_store_domain` / `set_store_domain_auto_renew` | Renew a domain now, or turn its auto-renew on or off | `MANAGE_STORE` |
| `cancel_store_mailbox` / `resume_store_mailbox` | Cancel a purchased mailbox at the end of its paid month, or undo that | `MANAGE_STORE` |
| `search_web` / `fetch_url` | Search and read public pages | `AI_AGENT` |
| `load_skill` | Read one of your playbooks | `AI_AGENT` |
| `search_docs` / `read_doc` | Search and read the Warmbly docs | none beyond MCP access |
| `find_api` / `describe_api` | Find an API endpoint and read its parameters and schemas | none beyond MCP access |
| `api_read` / `api_write` | Call a documented endpoint as your credential | the endpoint's own scope |
Two form surfaces are deliberately absent: brand-asset uploads (logo, cover, background) are multipart images with dimension and MIME limits that a tool call cannot express, and the custom forms domain is workspace-wide branding behind a DNS check, so it lives in settings rather than in a tool.
Rate limits apply to MCP calls exactly as they do to the rest of the API (per-key for API keys, per-user for OAuth tokens). `SEND_CAMPAIGNS` appears in the table because `set_campaign_status` and the placement tools need it. A self-registered MCP client is never granted it, so only an API key or app that holds the scope can start or stop a campaign over MCP. Tools that send a message to a recipient (`send_reply`, `compose_email`) are never exposed over the MCP transport regardless of scope.
Tools that return a secret (`create_webhook` and `rotate_webhook_secret`) return it to the MCP client that called them, which is the caller asking for it. The in-product assistant never sees these values.
The migration tools also need the member behind the credential to hold the manage contacts permission, and bringing campaigns or mailboxes over needs the matching campaign or mailbox permission. Mailbox passwords a source tool returns are only used when a signed-in member started the migration, so a migration started over MCP asks for every mailbox to be reconnected.
The [store](/guides/buy-mailboxes/) tools appear only when the instance has a store. Every one needs the member behind the credential to hold the manage mailboxes permission, and the five that charge or change what is charged (`place_store_order`, `renew_store_domain`, `set_store_domain_auto_renew`, `cancel_store_mailbox`, `resume_store_mailbox`) also need the manage billing permission, checked on every call; in the dashboard's assistant they also ask for a recent sign-in. Buying spends the workspace balance. When prices moved since the quote, `place_store_order` answers `price_changed` with a fresh quote and charges nothing; show the new total and order that quote once it is confirmed. The in-product assistant always pauses `place_store_order` for your approval. Getting a domain's transfer code and showing a mailbox's sign-in are not tools, because each returns a credential; use the [store routes](/api/endpoints/#domains-and-mailboxes) for those.
## Agencies
An [agency](/guides/agencies/) API key (`wmagency_...`) connects to the same URL and works across the agency's client workspaces:
```
claude mcp add --transport http warmbly https://api.warmbly.com/v1/mcp \
--header "Authorization: Bearer wmagency_..."
```
Without a `Warmbly-Organization` header, the session belongs to the agency. `tools/list` returns two kinds of tool:
- **Agency tools**, each gated by an agency scope on the key.
- **Every workspace tool the key's scopes allow**, each with a required `organization_id` argument. It names the client workspace to act in, and its value comes from `list_clients`.
| Tool | Does | Required scope |
|------|------|----------------|
| `list_clients` | The agency's client workspaces | `AGENCY_READ` |
| `create_client` | Create a client workspace | `AGENCY_MANAGE_CLIENTS` |
| `get_agency_overview` | Every client at a glance, problems first | `AGENCY_READ` |
| `list_agency_mailboxes` | Mailboxes across clients | `AGENCY_READ` |
| `list_agency_inbox` | Conversations across clients, read-only | `AGENCY_READ` and `READ_UNIBOX` |
| `get_agency_usage` | The shared send pool and the AI balance | `AGENCY_READ_USAGE` |
| `list_migration_providers`, `create_migration`, `list_migrations`, `get_migration`, `start_migration`, `cancel_migration`, `link_migration_senders` | Migrate a source account's workspaces into client workspaces. `start_migration` takes `targets`, mapping each source workspace to an existing client (`organization_id`), a new one (`create_name`, which also needs `AGENCY_MANAGE_CLIENTS`), or `skip` | `AGENCY_MIGRATE` |
In an agency session these migration tools are always the agency versions. To run one workspace's own migration, connect with the header below.
Every call with `organization_id` is checked before anything runs: the workspace must be a current client of the agency, and the staff member who created the key must still be an accepted member of it. The call then runs with that member's permissions in the client and the key's workspace scopes, exactly as a REST call with the header would. A client the agency has detached is refused on the next call. A member limited to selected campaigns and mailboxes in a client cannot use that client over MCP.
With a `Warmbly-Organization: <client id>` header, the session is that one client: it sees that workspace's tools without `organization_id`, and no agency tools.
Nothing that is session-only for an agency is exposed: billing, staff, agency API keys, brand, and inbox vendor accounts stay in the dashboard. An agency key never manages workspace API keys, connects a mailbox with credentials, or opens the realtime connection. Per-key rate limits and the IP allowlist apply to every call.
## How OAuth discovery works
The one-command flow is standard MCP authorization, so any spec-compliant client works without Warmbly-specific setup. On a request with no valid token, `/v1/mcp` returns `401` with a `WWW-Authenticate` header pointing at the protected-resource metadata. The client then walks:
- `GET /.well-known/oauth-protected-resource`: the resource and its authorization server ([RFC 9728](https://www.rfc-editor.org/rfc/rfc9728)).
- `GET /.well-known/oauth-authorization-server`: the authorize, token, and registration endpoints ([RFC 8414](https://www.rfc-editor.org/rfc/rfc8414)).
- `POST /v1/oauth/register`: dynamic client registration, so the client mints a public (PKCE) `client_id` with no manual app setup ([RFC 7591](https://www.rfc-editor.org/rfc/rfc7591)).
- Authorization code with PKCE (S256) in the browser, then `POST /v1/oauth/token` for a short-lived access token and a rotating refresh token.
The same discovery drives Warmbly's OAuth server for any client. See the [OAuth 2.1](/api/oauth/) page for the full authorization-server reference.
## See also
- [Agent tools (REST)](/api/agent-tools/) for the same registry over plain HTTP, for Hermes and OpenAI-style function-calling agents that do not speak MCP.
- [OAuth 2.1](/api/oauth/) for the authorization-server endpoints, scopes, and dynamic registration.
- [Authentication](/api/authentication/) for how API keys and OAuth tokens work.
- [Permissions](/api/permissions/) for the full scope list.
- To connect Warmbly to external MCP servers instead (the other direction), see the [Connect MCP tools](/guides/connect-mcp-tools/) guide.