Managed Deep Agents is in private preview, available on LangSmith Cloud in the US region only. Join the waitlist to request access.
Prerequisites
- Managed Deep Agents private preview access.
- An MCP server URL, plus any static headers or OAuth credentials the server requires.
- For CLI workflows,
deepagents-cli>=0.2.2. Confirm the installed version withdeepagents --version. An olderdeepagentson yourPATHcan shadow the current release. See the CLI reference for installation. - For SDK or API workflows, a LangSmith API key for a workspace with private preview access.
Quickstart
From a project directory created bydeepagents init, connect a static-header tool and deploy:
deepagents mcp-servers connect <id|name|url> after the register step (step 1) and before listing tools (step 2). The following sections cover each step in detail.
Use the CLI for most setups. Use the SDKs for Python or TypeScript automation, or use the REST API when you need direct control over request payloads.
Connect tools with the CLI
In the CLI,add registers a server and connect completes OAuth for a registered server. For all MCP server commands and flags, see the CLI reference.
Add a static-header MCP server
Register a server:--header for multiple headers:
tools.json snippet. To skip that step, pass --no-tools.
Add an OAuth MCP server
Register and connect an OAuth MCP server:- Registers the MCP server for per-user OAuth.
- Prints and opens a verification URL.
- Waits while you approve access in the browser.
- Confirms the connection once approval completes.
--scope to request OAuth scopes:
--timeout 0 to start the OAuth flow without polling:
deepagents mcp-servers connect <id|name|url> later to complete or reuse the connection.
List available tools
List the tools exposed by a registered MCP server:tools.json snippet. Copy the entries you want and reference them. Re-run it to refresh entries when a server’s tools change. If no tools are listed, confirm the server URL is reachable and, for OAuth servers, that you completed connect.
Connect tools with the SDK or API
Set request defaults
For SDK usage, install and configure the Managed Deep Agents SDKs. For direct REST calls, set the base URL and API key:X-Api-Key header:
401 and 403), see the API reference.
Register a static-header MCP server
UsePOST /v1/deepagents/mcp-servers:
- Python SDK
- TypeScript SDK
- cURL
Register an OAuth MCP server
OAuth registration and connection is the SDK/API equivalent ofdeepagents mcp-servers add --auth-type oauth --connect. Register the server, register an OAuth provider for it, then start an authorization session for the current user.
- Python SDK
- TypeScript SDK
- cURL
strategy="CREATE" when you want the equivalent of forcing a new OAuth session. Use strategy="REUSE" to reuse an existing valid token when possible. If the start-auth-session response includes a verification_url, open it and poll the auth session until the status is COMPLETED.
List a server’s tools
List the tools exposed by a registered MCP server before you reference them in an agent:- Python SDK
- TypeScript SDK
- cURL
oauth_provider_id returned by the OAuth provider registration:
- Python SDK
- TypeScript SDK
- cURL
force_refresh=True in Python, forceRefresh: true in TypeScript, or force_refresh=true in REST to bypass the cached tool definitions and fetch from the MCP server again. After you choose tool names from the response, reference them.
Reference tools
A tool entry requiresname, a tool exposed by a registered MCP server, and mcp_server_url, which points at that server. The mcp_server_name and display_name fields are optional.
tools.json file in your project root. deepagents init scaffolds it with an empty tools array. With the SDKs or API, send the same object as the tools field of an agent create or update request:
- Python SDK
- TypeScript SDK
- cURL
interrupt_config to require human approval before a tool runs. Key each entry by "{mcp_server_url}::{tool_name}" and set it to true. You can also include the server name in the key: "{mcp_server_url}::{mcp_server_name}::{tool_name}". When an agent calls a tool marked for approval, the run pauses with an interrupt that an operator resolves with the resolve-interrupt route.
To deploy an agent with no MCP tools, leave tools.json empty or omit the tools field.
Validate tools at deploy time
At deploy time, Managed Deep Agents validates the referenced MCP server URLs:- If a server URL is not registered, register it first. CLI:
deepagents mcp-servers add. SDK:client.mcp_servers.create(...)in Python orclient.mcpServers.create(...)in TypeScript. API:POST /v1/deepagents/mcp-servers. - If an OAuth server is registered but the caller cannot invoke it, complete OAuth first. CLI:
deepagents mcp-servers connect <id|name|url>. SDK:client.auth_sessions.create(...)in Python orclient.authSessions.create(...)in TypeScript. API: run the OAuth auth-session flow.
Manage server credentials
Static headers are stored with the MCP server record and are redacted whenever you inspect it.| Task | CLI | Python SDK | TypeScript SDK | API |
|---|---|---|---|---|
| List servers | deepagents mcp-servers list | client.mcp_servers.list() | client.mcpServers.list() | GET /v1/deepagents/mcp-servers |
| Inspect a server (headers redacted) | deepagents mcp-servers get <server> | client.mcp_servers.get(mcp_server_id) | client.mcpServers.get(mcpServerId) | GET /v1/deepagents/mcp-servers/{mcp_server_id} |
| Change headers | deepagents mcp-servers update <server> | client.mcp_servers.update(mcp_server_id, headers=[...]) | client.mcpServers.update(mcpServerId, { headers: [...] }) | PATCH /v1/deepagents/mcp-servers/{mcp_server_id} |
| Remove a server and its stored headers | deepagents mcp-servers delete <server> | client.mcp_servers.delete(mcp_server_id) | client.mcpServers.delete(mcpServerId) | DELETE /v1/deepagents/mcp-servers/{mcp_server_id} |
Next steps
After you connect tools, deploy the agent with atools.json file that references the registered MCP server URLs.
Connect these docs to Claude, VSCode, and more via MCP for real-time answers.

