Skip to main content
Recursion offers two MCP servers for coding agents and other MCP clients:
  • The docs MCP server at https://docs.labelbox.com/mcp searches and reads every page here. It’s public and needs no key.
  • The Recursion MCP endpoint at https://api.recursion.labelbox.com/mcp finds and runs Managed Agents operations through four tools. It authenticates with an API key and acts as you.
The same API key also lets code the agent writes call the REST API.
You need a coding agent: Claude Code, Codex, or Cursor. The Recursion MCP endpoint and the REST API need an API key: create one under Settings › API keys in the console (see API keys). Scripts need curl and jq, or an HTTP client in your preferred language (see REST client setup).
This page connects a local coding agent to Recursion. To give an agent that runs inside Recursion access to another MCP server, configure that server on the agent instead. See MCP servers.

Connect the docs MCP server

The docs server at https://docs.labelbox.com/mcp is public, so it needs no key. Apart from sending feedback, it’s read-only.
Start a new session in your coding agent after changing its MCP configuration. The server covers the whole docs site, so tell your agent to stay within the /recursion pages.
The server offers three tools:Every page is also available as Markdown: append .md to its URL. For agents without MCP, the docs site root serves an index of every page at /llms.txt and the full text at /llms-full.txt.Every code sample on these pages is checked against the API contract whenever the docs change, so operation names, request fields, and paths match what the API accepts.

Connect the Recursion MCP endpoint

The authenticated endpoint is https://api.recursion.labelbox.com/mcp. Configure it as a Streamable HTTP MCP server that sends Authorization: Bearer <key>. Export the key as RECURSION_API_KEY in the shell that starts your client, and let the client read it from the environment, so the key never lands in a configuration file. Prefer an organization-scoped key; a tenant-scoped key must also send x-organization-id with the organization it should act in.
Add the server to .mcp.json in your project. Claude Code fills in ${RECURSION_API_KEY} from the environment:
It exposes exactly four tools. Start with search_docs, pass its slug to read_doc, then use the operation’s declared tool and input schema. Every operation runs with the connecting key’s tenant, organization, role, and permissions.
Path parameters in an operation’s input use camelCase, such as vaultId, while request bodies keep the operation’s snake_case fields. Follow the input schema read_doc returns.When an operation declares an ETag, its successful result includes responseHeaders.etag. If the mutation’s discovered input schema declares If-Match, copy the complete opaque value from the resource read into that argument. Refresh it after each successful write; do not construct it from the body’s revision.The endpoint rejects browser-origin requests and does not accept session cookies.
The operation tools run only operations whose request and response bodies are JSON. Other operations stay discoverable and their schemas stay readable, but MCP marks them documentation-only. Call these through the REST API instead:
  • Skill bundle uploads and skill version bundle downloads. A skill made of a single SKILL.md can be created through MCP; create a skill with scripts or other files through the REST API or the console.
  • The multipart uploadFile and the binary getFileContent. listFiles and getFile are callable through read_operation.
  • Agent memory settings, learned memories, and memory runs are available through the REST API. The generated SDK does not yet include them. Memory operations are excluded from MCP discovery and operation tools.

Give the agent API access

Export the key in the shell that starts your coding agent. The agent and the scripts it runs read it from the environment, and the key never appears in a prompt or a file.
Check the key works without printing it:
200 means the key works. 401 means it’s missing, expired, or revoked.
Never paste a key into a chat. Transcripts are stored and can be shared. If you’re an AI agent and RECURSION_API_KEY isn’t set, ask the person to export it and restart you. Don’t ask for the value.
  • Use a dedicated, short-lived key. A key acts as you, with your full role, so give each coding agent its own key with a 7- or 30-day expiry and revoke it when you’re done.
  • Prefer an organization-scoped key. It can reach only one organization and needs no extra header.
  • Keep keys out of code and version control. Read process.env.RECURSION_API_KEY or os.environ["RECURSION_API_KEY"]. Never write the key to a .env file that gets committed.
  • Don’t print it. Tell the agent never to echo, log, or include the key in output.

Run a first task

Paste this prompt into your coding agent. It reads the docs first, then writes and runs code.
When it finishes, open Sessions in the console to see the same session and its transcript. Good follow-ups to ask for:
  • “Add an Idempotency-Key so a retried start can’t create a second session.”
  • “Stream the session’s events instead of polling, and resume from the last event id if the connection drops.”
  • “Read /recursion/errors and handle every retryable error with backoff.”

What can go wrong

The most common problems:
  • The tools don’t appear. The client hasn’t reloaded its MCP configuration, or the address is wrong. For the Recursion MCP, RECURSION_API_KEY may not be set where the client started. Check both, then restart the client.
  • 401 unauthorized. The key isn’t exported in the shell that started the client or agent, or it expired or was revoked. Export a valid key, restart, and run the curl check above.
  • 400 invalid_request mentioning x-organization-id. The key has tenant scope. Add the header, or use an organization-scoped key.

Next steps

API conventions

Authentication, retries, paging, and errors in one place.

Quickstart

Run the same flow yourself, step by step.

API keys

Scopes, expiry, revocation, and safe storage.

MCP servers

Give a hosted agent tools from another MCP server.