Quickstart
Create a config file
Create a
.mcp.json file at your project root. The format follows the Claude Desktop convention:.mcp.json
Auto-discovery
The CLI 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):| Priority | Location | Scope |
|---|---|---|
| 1 (lowest) | ~/.deepagents/.mcp.json | User-level — applies to all projects |
| 2 | <project>/.deepagents/.mcp.json | Project-level — .deepagents subdirectory |
| 3 (highest) | <project>/.mcp.json | Project-level — root (Claude Code compatible) |
.git folder, falling back to the current working directory.
When multiple config files exist, their mcpServers entries are merged. If the same server name appears in more than one file, the higher-precedence config wins.
Flags
| Flag | Behavior |
|---|---|
--mcp-config PATH | Add an explicit config as the highest-precedence source (merged on top of auto-discovered configs) |
--no-mcp | Disable MCP entirely — no servers are loaded |
--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, the Deep Agents CLI picks it up automatically — no extra setup needed.
Configuration format
Each key undermcpServers is a server name. The server’s fields determine how the CLI connects to it.
stdio servers (default)
stdio servers are spawned as child processes. The CLI communicates with them over stdin/stdout.mcp-config.json
The executable to run.
Arguments passed to the command.
Environment variables set for the subprocess. Use this to pass API keys and other credentials without exposing them in shell history.
SSE and HTTP servers
For remote MCP servers, settype to "sse" or "http" and provide a url:
mcp-config.json
Transport type:
"sse" for Server-Sent Events or "http" for streamable HTTP.The server endpoint URL.
HTTP headers sent with every request. Commonly used for authentication.
Server types summary
| Type | Required fields | Optional fields |
|---|---|---|
| stdio (default) | command | args, env |
| sse | type: "sse", url | headers |
| http | type: "http", url | headers |
The
type field can also be written as transport for compatibility with other MCP clients.Multiple servers
You can configure as many servers as you need. Tools from all servers are merged and available to the agent:mcp-config.json
Project-level trust
Project-level configs can contain stdio servers that execute local commands. To prevent untrusted repositories from running arbitrary code on CLI startup, the CLI enforces a default-deny policy for project-level stdio servers.How it works
- Interactive mode: The CLI prompts for approval before launching project stdio servers, showing the exact commands. Approval is persisted using a SHA-256 content fingerprint — if the config changes, you are prompted again.
- Non-interactive mode (
-n): Project stdio servers are silently skipped unless--trust-project-mcpis passed. - Remote servers (SSE/HTTP) from project configs are always allowed since they do not execute local code.
- User-level configs (
~/.deepagents/.mcp.json) are always trusted — the same trust model asconfig.tomlandhooks.json.
Flags
| Flag | Behavior |
|---|---|
--trust-project-mcp | Trust all project-level stdio servers without prompting (for CI and automation) |
Trust store
Trust decisions are stored in~/.deepagents/config.toml:
.mcp.json (which invalidates the fingerprint automatically).
Troubleshooting
Server fails to start (stdio)
Server fails to start (stdio)
Verify the command works outside the CLI:Common causes: the package isn’t installed,
npx isn’t on PATH, or required environment variables are missing.Connection refused (SSE/HTTP)
Connection refused (SSE/HTTP)
Check that the remote server is running and the URL is correct. If the server requires authentication, make sure
headers includes the correct credentials.Tools not appearing
Tools not appearing
The CLI prints the number of tools loaded at startup (e.g.,
✓ Loaded 3 MCP tools). If you see 0, the server started successfully but didn’t advertise any tools — check the server’s own logs or documentation.Further reading
- LangChain MCP guide — protocol details, building custom servers, and using
langchain-mcp-adaptersprogrammatically - MCP specification — the official protocol spec and server registry
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

