Skip to main content
Connect a managed deep agent to remote Model Context Protocol (MCP) servers to add their tools to the agent. Managed Deep Agents creates the MCP client and loads the tools. Most remote MCP servers require authentication. A connection supplies it, and declaring the connection as user-owned makes each caller authorize their own account.
Managed Deep Agents is in public beta and available on LangSmith Cloud in the US region only.
Declare MCP servers in a module directly under tools/:
For the full project layout, see Project structure. To implement application logic in the project instead, use an authored tool.

Add an MCP servers

Use an MCP server when tools already live on a remote MCP server and you want MDA to load them without importing them into the agent definition.
1

Declare the connector

Use connectors.mcp to declare one or more remote servers:Use defineMcp to declare one or more remote servers:
tools/mcp.ts
The module must export a named connector.Managed Deep Agents supports Streamable HTTP ("http") and legacy SSE ("sse") transports. Stdio MCP servers are not supported. Expose a stdio server over HTTP or implement its operation as an authored tool instead.For connection options, see Manage connections.
2

Select tools (Optional)

By default, Managed Deep Agents exposes every tool from each server. To expose only selected tools, set an allowlist inside that server’s configuration:
To expose every tool except selected tools, replace includeTools with excludeTools.You can use both options together. The denylist applies after the allowlist, and the same tool cannot appear in both lists.Selection uses raw MCP tool names before Managed Deep Agents prefixes them. Tool names are prefixed with the server name by default to avoid collisions. For example, the search_docs_by_lang_chain tool from the langchainDocs server is exposed as langchainDocs__search_docs_by_lang_chain.
3

Pass credentials (Optional)

If an MCP server requires credentials, declare a connection on the server config and create that connection in the workspace.
  • MCP OAuth: For servers that advertise OAuth and support automatic client registration, create with mda connections create <slug> (inferred from the MCP declaration) or mda connections create <slug> --mcp <url>. You do not supply a client ID or secret.
  • Opaque secret or general OAuth: For a static API key, or for a BYOT OAuth app you register yourself, create an opaque secret or general OAuth connection, then set the server’s connection option to connections.get(...).
For create modes, owners, and runtime authorization, see Manage connections.

Configure MCP servers

Each server supports the following core options: The MCP definition also accepts these options:

Deployment

mda dev and mda deploy discover connector modules under connectors/ and include them in the managed configuration. Connectors are not synced to Context Hub.

When to use MCP connectors

For more information, see Project structure.