LangChain · 2026-09-03 · major
LangChain 1.4.0 — a built-in MCP adapter for agent tools
LangChain 1.4.0 adds a langchain.mcp namespace with an MCPAdapter class. It finds the tools a Model Context Protocol server offers and turns them into LangChain tools for create_agent. The namespace is built on FastMCP and ships in beta.
LangChain agents can reach Model Context Protocol servers through a first-party adapter.
Quick facts
| Version | 1.4.0 |
|---|---|
| Released | 3 September 2026 |
| What's new | langchain.mcp namespace with MCPAdapter (beta) |
| Built on | FastMCP |
| License | MIT |
| Language | Python |
| GitHub stars | 145,711 |
What is it?
The new langchain.mcp namespace is the headline of LangChain 1.4.0. Its MCPAdapter class connects an agent to a Model Context Protocol server and returns that server's tools as ordinary LangChain tools, ready to pass to create_agent. The namespace ships in beta, so the documented API may still change.
How does it work?
MCPAdapter is built on FastMCP and takes care of protocol negotiation, the connection and authentication. Point it at an HTTP URL, a file path, a transport object or an in-process FastMCP instance and it works out the right connection type. An async context manager opens the session, await adapter.list_tools() returns the discovered tools, and the manager closes the connection on exit.
Why does it matter?
Connecting an MCP server to a Python agent now takes a few lines of first-party code instead of custom glue. A team that already runs MCP servers for its internal APIs can hand the same servers to a LangChain agent and let the adapter discover what they expose.
Who is it for?
Python developers building agents
Frequently asked questions
- Is the langchain.mcp namespace stable enough to depend on?
- The langchain.mcp namespace ships in beta with LangChain 1.4.0. The documentation says the API may change, and importing the namespace prints a warning once per process. Teams that need a frozen interface should pin the LangChain version and re-test the adapter whenever they upgrade.
- What else changed in LangChain 1.4.0?
- LangChain 1.4.0 lists five changes since 1.3.18. Besides the MCP namespace there are runnable langchain.mcp documentation examples, a performance change that omits middleware trace inputs for Anthropic and LangChain, a fix that includes the model destination in agent tool routing, and a bump of the vcrpy test dependency to 8.2.0 or higher.
- Which kinds of MCP servers can MCPAdapter reach?
- MCPAdapter accepts an HTTP URL, a file path, a transport object or an in-process FastMCP instance, and infers the right connection method from whichever it is given. That covers remote MCP servers reached over HTTP as well as local servers a developer runs next to the agent.
- Is LangChain open source?
- LangChain is MIT-licensed and developed in the open at github.com/langchain-ai/langchain, where the project has 145,711 stars. Version 1.4.0 was published as a GitHub release on 3 September 2026, and the MCP integration is documented on the official LangChain docs site.
Try it
pip install -U langchain==1.4.0