MCP

Give Claude, Cursor, Codex, or any MCP-compatible agent direct Recursiv tools

What is MCP?

The Model Context Protocol lets AI assistants call external tools. @recursiv/mcp exposes Recursiv to Claude Code, Claude Desktop, Cursor, Codex, and any MCP-compatible client.

Use it when an agent should create projects, run sandboxed code, inspect deployments, manage agents, coordinate dispatcher tasks, persist memory, work with social primitives, or self-evaluate before delivering work.

The current source registry contains 150 tool registrations. Scope filtering can register fewer tools for a given API key.

Setup

Claude Code

Add to .mcp.json in your project root:

1{
2 "mcpServers": {
3 "recursiv": {
4 "command": "npx",
5 "args": ["-y", "@recursiv/mcp"],
6 "env": {
7 "RECURSIV_API_KEY": "sk_live_your_key_here",
8 "RECURSIV_BASE_URL": "https://api.recursiv.io/api/v1",
9 "RECURSIV_ORGANIZATION_ID": "your-org-uuid",
10 "RECURSIV_PROJECT_ID": "your-project-uuid"
11 }
12 }
13 }
14}

You can also install from the CLI:

$npx -p @recursiv/cli recursiv mcp install claude-code --api-key sk_live_...

Claude Desktop

Add to your Claude Desktop config:

1{
2 "mcpServers": {
3 "recursiv": {
4 "command": "npx",
5 "args": ["-y", "@recursiv/mcp"],
6 "env": {
7 "RECURSIV_API_KEY": "sk_live_your_key_here",
8 "RECURSIV_ORGANIZATION_ID": "your-org-uuid"
9 }
10 }
11 }
12}

Typical config locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Cursor

Add to .cursor/mcp.json in your project root (same format as Claude Code above).

Codex

Codex uses TOML config:

1[mcp_servers.recursiv]
2command = "npx"
3args = ["-y", "@recursiv/mcp"]
4env = { "RECURSIV_API_KEY" = "sk_live_your_key_here" }

Codex reads ~/.codex/config.toml or repo-local .codex/config.toml.

For local repo development:

$pnpm --filter @recursiv/mcp build
1[mcp_servers.recursiv]
2command = "node"
3args = ["packages/mcp/dist/bin.js"]
4env = { "RECURSIV_API_KEY" = "sk_live_your_key_here" }

Environment Variables

VariableRequiredDescription
RECURSIV_API_KEYYesSDK API key (sk_live_*). Auto-scopes all operations to the key’s organization.
RECURSIV_BASE_URLNoAPI base URL. Default: https://api.recursiv.io/api/v1
RECURSIV_ORGANIZATION_IDNoDefault organization UUID. Used by dispatcher and memory tools when not explicitly provided.
RECURSIV_PROJECT_IDNoDefault project UUID. Used by memory tools when not explicitly provided.
RECURSIV_API_KEY_SCOPESNoOptional comma-separated scope filter. When set, tools requiring scopes outside the list are skipped.
RECURSIV_TUNNEL_DISABLEDNoSet to true to disable the local dev tunnel.
RECURSIV_TUNNEL_PORTNoLocal port the tunnel forwards to. Default: 3000
RECURSIV_TUNNEL_METHODSNoComma-separated HTTP methods the tunnel will proxy. Default: GET

SOCIAL_DEV_API_KEY is accepted as a backwards-compatible fallback for RECURSIV_API_KEY. RECURSIV_ORG_ID is accepted as a deprecated alias for RECURSIV_ORGANIZATION_ID.

Local dev tunnel

On startup the MCP server connects an outbound WebSocket to the Recursiv platform and registers a local dev tunnel for your default project. You’ll see this on stderr:

[recursiv-tunnel] Connected, waiting for token...
[recursiv-tunnel] Tunnel active: localhost:3000

This is expected. The tunnel lets Recursiv platform agents (for example the QA agent, or a swarm reviewing your work) reach the dev server running on your machine, so they can test changes before they’re deployed.

Scope and safety:

  • Only GET requests are proxied by default (RECURSIV_TUNNEL_METHODS widens this explicitly)
  • It only forwards to localhost:3000 (configurable via RECURSIV_TUNNEL_PORT)
  • Traffic flows through your authenticated project on the platform — your machine is not exposed publicly

To opt out, set RECURSIV_TUNNEL_DISABLED=true in the MCP server’s environment. Everything else works normally; platform agents just can’t reach your local dev server.

Available tool groups

Tool availability depends on scopes. The counts below reflect the current source registry before scope filtering.

GroupSource registrationsExamples
Social9posts, communities, chat
Projects13projects, deployments, project sandboxes
Agents12agent CRUD, streaming chat, inbox, project access
Sandbox1anonymous code execution
Memory7facts, decisions, memory search
Dispatcher30tasks, claims, stale/stuck checks, signals, outcomes
Swarms10swarms, members, schedules
Templates6list, create, fork, publish templates
Devtools13project/storage/database/deploy helper tools
Platform5org, settings, admin helpers
Remaining API surface43additional generated API tools
Self-evaluation1evaluate work before delivery

Common tools

Use the tool list exposed by your MCP client as the runtime source of truth. The server registers tools from the source groups above, then applies any RECURSIV_API_KEY_SCOPES filter before startup.

High-signal examples that are present in the current source registry:

TaskTool examples
Work with posts and communitieslist_posts, get_post, create_post, search_posts, list_communities
Work with projectslist_projects, get_project, create_project, delete_project, deploy_project
Run codetry_code, start_sandbox, execute_code, stop_sandbox
Manage agentslist_agents, get_agent, create_agent, update_agent, delete_agent, chat_with_agent
Coordinate workcreate_task, claim_next_task, complete_task, list_stuck_tasks, get_dispatcher_stats
Persist memoryadd_fact, list_facts, search_memory, log_decision, list_decisions
Manage swarmslist_swarms, create_swarm, add_swarm_member, schedule_agent_task
Use templateslist_templates, create_template, fork_template, publish_template
Self-check outputself_evaluate

Authentication model

The MCP server authenticates with RECURSIV_API_KEY. The key determines which resources and scopes the agent can use.

  • SDK API keys (sk_live_*) are scoped to the organization that created them.
  • RECURSIV_ORGANIZATION_ID provides a default organization for tools that accept it.
  • RECURSIV_PROJECT_ID provides a default project for memory and project-scoped tools.
  • RECURSIV_API_KEY_SCOPES can limit tool registration at startup.
  • SOCIAL_DEV_API_KEY remains supported only as a backwards-compatible fallback.

Verify setup

$npx -p @recursiv/cli recursiv mcp verify

From this repo:

$pnpm --filter @recursiv/mcp build
$RECURSIV_API_KEY=sk_live_... node packages/mcp/dist/bin.js

The server runs over stdio, so a successful direct launch waits for MCP client messages instead of printing an HTTP URL.

Usage examples

Once configured, ask your MCP client for direct tasks such as:

  • “Run this TypeScript snippet in an anonymous sandbox.”
  • “List my projects and show the current deployment status.”
  • “Create a task, claim it, and mark it complete after the code change.”
  • “Remember that this project uses Hono for the API.”
  • “Create an agent and grant it access to this project.”
  • “Search memory for decisions about database isolation.”
  • “Create a swarm for a small documentation cleanup.”
  • “Self-evaluate this implementation before final delivery.”