Try synthetic data
Check the client connection without a Plainrouter account or token.
Connect your account
Configure your workspace token and confirm the first account read.
Choose your MCP endpoint
Plainrouter MCP uses owner-issued workspace execution tokens. Each token binds the client to one workspace, one Meta ad account, and an explicit access tier.
If you are choosing between a Signals workspace secret, workspace execution token,
or OAuth management credential, see Authentication and
clients.
Before you begin
For the sandbox, you only need a client with remote HTTP MCP support. For production, you also need:- A Plainrouter account with access to the intended workspace.
- An active Meta ad account connection.
- An MCP-compatible client that can send a fixed bearer token to a remote HTTP server.
- A workspace owner who can issue the token.
- A clear choice of the one advertising account the client should use.
ads_read or ads_management. Governed creative execution needs ads_management.
Start in test mode
In a terminal with Claude Code installed, add the test server:/mcp to check the connection. No Plainrouter account or credential is required. Other MCP clients can use the same URL with HTTP transport.
The endpoint exposes:
get_account_stateget_signal_healthget_performancevalidate_sandbox_event
"sandbox": true. Test mode reads no
tenant data, persists nothing, and contacts no advertising provider. It exposes
no proposal, write, approval, Launcher, or spend-affecting tool.
Ask the agent:
https://plainrouter.com/mcp and configure a workspace execution
token. The three read-tool names and their argument shapes match production.
The production endpoint exposes its protocol handshake, tool and resource
catalogs, and static
ui:// app shells without a credential. Tool calls and
account-data reads remain account-bound and return HTTP 401 without a valid
workspace execution token.Which MCP protocol should my client use?
Plainrouter supports2026-07-28 through server/discover. Existing clients using initialize can negotiate 2025-11-25 or 2025-06-18. Let your MCP client handle the protocol; the Claude Code configuration below does not need manual protocol fields.
For a custom HTTP client, start with this credential-free sandbox discovery request:
result.supportedVersions includes 2026-07-28 and result._meta["io.modelcontextprotocol/serverInfo"].name is Plainrouter Sandbox. Discovery confirms protocol compatibility; it does not read your account or verify a tool call.
For subsequent 2026-07-28 requests:
Requests are stateless: do not wait for or require an
Mcp-Session-Id response header. Legacy clients without protocol metadata in _meta remain on the compatibility path; do not mix the two request formats. Sending either protocol metadata key selects the modern validation path.
The published server card lists the current protocol, tools, and resources. The transport upgrade reference explains modern headers and legacy compatibility.
Connect with a workspace token
1
Issue the token
In Plainrouter, switch to the intended workspace and open API in the dashboard. Choose the exact ad account, a Read, Write, or Admin tier, and an expiry.
2
Copy it once
Copy the complete token immediately after issuance. Plainrouter cannot display it again.
3
Add the Plainrouter MCP server
In your MCP client, add
https://plainrouter.com/mcp as a remote HTTP server and configure the token as its bearer credential.4
Confirm the bound account
Call
get_account_state first. Confirm the returned workspace and account before continuing.Configure Claude Code for your Meta ad account
Add this server entry to your project’s.mcp.json, preserving any existing servers. Claude Code expands environment variables in MCP headers.
PLAINROUTER_WORKSPACE_TOKEN in the terminal environment through your local secret manager before starting Claude Code. Keep the variable reference in the file; do not replace it with the token or paste the token into an agent prompt. Open /mcp and allow the project connection when prompted.
Start with a Read token for account and library inspection. Use Write or Admin only when you need proposal-producing tools.
Confirm a read-only production connection
Ask the agent:get_signal_health to inspect conversion delivery and matching diagnostics. Missing Signals setup or measurement history is a separate setup issue; a successful account read does not establish healthy tracking.
For the returned fields and their meaning, see the MCP tool reference.
Permissions
The agent cannot supply another account ID to widen access. Creative tools recheck that provider objects belong to the approved account.
Recommended workflows
Once the account read succeeds, choose a task:- Diagnose Signals with a stored read. Use ingestion verification only when you explicitly want a diagnostic write; it does not verify a real arrival.
- Inspect stored reconciliation and its evidence limits.
- Create a paused creative variant: read the account library, select the source ad and asset, submit a proposal, and review the approval link.
Example: request a creative proposal
After you select a source ad and an asset from the approved account’s creative library, ask:PAUSED.
Follow the creative workflow and proposal review guide for the next steps. Use the Actions overview to check supported changes before requesting a different operation.
Authorization lifetime and revocation
Workspace tokens expire after 30, 90, or 365 days. The owner can rotate or revoke them immediately from API in the dashboard. Plainrouter also caps a token by the issuing person’s current workspace role on every request. If that person’s role no longer covers the token tier, the token stops authenticating at that tier. Issue a new token instead of trying to reuse a credential whose authority changed.Troubleshoot
A custom client gets HTTP 400 or a protocol error
For JSON-RPC error -32020, compare MCP-Protocol-Version, Mcp-Method, and, where required, Mcp-Name with the request body. A missing required header or mismatched value fails before the tool runs. Ensure your reverse proxy preserves these headers.
For -32022, check the protocol version against discovery and use a supported version. Follow the complete modern request format; changing only the version header is not enough. An authentication 401 is a separate credential failure.
The client waits for a session ID
Plainrouter processes requests independently and does not returnMcp-Session-Id. Update a client or custom transport that requires that header. Keep sending the workspace bearer credential on each production tool request; a successful discovery response does not authorize later calls.
Claude Code cannot load the token variable
ConfirmPLAINROUTER_WORKSPACE_TOKEN is set in the environment that starts Claude Code. Restart the client after supplying it. Keep the variable name consistent with .mcp.json; do not print the token to debug the connection.
The client receives 401 Unauthorized
Confirm the client sends the complete workspace token as a bearer credential and that it has not expired or been revoked. Also confirm its issuing person still holds a workspace role that covers the token tier.
If the client is sending an OAuth access token, the rejection is expected. Replace it with a workspace execution token.
A creative tool reports a missing permission
Issue a token with the required tier. Use Read for library access and Write or Admin for proposal-producing creative tools and Launcher draft batches.Plainrouter asks you to reconnect Meta
The selected account may lack an active Meta connection or the requiredads_read or ads_management access. Reconnect Meta, confirm the same ad account, and retry the same idempotent request.