langchain-mcp-adapters
Make Anthropic Model Context Protocol (MCP) tools compatible with LangChain and LangGraph agents.
What it is and what it does
This library bridges Anthropic's Model Context Protocol (MCP) and LangChain by wrapping MCP tools so they work with LangChain agents and LangGraph workflows. It provides two main entry points: a tool loader that converts a single MCP session's tools into LangChain-compatible objects, and a multi-server client that manages connections to multiple MCP servers and aggregates their tools. The library handles both stdio and HTTP transports, supports custom headers for authentication, and distinguishes between tool execution errors (which it returns as error messages to the agent) and protocol failures.
Typical usage involves creating an MCP server with decorated functions, then on the client side instantiating either a direct session or a MultiServerMCPClient, loading tools from it, and passing those tools to a LangChain agent or LangGraph workflow. The library is actively maintained and requires Python 3.10 or later, with dependencies on langchain-core, mcp, and typing-extensions.
Use it for:
- Build LangGraph agents that call external MCP-based tools (e.g., math operations, weather lookups) as part of agentic workflows
- Aggregate tools from multiple MCP servers and expose them to a single LangChain agent without managing individual connections
- Add authentication headers to MCP server connections for secure tool access in production environments
- Convert existing MCP tool definitions into LangChain tool objects for use with OpenAI or other LLM-based agents
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts Anthropic Model Context Protocol (MCP) tools into LangChain-compatible tools for use with LangGraph agents, and provides a client to connect to multiple MCP servers and load their tools.
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a clear integration problem between two widely-used frameworks. Use it if you have MCP tools and want to use them in LangChain or LangGraph agents.
Install
langchain-mcp-adapters on PyPI
pip
pip install langchain-mcp-adaptersuv
uv add langchain-mcp-adapterspoetry
poetry add langchain-mcp-adaptersInstalling langchain-mcp-adapters
Before you install
Low install friction with a pure Python wheel. Active maintenance: released 8 days ago with 3628 repository stars and ongoing commits. Requires Python 3.10 or later.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for commercial and proprietary projects.
Quickstart
pip install langchain-mcp-adapters
from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client
from langchain_mcp_adapters.tools import load_mcp_tools
server_params = StdioServerParameters(command="python", args=["/path/to/server.py"])
async with stdio_client(server_params) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await load_mcp_tools(session)
Requires Python 3.10 or later; MCP server must be running or accessible at the specified path/URL.
Verify before relying
- Whether the library handles all MCP transport types (stdio, http, streamable-http, sse) equally well or if some have known limitations
- Performance characteristics when connecting to many MCP servers simultaneously
- Compatibility guarantees with specific versions of langchain-core and mcp
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — langchain-core, mcp, typing-extensions |
| Maintenance | actively maintained — 8 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 7,996,429/month — #1,673 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langchain_mcp_adapters-0.3.2-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
mcpadaptAdapts MCP (Model Context Protocol) servers…
permissive · top 15,000 on PyPI
mcp-usemcp-use provides a Python framework to connect…
permissive · top 15,000 on PyPI
langchain-protocolProvides Python type definitions (TypedDict,…
permissive · top 1,000 on PyPI
composio-langchainBridges Composio's 1000+ app integrations into…
permissive · top 15,000 on PyPI
nvidia-nat-mcpIntegrates MCP (Model Context Protocol) servers…
permissive · top 15,000 on PyPI
langchain-cliCommand-line interface for building, testing,…
permissive · top 15,000 on PyPI
mcp-typesProvides the wire types and protocol message…
permissive · top 5,000 on PyPI
fastmcpFastMCP is a Python framework for building…
permissive · top 1,000 on PyPI