Skip to main content
MCP (Model Context Protocol) lets you extend Deep Agents Code with tools from external servers—file systems, APIs, databases, and more—without modifying the agent itself. Deep Agents Code connects to MCP servers at startup, discovers their tools, and makes them available to the agent alongside the built-in tools. Add MCP servers by adding a .mcp.json config file to your project for project-level scope, or at user-level to apply to all projects. Paste this prompt into your coding agent to connect the servers, or follow the steps below for Deep Agents Code specifically. For other editors, see Use docs programmatically.

Connect LangChain docs MCP servers

Quickstart

This quickstart adds the LangChain MCP servers to every Deep Agents Code session on your machine. We recommend adding docs-langchain for conceptual guides and how-tos, and reference-langchain for API reference.

Create the config file

If it is not already present, create the .mcp.json file at the user level to make the server available to every project on the machine, or at the project level.
Servers in this file (~/.deepagents/.mcp.json) are available in every project on this machine.
See Discovery locations for full precedence rules.

Add the MCP servers

~/.deepagents/.mcp.json
To add more servers, add more entries to mcpServers. See Configuration format for OAuth, stdio, SSE, and HTTP server fields, environment variables, and headers.

Launch Deep Agents Code

On startup, Deep Agents Code auto-discovers the config, connects to each server, discovers its tools, and prints a confirmation:
Run /mcp in an interactive session to see per-server status, transport, and the loaded tool list. The agent can now use those tools for the duration of the session—stdio servers are kept alive between tool calls.

Auto-discovery

Deep Agents Code automatically searches for .mcp.json files in standard locations. No flags are needed—just place a config file and it gets picked up.

Discovery locations

Configs are checked in this order (lowest to highest precedence): The project root is the nearest parent directory containing a .git folder, falling back to the current working directory. When multiple config files exist, their mcpServers entries are merged by server name. Differently named servers are preserved. If the same server name appears in more than one file, the higher-precedence definition replaces the entire earlier server object; nested fields are not deep-merged. This lets a project-level config override a user-level entry (for example, pinning a different version of the same server) without disturbing your other projects.

Flags

--mcp-config and --no-mcp are mutually exclusive.

Claude Code compatibility

If you already have a .mcp.json at your project root for Claude Code, Deep Agents Code picks it up automatically—no extra setup needed.

Configuration format

Each key under mcpServers is a server name. The server’s fields determine how Deep Agents Code connects to it.

stdio servers (default)

stdio servers are spawned as child processes. Deep Agents Code communicates with them over stdin/stdout.
mcp-config.json