Skip to main content
A coding agent does its best work with two things: accurate docs and a way to call the API. This page connects both. The docs MCP server lets the agent search and read every page here, and an API key in its environment lets the code it writes call Managed Agents with the TypeScript SDK or the REST API.

Before you begin

  • A coding agent: Claude Code, Codex, or Cursor.
  • An API key for the API half. Create one under API keys in the console. See API keys.
  • The TypeScript SDK if you want the agent to write TypeScript. See Install the SDK. Other languages call the REST API directly; see Python and other languages.

Connect the docs MCP server

The docs server is public, so it needs no key. Apart from sending feedback, it’s read-only. Its address is https://docs.labelbox.com/mcp.
Start a new session in your coding agent after changing its MCP configuration. The server offers three tools: The server covers the whole docs site, so tell your agent to stay within the /managed-agents pages. 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.

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. Handle the key safely:
  • 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, its transcript, and its outcome. 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 /managed-agents/errors and handle every retryable error with backoff.”

Keep the directions straight

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.

What can go wrong

Next steps

API conventions

Client setup, 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.