langchain-mcp-adapters
LangChain MCP Adapters is a Python library that bridges Anthropic's Model Context Protocol (MCP) tools with LangChain and LangGraph, enabling AI agents to use MCP-compatible tools. It provides connection management for single or multiple MCP servers via stdio, HTTP, and streamable HTTP transports.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | langchain-ai/langchain-mcp-adapters |
| Owner | langchain-ai |
| Primary language | Python |
| License | MIT — OSI-approved |
| Stars | 3.6k |
| Forks | 454 |
| Open issues | 99 |
| Latest release | langchain-mcp-adapters==0.3.0 (2026-06-10) |
| Last updated | 2026-07-01 |
| Source | https://github.com/langchain-ai/langchain-mcp-adapters |
What langchain-mcp-adapters is
A lightweight adapter layer that wraps MCP ClientSession and tool discovery, converting MCP tools into LangChain ToolMessage-compatible objects. Supports multiple concurrent MCP server connections with configurable error handling, custom headers, and runtime tool loading for agentic workflows.
Get the langchain-mcp-adapters source
Clone the repository and explore it locally.
git clone https://github.com/langchain-ai/langchain-mcp-adapters.gitcd langchain-mcp-adapters# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- All tool loading and invocation is async; ensure your event loop and LangGraph context support async operations.
- MCP server lifecycle (startup, shutdown, reconnection) is not automatically managed; wrap MultiServerMCPClient initialization in context managers to prevent resource leaks.
- Tool error handling defaults to returning ToolMessage with status='error' rather than raising exceptions; set handle_tool_errors=False to restore legacy exception behavior if needed.
- Custom headers (Authorization, tracing) are passed per-transport; only sse and http transports support runtime headers, not stdio.
- Tool discovery is synchronous at load time; dynamic tool registration or tool removal during agent execution is not built-in.
When to avoid it — and what to weigh
- Complex Bidirectional Streaming Required — If your use case requires persistent, low-latency bidirectional communication beyond tool calls, MCP's request-response model may not fit.
- Non-Python Agent Ecosystems — This library is Python-only; if your primary framework is Node.js, Go, or Java, you need separate implementations or the JS/TS variant.
- Synchronous-Only Codebases — The library is async-first (async with, await patterns). Retrofitting into sync-only applications requires additional threading/event loop management.
- Offline or Air-Gapped Deployments — HTTP and streamable HTTP transports require network access; stdio is offline-capable but requires local process spawning.
License & commercial use
MIT License. Permits unrestricted commercial use, modification, and distribution with minimal restrictions (only requires license and copyright notice retention).
MIT is a permissive OSI-approved license that explicitly permits commercial use. No license-based restrictions on commercial deployment or integration. However, verify that MCP server implementations and LangChain/LangGraph dependencies also permit your commercial use case.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Moderate |
| DEV.co fit | Good |
| Assessment confidence | High |
Adapter itself does not implement authentication or encryption; relies on MCP server and transport (HTTP/TLS, stdio local process). Custom headers can pass API tokens and auth headers for HTTP transports. Stdio transport inherits process privilege and parent OS security model. Review MCP server source for injection vulnerabilities. No mention of input validation, rate limiting, or sandbox isolation in adapter.
Alternatives to consider
Direct MCP SDK (mcp library)
Lower-level MCP client without LangChain coupling. Use if building custom agent frameworks or avoiding LangChain/LangGraph dependency.
LangChain Tools + Custom Integration Layer
Manual adapter code to wrap tool servers. Provides full control and avoids MCP protocol lock-in, but requires more development and maintenance.
OpenAI Function Calling + Native OpenAI Tools
If tightly coupled to OpenAI models, native function calling may be simpler and avoid multi-framework coordination overhead.
Build on langchain-mcp-adapters with DEV.co software developers
Integrate LangChain MCP Adapters into your LangGraph agent stack. Start with the QuickStart guide or explore multi-server examples in the GitHub repository.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
langchain-mcp-adapters FAQ
Can I use this with non-OpenAI LLMs?
What happens if an MCP server crashes mid-execution?
Can I hot-reload or dynamically add MCP servers without restarting the agent?
Is there a type stub (.pyi) or formal API documentation?
Software developers & web developers for hire
Need help beyond evaluating langchain-mcp-adapters? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and mcp servers integrations — and maintain them long-term.
Build Agentic Workflows with MCP Tools
Integrate LangChain MCP Adapters into your LangGraph agent stack. Start with the QuickStart guide or explore multi-server examples in the GitHub repository.