Skip to main contentSkip to Content
MCP Server (AI Assistants)

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 URLhttps://app.campaignos.site/api/mcp (self-hosted: https://<your-domain>/api/mcp)
TransportStreamable HTTP
Protocol2026-07-28, with fallback for clients on 2025-11-25, 2025-06-18 and 2025-03-26
AuthenticationOAuth 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/mcp

Then 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/inspector

What 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

ScopeAllows
campaignos:readView contacts, segments, campaigns, templates, messages, inbox, CRM and analytics. Always granted.
campaignos:writeCreate 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 VIEWER cannot write even on a read-and-write connection, and deleting contacts still needs contacts.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.

AreaTools
Accountwhoami, list_workspaces, get_workspace, create_workspace ✎, update_workspace ✎
Memberslist_members, invite_member ✎, update_member ✎, remove_member ✎
Contactslist_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
Segmentslist_segments, get_segment, preview_segment, create_segment ✎, update_segment ✎, delete_segment ✎, list_segment_members, add_segment_members ✎, remove_segment_members ✎
Campaignslist_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 ✎
Templateslist_templates, get_template, create_template ✎, update_template ✎, delete_template ✎, preview_template, send_test_email ✎
Messages & eventslist_messages, get_message, send_message ✎, list_events, track_event ✎
Analyticsget_analytics_overview, get_analytics_timeseries, get_deliverability, get_traffic_sources
Formslist_forms, get_form, list_form_submissions
Inboxlist_inbox_threads, get_inbox_thread, reply_to_thread ✎, update_inbox_thread ✎
CRMlist_deals, get_deal, create_deal ✎, update_deal ✎, delete_deal ✎, list_tasks, create_task ✎, update_task ✎, complete_task ✎, delete_task ✎
Operationssearch, 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.

PromptWhat it does
workspace_health_checkReviews audience, sending and deliverability and lists what to fix first
review_campaignExplains one campaign’s workflow and results and suggests improvements
build_segmentTurns a plain-language audience into tested segment rules
plan_broadcastPrepares audience, template, preview and schedule for a one-off send

For client developers

The server follows the MCP authorization specification.

EndpointPurpose
POST /api/mcpMCP endpoint. Without a valid token it answers 401 with a WWW-Authenticate: Bearer resource_metadata="…" challenge
GET /.well-known/oauth-protected-resource/api/mcpProtected Resource Metadata (RFC 9728)
GET /.well-known/oauth-authorization-serverAuthorization Server Metadata (RFC 8414)
GET /mcp/authorizeAuthorization endpoint (sign-in and consent)
POST /api/mcp/oauth/tokenToken endpoint: authorization_code and refresh_token grants
POST /api/mcp/oauth/registerDynamic Client Registration (RFC 7591), kept for older clients
POST /api/mcp/oauth/revokeToken revocation (RFC 7009)
  • Client identity. Client ID Metadata Documents are preferred: use an https URL as client_id and serve a JSON document there with client_id, client_name and redirect_uris. Dynamic registration is also available. Only public clients are supported (token_endpoint_auth_method: "none").
  • PKCE. S256 is 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. https URLs, loopback http URLs (any port) or private-use schemes, matched exactly. Authorization responses include iss (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 403 with error="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.

Last updated on