DEV.co
MCP Servers · langchain-ai

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.

Source: GitHub — github.com/langchain-ai/langchain-mcp-adapters
3.6k
GitHub stars
454
Forks
Python
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorylangchain-ai/langchain-mcp-adapters
Ownerlangchain-ai
Primary languagePython
LicenseMIT — OSI-approved
Stars3.6k
Forks454
Open issues99
Latest releaselangchain-mcp-adapters==0.3.0 (2026-06-10)
Last updated2026-07-01
Sourcehttps://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.

Quickstart

Get the langchain-mcp-adapters source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/langchain-ai/langchain-mcp-adapters.gitcd langchain-mcp-adapters# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Multi-tool LangGraph Agents

Connect AI agents to multiple MCP servers (math, weather, database) and let LangGraph orchestrate tool selection and execution across them.

Standardized Tool Ecosystem Integration

Leverage existing MCP server implementations as drop-in tools for LangChain agents without custom adapter code.

Stateless Serverless Agentic Workflows

Use streamable HTTP transport for scalable, stateless agent deployments that connect to ephemeral or cloud-hosted MCP servers.

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.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

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.

Software development agency

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.co

Related 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?
Yes. The adapter is LLM-agnostic; examples show OpenAI but any LLM compatible with LangChain (Anthropic, Cohere, local models) will work with the same tools.
What happens if an MCP server crashes mid-execution?
Connection is lost and the tool invocation will raise an exception (transport/session failure). The adapter does not auto-reconnect; you must handle reconnection logic in your agent orchestration layer.
Can I hot-reload or dynamically add MCP servers without restarting the agent?
Not built-in. Tools are loaded at initialization via load_mcp_tools or MultiServerMCPClient.get_tools(). Reloading requires re-calling these methods and updating the agent's tool set, which depends on your agent architecture.
Is there a type stub (.pyi) or formal API documentation?
Not mentioned in README. Refer to source code in the repository or rely on IDE introspection and example patterns.

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.