LangChain tool adapter for Anthropic's Model Context Protocol (MCP)
Top 19.5% on sourcepulse
This library provides adapters to integrate Model Context Protocol (MCP) tools with LangChain and LangGraph, enabling seamless use of external services within agentic workflows. It targets developers building complex, multi-tool AI agents who need to leverage existing MCP-compatible services or create new ones. The primary benefit is simplifying the connection and management of diverse tools for LangChain agents.
How It Works
The library acts as a bridge, converting MCP tools into LangChain-compatible Tool
objects. It offers a client implementation that can connect to multiple MCP servers via different transport protocols (stdio, SSE). This allows agents to discover and utilize tools exposed by these servers, facilitating dynamic tool loading and management within LangChain's agentic framework.
Quick Start & Requirements
pip install langchain-mcp-adapters
math_server.py
and weather_server.py
).Highlighted Details
create_react_agent
.stdio
and sse
transport protocols.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The README requires users to manually update file paths for local server execution. The library's own licensing is not specified, which could impact commercial adoption.
2 weeks ago
1 day