MCP client - LangChain - verified
How to add an MCP server to LangChain MCP adapters
Where to add MCP servers in LangChain MCP adapters: In code: MCPAdapter(target) from langchain.mcp, where target is a URL, script Path, MCPConfig dict ({"mcpServers": {...}}) or fastmcp.Client. Its docs list support for stdio, Streamable HTTP and SSE. It handles OAuth sign-in for remote servers.
LangChain MCP adapters homepage - LangChain / LangGraph in our tools directory - Compare all MCP clients
- Kind
- SDK or framework
- stdio
- Yes
- Streamable HTTP
- Yes
- SSE
- Yes
Add a server
- Where the config lives
- In code: MCPAdapter(target) from langchain.mcp, where target is a URL, script Path, MCPConfig dict ({"mcpServers": {...}}) or fastmcp.Client
The example from the LangChain MCP adapters docs, copied verbatim. Swap in your server's name, command or URL.
from langchain.mcp import MCPAdapter
config = {
"mcpServers": {
"math": {"command": "python", "args": ["/path/to/math_server.py"]},
"weather": {"url": "http://localhost:8000/mcp"},
}
}
async with MCPAdapter(config) as adapter:
tools = await adapter.list_tools()Source: docs.langchain.com/oss/python/migrate/langchain-mcp-adapters
Which server?
Pick a server from the verified directory of official MCP servers. Each one lists its transport, auth and the setup snippets its vendor publishes, so you can match it to what LangChain MCP adapters supports.
MCP support
What the LangChain MCP adapters docs say it supports. Not stated means the docs do not say either way.
| Feature | Value | Source |
|---|---|---|
| ToolsCalls the functions a server exposes. | Yes | docs.langchain.com/oss/python/langchain/mcp/tools |
| ResourcesReads data and files a server exposes as resources. | No | docs.langchain.com/oss/python/migrate/langchain-mcp-adapters |
| PromptsOffers a server's prompt templates to the user. | No | docs.langchain.com/oss/python/migrate/langchain-mcp-adapters |
| SamplingLets a server ask the client's model for a completion. | No | docs.langchain.com/oss/python/langchain/mcp/tools |
| RootsTells a server which directories it may work in. | No | docs.langchain.com/oss/python/langchain/mcp/tools |
| ElicitationLets a server ask the user for input mid-task. | Yes | docs.langchain.com/oss/python/langchain/mcp/tools |
| DiscoveryPicks up tools, prompts or resources a server adds or removes while connected. | Not stated | Docs do not say |
| InstructionsUses the instructions a server sends when it connects. | Not stated | Docs do not say |
| stdioStarts a local server as a subprocess. | Yes | docs.langchain.com/oss/python/langchain/mcp |
| Streamable HTTPConnects to a remote server over the current HTTP transport. | Yes | docs.langchain.com/oss/python/langchain/mcp |
| SSEConnects over the older HTTP+SSE transport. | Yes | docs.langchain.com/oss/python/migrate/langchain-mcp-adapters |
| OAuthSigns in to remote servers with OAuth. | Yes | docs.langchain.com/oss/python/langchain/mcp/auth |
Worth knowing
The standalone langchain-mcp-adapters package is replaced by the beta langchain.mcp namespace (langchain[mcp]>=1.4.0, built on FastMCP), which wraps tools only; prompts and resources must be read through the FastMCP client directly.
Other SDKs and frameworks
FAQ
Where is the LangChain MCP adapters MCP config?
In code: MCPAdapter(target) from langchain.mcp, where target is a URL, script Path, MCPConfig dict ({"mcpServers": {...}}) or fastmcp.Client. The example on this page is copied from https://docs.langchain.com/oss/python/migrate/langchain-mcp-adapters
Does LangChain MCP adapters support remote MCP servers over Streamable HTTP?
Yes, per https://docs.langchain.com/oss/python/langchain/mcp. Its docs list support for stdio, Streamable HTTP and SSE.
Does LangChain MCP adapters support OAuth for MCP servers?
Yes. It handles OAuth sign-in for remote servers. Source: https://docs.langchain.com/oss/python/langchain/mcp/auth
Which MCP features does LangChain MCP adapters support?
Its docs list Tools and Elicitation. They say Resources, Prompts, Sampling and Roots are not supported. They do not state Discovery and Instructions.
Sources
Last verified from the pages below.
- LangChain docs: Model Context Protocol (MCP) - docs.langchain.com
- LangChain docs: Migrate from langchain-mcp-adapters - docs.langchain.com
- LangChain docs: MCP Tools - docs.langchain.com
- LangChain docs: MCP Authentication - docs.langchain.com
Newsletter
New MCP servers, the week they ship
One email per week. New official MCP servers, the coding tools that support them and how developers wire them up.