Skip to main content
Use n8n’s MCP Client Tool with an AI Agent. You need an n8n workflow, an AI Agent and a configured chat model. This connects n8n to Plainrouter; the MCP Server Trigger serves the opposite direction.

1. Try the sandbox

  1. Attach MCP Client Tool to your AI Agent’s tool connection.
  2. Set Endpoint to https://plainrouter.com/mcp/sandbox.
  3. Select Server Transport → HTTP Streamable and Authentication → None.
  4. Set Tools to Include → Selected and choose get_account_state and get_signal_health.
  5. Run a manual chat with the sandbox prompt below. Name the node plainrouter-test to distinguish it.
The sandbox needs no Plainrouter account or key, returns synthetic data, and never contacts Meta. Ask:
Both calls should succeed and include sandbox: true. This checks the connection, not production data or ad execution.

2. Create a workspace key

In Plainrouter, select your workspace and open Settings → Workspace keys. Create a Read key for analysis; use Write for Actions, including Actions record reads. Copy it once into your protected credential configuration. Each key covers one workspace. Never put keys in prompts or source control. Key permissions and replacement.

3. Add Plainrouter to the client

Duplicate or reconfigure the MCP Client Tool for production: Name the production node plainrouter, attach it to the AI Agent, and keep credentials in n8n’s credential store. Add other tools only as needed.

4. Verify the connection

Start with this read-only request:
Check the tool result, not just the assistant’s summary: the workspace must be yours and the call must succeed. This workspace-only read works before connecting Meta. For account diagnostics, connect Meta and verify the selected account. Agent replies can vary. In Ask, changes wait for approval; in Full, policy-allowed changes run automatically. Rule violations are blocked in either mode. A client’s tool confirmation is separate from Plainrouter’s execution controls.

Send conversions from a workflow

Conversion sending uses a separate HTTP request to POST https://plainrouter.com/api/v1/events, authenticated with a Server secret, not an MCP Workspace key. Map the Conversion API body from a real eligible website event. Preserve its event ID and original time on retries, and supply the required consent and visitor context. Start with the automation solution and synthetic n8n exercise. A sandbox result does not verify production event delivery or attribution. Verify HTTP event acceptance and Meta delivery separately from the MCP connection.

5. Troubleshooting

  • Only an SSE Endpoint field appears: that is the older node shape. Use a current MCP Client Tool with HTTP Streamable support.
  • 401 on calls: use the raw Workspace key in Bearer Auth; do not double-prefix it or use a Server secret.
  • Agent never calls the tool: check the tool connection and selected-tool list, then inspect the workflow execution rather than trusting the chat summary.
References: n8n MCP Client Tool and current node configuration. Choose another client.