MCP Server
CampaignOS ships a Model Context Protocol server, so AI assistants such as Claude, ChatGPT, Cursor and VS Code can read and manage your workspaces in plain language: “how did last week’s campaign perform?”, “build a segment of customers who opened but never clicked”, “draft a win-back email and show me a preview”.
You sign in with your own CampaignOS account. The assistant acts as you, and can never do more than your role allows in each workspace.
| Server URL | https://app.campaignos.site/api/mcp (self-hosted: https://<your-domain>/api/mcp) |
| Transport | Streamable HTTP |
| Protocol | 2026-07-28, with fallback for clients on 2025-11-25, 2025-06-18 and 2025-03-26 |
| Authentication | OAuth 2.1 with PKCE — no API key to copy |
Connect a client
Add the server URL as a remote MCP server. The client opens a CampaignOS window where you sign in and approve the connection.
Claude (web, desktop, mobile)
Settings → Connectors → Add custom connector, then paste the server URL.
Claude Code
claude mcp add --transport http campaignos https://app.campaignos.site/api/mcpThen run /mcp inside Claude Code and choose Authenticate.
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"campaignos": { "url": "https://app.campaignos.site/api/mcp" }
}
}VS Code
Add to .vscode/mcp.json:
{
"servers": {
"campaignos": { "type": "http", "url": "https://app.campaignos.site/api/mcp" }
}
}Any other client
Any client that supports remote MCP servers with OAuth works: give it the server URL and it discovers everything else. To explore the server by hand, use the MCP Inspector:
npx @modelcontextprotocol/inspectorWhat you approve
The consent screen shows which app is asking and where you will be sent afterwards, and lets you decide two things.
What the app can do
| Scope | Allows |
|---|---|
campaignos:read | View contacts, segments, campaigns, templates, messages, inbox, CRM and analytics. Always granted. |
campaignos:write | Create and edit records, send messages and launch campaigns. Untick it for a read-only connection. |
Where it can do it — all your workspaces (including ones you join later), or only the workspaces you pick.
Access rules
Every tool call goes through the same checks as the web app and the REST API.
- Only your workspaces. A connection reaches a workspace only if you are a member of it. Asking for any other workspace returns
Workspace not found or access denied. - Only your role. Roles and per-member permission overrides apply unchanged: a
VIEWERcannot write even on a read-and-write connection, and deleting contacts still needscontacts.delete. - Only what you approved. A read-only connection is refused write tools with
insufficient_scope. A connection limited to chosen workspaces cannot reach your others or create new ones. - Immediate removal. Leaving a workspace, having your account suspended, or disconnecting the app ends its access on the next request.
- Audited. Changes made through MCP appear in the workspace audit log under your name.
API keys and provider credentials cannot be created or read through MCP.
Manage connected apps
Settings → MCP lists every app you have connected, with its access level, workspaces and last use. Disconnect revokes it immediately.
Connections belong to you, not to the workspace: other members connect with their own accounts.
Tools
Start with whoami or list_workspaces, then pass the workspaceId to every other tool. Tools marked ✎ need the campaignos:write scope.
| Area | Tools |
|---|---|
| Account | whoami, list_workspaces, get_workspace, create_workspace ✎, update_workspace ✎ |
| Members | list_members, invite_member ✎, update_member ✎, remove_member ✎ |
| Contacts | list_contacts, get_contact, create_contact ✎, upsert_contact ✎, update_contact ✎, delete_contact ✎, bulk_update_contacts ✎, get_contact_timeline, list_contact_notes, add_contact_note ✎, get_contact_consent, update_contact_consent ✎, list_companies, list_custom_fields |
| Segments | list_segments, get_segment, preview_segment, create_segment ✎, update_segment ✎, delete_segment ✎, list_segment_members, add_segment_members ✎, remove_segment_members ✎ |
| Campaigns | list_campaigns, get_campaign, create_campaign ✎, update_campaign ✎, save_campaign_workflow ✎, clone_campaign ✎, delete_campaign ✎, enroll_in_campaign ✎, list_campaign_enrollments, get_campaign_logs, dry_run_campaign, get_campaign_analytics, create_broadcast ✎ |
| Templates | list_templates, get_template, create_template ✎, update_template ✎, delete_template ✎, preview_template, send_test_email ✎ |
| Messages & events | list_messages, get_message, send_message ✎, list_events, track_event ✎ |
| Analytics | get_analytics_overview, get_analytics_timeseries, get_deliverability, get_traffic_sources |
| Forms | list_forms, get_form, list_form_submissions |
| Inbox | list_inbox_threads, get_inbox_thread, reply_to_thread ✎, update_inbox_thread ✎ |
| CRM | list_deals, get_deal, create_deal ✎, update_deal ✎, delete_deal ✎, list_tasks, create_task ✎, update_task ✎, complete_task ✎, delete_task ✎ |
| Operations | search, list_jobs, list_audit_logs, list_activity, list_webhooks |
Each tool takes the same fields as the matching REST endpoint and returns the same JSON, so the rest of this documentation applies to MCP too. Failed calls come back as a tool error with the REST message and status, for example Insufficient permissions (HTTP 403).
Tools that reach real people or cannot be undone — send_message, create_broadcast, enroll_in_campaign, reply_to_thread, activating a campaign, and every delete_* — are flagged so assistants ask you first. preview_segment, preview_template and dry_run_campaign let the assistant check its work without sending anything.
Prompts
Ready-made starting points that clients show as slash commands or prompt pickers.
| Prompt | What it does |
|---|---|
workspace_health_check | Reviews audience, sending and deliverability and lists what to fix first |
review_campaign | Explains one campaign’s workflow and results and suggests improvements |
build_segment | Turns a plain-language audience into tested segment rules |
plan_broadcast | Prepares audience, template, preview and schedule for a one-off send |
For client developers
The server follows the MCP authorization specification.
| Endpoint | Purpose |
|---|---|
POST /api/mcp | MCP endpoint. Without a valid token it answers 401 with a WWW-Authenticate: Bearer resource_metadata="…" challenge |
GET /.well-known/oauth-protected-resource/api/mcp | Protected Resource Metadata (RFC 9728) |
GET /.well-known/oauth-authorization-server | Authorization Server Metadata (RFC 8414) |
GET /mcp/authorize | Authorization endpoint (sign-in and consent) |
POST /api/mcp/oauth/token | Token endpoint: authorization_code and refresh_token grants |
POST /api/mcp/oauth/register | Dynamic Client Registration (RFC 7591), kept for older clients |
POST /api/mcp/oauth/revoke | Token revocation (RFC 7009) |
- Client identity. Client ID Metadata Documents are preferred: use an
httpsURL asclient_idand serve a JSON document there withclient_id,client_nameandredirect_uris. Dynamic registration is also available. Only public clients are supported (token_endpoint_auth_method: "none"). - PKCE.
S256is required on every authorization request. - Resource indicators. Send
resource=<server URL>on authorization and token requests (RFC 8707). Tokens are bound to that URL and rejected anywhere else. - Redirect URIs.
httpsURLs, loopbackhttpURLs (any port) or private-use schemes, matched exactly. Authorization responses includeiss(RFC 9207). - Tokens. Access tokens last one hour. Refresh tokens last 30 days and rotate on every use; replaying a used refresh token or authorization code revokes the whole connection.
- Step-up. Calling a write tool with a read-only token returns
403witherror="insufficient_scope"and the scope to request. - Limits. 240 requests per minute per connection.
A request on the current protocol revision looks like this:
curl https://app.campaignos.site/api/mcp \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2026-07-28" \
-H "Mcp-Method: tools/call" \
-H "Mcp-Name: list_workspaces" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "list_workspaces",
"arguments": {},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}'The server is stateless: there is no session to open or resume, and every request stands alone.
MCP or API keys?
Use MCP when a person works through an AI assistant: access follows that person and their role. Use API keys for your own backend or scripts, where access belongs to one workspace rather than to a person.