What is MCP?
The Model Context Protocol (MCP) is an open standard that lets AI assistants connect to external tools and data sources in a secure, structured way. Roe exposes your agents, policies, jobs, and table utilities as MCP tools that ChatGPT, Claude, Cursor, Claude Code, and Codex can call directly. Once configured, you can ask your assistant to “list my Roe agents” or “run the merchant-risk agent against this URL”, and it will invoke the live Roe API on your behalf through Roe’s hosted MCP endpoint.How it works
Roe hosts a streamable-HTTP MCP server. The MCP host determines which Roe backend is used:| Deployment | MCP URL | Roe API used by the MCP server |
|---|---|---|
| Roe cloud | https://mcp.roe-ai.com/mcp | https://api.roe-ai.com |
| Single tenant | https://mcp.<tenant>.roe-ai.com/mcp | https://api.<tenant>.roe-ai.com |
Authorization: Bearer <access_token> headers on MCP calls.
The MCP server verifies the token issuer, audience, expiry, and mcp.tools
scope before it calls Roe APIs.
You can also connect without OAuth using a Roe API key. Any client that
lets you set custom request headers — Cursor, Claude Code, and
Codex — sends Authorization: Bearer <api-key> plus
X-Roe-Organization-Id: <org-uuid> on every call instead of running the consent
flow. It’s a great fit for scripts, automations, and CI, or any time you’d
rather manage a key yourself. See
Connect with an API key (no OAuth) for
per-client setup.
ChatGPT and Claude connect through their built-in connector UIs, which use
OAuth, so those clients always use OAuth. The MCP URL already points each
connection at the right backend, so you never need to set X-Roe-API-Base-URL.
Connection values
OAuth clients usually need only the MCP URL:| Value | Where to get it |
|---|---|
| MCP URL | https://mcp.roe-ai.com/mcp for Roe cloud, or https://mcp.<tenant>.roe-ai.com/mcp for a single-tenant deployment |
| Value | Header | Where to get it |
|---|---|---|
| API key | Authorization: Bearer <key> | app.roe-ai.com/settings/api-keys or the matching single-tenant app |
| Org ID | X-Roe-Organization-Id: <uuid> | Settings → Organization in the same Roe app that minted the key |
Setup
Every client connects to the same hosted MCP URL and signs in with OAuth — no API key required. Usehttps://mcp.roe-ai.com/mcp for Roe cloud, or
https://mcp.<tenant>.roe-ai.com/mcp for a single-tenant deployment. The first
time you connect, a browser window opens the Roe sign-in screen; approve it
once and you’re ready to use the tools — the client remembers you from then on.
- ChatGPT (web)
- ChatGPT (desktop app)
- Claude (web)
- Claude Desktop
- Claude Code
- Codex
- Cursor
Connect Roe as a remote MCP connector in ChatGPT on the web (chatgpt.com).
- Open Settings → Connectors. On Plus/Pro, enable Developer mode (Settings → Connectors → Advanced) to add custom connectors; on Business/Enterprise, a workspace admin manages connectors.
- Click Create (or Add custom connector).
- Name it
Roeand set the MCP server URL tohttps://mcp.roe-ai.com/mcp(orhttps://mcp.<tenant>.roe-ai.com/mcp). - Keep authentication on OAuth. ChatGPT discovers Roe’s authorization metadata and registers automatically (dynamic client registration + PKCE).
- Click Connect and complete the Roe consent flow in the browser.
- In a chat, open the + / tools menu, enable Roe, and ask it to run a tool.
Connect with an API key (no OAuth)
OAuth is the smoothest option for most people, but if you’d rather use a key, any client that lets you set custom request headers can skip the sign-in flow and authenticate with a Roe API key plus your organization id. It’s a natural fit for scripts, automations, and CI. Both headers are required in this mode:| Header | Value | Where to get it |
|---|---|---|
Authorization | Bearer <api-key> | app.roe-ai.com/settings/api-keys (or the matching single-tenant app) |
X-Roe-Organization-Id | <org-uuid> | Settings → Organization in the same Roe app that minted the key |
https://mcp.roe-ai.com/mcp; on a single-tenant deployment use
https://mcp.<tenant>.roe-ai.com/mcp and keys from that tenant. You don’t need
X-Roe-API-Base-URL — the MCP host already selects the right backend.
ChatGPT and Claude’s remote-connector UIs don’t expose custom headers, so they
can’t send
X-Roe-Organization-Id and must use OAuth. API-key mode
works with Cursor, Claude Code, and Codex.- Cursor
- Claude Code
- Codex
Edit For a single-tenant deployment, use the tenant MCP URL and keys from that
tenant:Restart Cursor. The Roe tools appear in any new Agent or Composer chat under the
MCP servers list — no browser consent step, because the API key authenticates
every call.
~/.cursor/mcp.json (create it if missing) and add a headers block:whoami tool — source comes back as mcp-bearer for
API-key connections.
Verifying the connection
After setup, ask your assistant:“Use the Roe whoami tool to confirm the connection.”A successful response returns your
user_id, org_id, email, and source.
For OAuth connections, source is mcp-oauth. For API-key connections,
source is mcp-bearer. If you see an authentication error instead, see
troubleshooting below.
For a transport-level check, see the smoke test.
Available tools
The MCP server wraps the public Agents API, Policies API, and table utilities. Tool descriptions are tuned for natural language discovery, so clients can choose tools from prompts like “list my agents” or “cancel this Roe job.”| Module | Tools |
|---|---|
| Identity | whoami |
| Discovery | list_agent_engine_types, list_supported_models |
| Tables | upload_table |
| Agents (CRUD) | list_agents, get_agent, create_agent, update_agent, delete_agent, duplicate_agent |
| Agent versions | list_agent_versions, get_agent_version, get_current_agent_version, create_agent_version, update_agent_version, delete_agent_version |
| Runs | run_agent (sync, ≤25s), trigger_agent_run (async, returns job_id) |
| Jobs | get_agent_job_status, get_agent_job_result, cancel_agent_job, download_job_reference, agents_jobs_delete_data_create |
| Policies | list_policies, get_policy, create_policy, update_policy, delete_policy, list_policy_versions, get_policy_version, create_policy_version, update_policy_version |
| Batch | run_agents_batch (use when N ≥ 3), get_agent_jobs_status_batch, get_agent_jobs_result_batch, cancel_all_agent_jobs |
get_agent_job_status returns the raw integer from roe.models.job.JobStatus:
0 PENDING, 1 STARTED, 2 RETRY, 3 SUCCESS, 4 FAILURE, 5 CANCELLED,
6 CACHED. Terminal set is {3, 4, 5, 6}.
Smoke test
The MCP streamable-HTTP transport is session-oriented, sotools/list alone
returns 400 Missing session ID. You need three POSTs: initialize to mint
a session, notifications/initialized to acknowledge, then tools/list.
OAuth clients handle the bearer token for you. To inspect the public OAuth
metadata manually:
mcp.<tenant>.roe-ai.com and app.<tenant>.roe-ai.com.
For API-key mode, use the smoke below:
event: message SSE frame whose data: line is a
JSON-RPC body listing the registered Roe tools.
Useful prompts
Once connected, try:Claude Code skill
A Claude Code skill is a smallSKILL.md Claude Code reads on startup. Installing the Roe skill
teaches the model the correct headers, when to use run_agent vs
trigger_agent_run vs run_agents_batch, and how to interpret job status
codes — so you don’t have to repeat that context in every chat.
Save the block below to ~/.claude/skills/roe-mcp/SKILL.md and restart
Claude Code:
Rate limits and errors
- OAuth token buckets are keyed by user, org, and tool; API-key buckets are
keyed by bearer and tool. When a bucket drains, the server returns a
structured
rate_limitederror with aRetry-Afterheader. - Upstream Roe
429responses map to MCP-level503withRetry-After, so well-behaved clients back off rather than treating the response as token invalidation. - A
401in OAuth mode should include aWWW-Authenticatechallenge withresource_metadata; reconnect the server through the client auth UI. - A
401in API-key mode means either the bearer is wrong/revoked or theX-Roe-Organization-Idheader is missing. Mint a fresh key — or fix the header — and retry.
Troubleshooting
| Symptom | Fix |
|---|---|
| Client shows no Roe tools after editing config | Restart the client. MCP config is loaded once at startup. |
401 with resource_metadata | Reconnect the Roe MCP server through the client’s OAuth UI. |
401 X-Roe-Organization-Id header required. | API-key mode only: add the X-Roe-Organization-Id header to your client config. Find the UUID under Settings → Organization in the matching Roe app. |
401 Unauthorized (other API-key body) | Verify the key in Roe settings; the key must not be revoked and must belong to the same backend as the org id. |
| Tool calls hit the wrong tenant | Use https://mcp.<tenant>.roe-ai.com/mcp for your single-tenant deployment, and make sure your API key and org id come from that same tenant. |
503 Service Unavailable with Retry-After | Upstream Roe is throttling or briefly unreachable. Back off and retry. |
| Want to inspect raw tool calls | Run the MCP Inspector: npx @modelcontextprotocol/inspector and point it at https://mcp.roe-ai.com/mcp. Use the inspector’s OAuth flow for normal deployments, or API-key headers for private API-key mode. |