MCP in OutcomeDev: How Tooling Actually Works in This Project
OutcomeDev stores MCP servers as connectors and injects them into agent sandboxes.
MCP (Model Context Protocol) sounds abstract until you see it wired into a real workflow.
From first principles, MCP exists to solve an (n \times m) integration problem: many agents need to talk to many tools. Without a standard protocol, every tool and every agent becomes a bespoke integration.
OutcomeDev implements MCP as a first-class “connector” system, then passes those connectors into the agent execution environment so the agent can use real tools safely and repeatably.
The User-Facing Flow (What You Click)
OutcomeDev exposes MCP servers through the UI as “connectors.”
- You manage them in the connector dialog (presets like Context7, Figma, Linear, Supabase). See
components/connectors/manage-connectors.tsx:75. - There’s also a dedicated MCP user guide in
content/docs/mcp-servers.md:1.
The big idea is simple: connect the tools you need for the task, then ask the agent to use them.
The Backend Flow (What We Actually Do in Code)
When you create or continue a task, the API routes load your connected MCP servers, decrypt their secrets, and pass them into the agent runner.
1) Fetch connected MCP servers for the current user
In app/api/tasks/route.ts:531, the task creation handler queries the database for connectors with status = 'connected', decrypts env vars, and stores the connector IDs on the task.
You can see the list being passed into agent execution here:
executeAgentInSandbox(..., mcpServers, ...)inapp/api/tasks/route.ts:585
The “continue task” route repeats the same pattern so resumed work has the same tool access:
app/api/tasks/[taskId]/continue/route.ts(same connector query/decrypt/pass-through).
2) Execute the selected agent in a sandbox, with MCP servers attached
OutcomeDev runs agents inside a Vercel Sandbox and routes execution based on agent type:
executeAgentInSandboxinlib/sandbox/agents/index.ts:18
Notice how every agent runner receives mcpServers as an input. Whether the agent uses them depends on the underlying CLI/tooling integration.
3) Claude agent: wire MCP servers into Claude Code CLI
For the Claude agent, OutcomeDev installs Claude Code (@anthropic-ai/claude-code) into the sandbox and then programmatically adds MCP servers via the Claude CLI:
installClaudeCLIinlib/sandbox/agents/claude.ts:63- MCP server injection happens through
claude mcp add ...inlib/sandbox/agents/claude.ts:96
That’s the key implementation detail: OutcomeDev isn’t inventing a custom tool system for Claude. It’s using the official Claude Code CLI MCP support and feeding it the connectors you configured.
What This Design Buys You (Why It’s Built This Way)
This approach is deliberate and “first principles” friendly:
Standardization
Connectors represent MCP servers in a consistent schema. The UI doesn’t need to care whether a tool is “Linear” or “your custom SSE endpoint” — it’s just a connector with a transport and credentials.
Safety boundaries
The agent runs in an isolated sandbox environment. Secrets are stored encrypted, decrypted only when needed for execution, and redacted in logs where possible.
Reproducibility
A task records which MCP servers were connected via mcpServerIds (see app/api/tasks/route.ts:556). That makes it easier to understand “what tools were available” when the agent did work.
How to Prompt MCP Use Reliably
The biggest failure mode with tools is ambiguity. The fix is to name the tool and specify the outcome.
Examples:
- “Use Context7 to research Next.js (link the doc). Then implement the change.”
- “Use Linear MCP to pull the ticket details, then fix the bug and run tests.”
- “Use Browserbase to reproduce the UI issue, then patch it.”
OutcomeDev also documents this exact style in content/docs/mcp-servers.md:40.
Sources in This Repo
- MCP user guide:
content/docs/mcp-servers.md - Connector presets:
components/connectors/manage-connectors.tsx:75 - MCP fetching + injection into tasks:
app/api/tasks/route.ts:531 - Agent routing with
mcpServers:lib/sandbox/agents/index.ts:18 - Claude Code MCP wiring:
lib/sandbox/agents/claude.ts:96