Skip to main content
MCP support now ships inside LangChain in the langchain.mcp namespace, built on FastMCP. It replaces the standalone langchain-mcp-adapters package, whose MultiServerMCPClient is collapsed into a single MCPAdapter class. For the full feature documentation, see Model Context Protocol (MCP).
The langchain.mcp namespace requires langchain[mcp]>=1.4.0 and is in beta. Importing from it raises a LangChainBetaWarning. The API may change.

Install

Replace the standalone package with the mcp extra, which pulls in FastMCP:

Import paths

Client

MultiServerMCPClient took a server config dict and exposed several methods. MCPAdapter is an async context manager that infers the transport from its target and exposes list_tools(). Before:
After:
The config uses the standard MCPConfig shape (mcpServers), and the transport is inferred from each entry rather than named with a transport key. For a single server, pass its URL, script path, or in-process server directly. See Connections.

Client methods

Constructor arguments

Connection configuration

langchain-mcp-adapters used typed connection classes. MCPAdapter infers the transport, or you pass a fastmcp transport for full control.

Deprecated transports

The MCP specification deprecated the HTTP+SSE transport (protocol version 2024-11-05) in favor of Streamable HTTP. FastMCP still ships an SSETransport for back-compatibility, so an SSE server keeps working through MCPAdapter(Client(SSETransport(url))), but prefer migrating the server to Streamable HTTP. WebSocket has no FastMCP transport.

Elicitation

Elicitation moved from a callback registered on the client to a LangGraph interrupt, and it is now on by default. MCPAdapter arms every client it builds to advertise the capability and drives the interrupt loop; answer the server’s request when the run pauses, resuming with Command(resume={"responses": {key: answer}}). See Elicitation.

Sampling and roots

langchain.mcp answers elicitation requests through interrupts, but not sampling (a server asking the client to run an LLM completion) or roots (a server asking which local paths the client can reach). A tool call that returns either raises NotImplementedError. This follows the protocol. The modern MCP era is sessionless and has no live back-channel for a server to call into mid-request, so the pushed forms of sampling and roots exist only on the legacy handshake era. FastMCP 4 removed ctx.sample() and ctx.list_roots() from every era for that reason. If you need a server’s sampling or roots request answered through LangChain, open an issue.

Callbacks

The langchain-mcp-adapters Callbacks object is gone, but the underlying handlers are not: FastMCP takes them directly on its Client. Build a fastmcp.Client with the handler you need and pass it to MCPAdapter.
See Callback handlers in the FastMCP documentation.

Tool interceptors

The langchain-mcp-adapters interceptor types (tool_interceptors, ToolCallInterceptor, MCPToolCallRequest, MCPToolCallResult) are gone. Intercept tool calls agent-side with LangChain @wrap_tool_call middleware, which wraps every tool a create_agent runs, not only MCP tools. MCP provenance is available on the tool’s metadata under metadata["mcp"], so an interceptor can still branch on it:

Error handling

The handle_tool_errors flag is gone. Behavior is now fixed: an MCP tool that reports isError=True reaches the model as a ToolMessage with status="error" carrying the server’s message, while transport failures raise. See Tools.

Authentication

Auth moved onto the fastmcp.Client. Instead of auth and headers on the connection config, build a client with auth set to a bearer token, the literal "oauth", or any httpx.Auth, and pass that client to MCPAdapter. Per-server and per-user auth are both supported. See Authentication.

Tool results

Tool result handling is preserved and extended.

Prompts and resources

langchain.mcp focuses on tools and does not yet wrap MCP prompts or resources. These langchain-mcp-adapters helpers have no langchain.mcp equivalent today: We have not seen enough demand to prioritize a first-class wrapper yet. If you have a use case, open an issue — we would genuinely like to hear about it, and it helps us prioritize. In the meantime, you can read prompts and resources directly through the FastMCP client: client.get_prompt(...) and client.read_resource(...). See Reading resources and Getting prompts in the FastMCP documentation.

Deprecated in the MCP protocol

Some langchain-mcp-adapters features have no replacement because the MCP protocol itself deprecated or removed the mechanism they relied on, not because langchain.mcp chose to drop them. langchain.mcp targets the modern, sessionless protocol era through FastMCP 4.

See also