langchain -adapters
LangChain π MCP
claude mcp add --transport stdio langchain-ai-langchain-mcp-adapters python -m langchain_mcp_adapters
How to use
LangChain MCP Adapters is a Python library that provides tooling to connect to MCP servers and load MCP-based tools as LangChain tools. It includes a client (MultiServerMCPClient) that can connect to one or more MCP servers and expose their tools to LangChain agents, enabling you to orchestrate tools from multiple MCP servers in a single agent workflow. The library also includes utilities to load tools from a connected MCP session and to create LangChain agents that can invoke those tools via the MCP protocol. Use cases include building agents that can perform tasks by composing measurement or computation tools exposed by MCP servers, such as math computations, data retrieval, or other domain-specific actions, all served through a consistent LangChain interface.
Typical workflow: start one or more MCP servers that expose tools, instantiate MultiServerMCPClient with the server configurations, obtain the loaded tools with get_tools(), and then create and run a LangChain agent (e.g., with create_agent) that can invoke those tools via natural language prompts.
How to install
Prerequisites:
- Python 3.8+ (or as specified by your environment)
- pip (or your preferred Python package manager)
Installation steps:
-
Create and activate a Python virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # Linux/macOS venv\Scripts\activate # Windows
-
Install the LangChain MCP Adapters package from PyPI:
pip install langchain-mcp-adapters
-
If you plan to run additional MCP-related examples, ensure you have any other required tooling installed (e.g., LangChain, LangGraph, OpenAI packages) as described in their respective docs.
-
Verify installation by importing in Python:
python -c "import langchain_mcp_adapters; print('langchain_mcp_adapters loaded')"
Additional notes
Notes and tips:
- This library focuses on acting as a client layer and adapter between MCP servers and LangChain/LangGraph tooling. It does not itself host an MCP server; you will need to run MCP servers separately and point the client at them.
- Supported transports in examples include stdio, HTTP, and streamable HTTP; the MultiServerMCPClient can configure servers with transport and connection details (e.g., command+args for local Python servers or URL for HTTP endpoints).
- When using multiple servers, you can load tools from each server and aggregate them into a single toolset for a LangChain agent.
- You can explicitly manage sessions for a given server using the provided session methods if you want to reuse connections across multiple tool invocations.
- If you encounter transport-related issues, verify network accessibility (URLs/ports) and ensure servers are running and reachable.
Related MCP Servers
evo-ai
Evo AI is an open-source platform for creating and managing AI agents, enabling integration with different AI models and services.
CoexistAI
CoexistAI is a modular, developer-friendly research assistant framework . It enables you to build, search, summarize, and automate research workflows using LLMs, web search, Reddit, YouTube, and mapping toolsβall with simple MCP tool calls or API calls or Python functions.
mcp-toolbox-sdk-python
Python SDK for interacting with the MCP Toolbox for Databases.
MCP-MultiServer-Interoperable-Agent2Agent-LangGraph-AI-System
This project demonstrates a decoupled real-time agent architecture that connects LangGraph agents to remote tools served by custom MCP (Modular Command Protocol) servers. The architecture enables a flexible and scalable multi-agent system where each tool can be hosted independently (via SSE or STDIO), offering modularity and cloud-deployable execut
ai-learning
AI Learning: A comprehensive repository for Artificial Intelligence and Machine Learning resources, primarily using Jupyter Notebooks and Python. Explore tutorials, projects, and guides covering foundational to advanced concepts in AI, ML, DL and Gen/Agentic Ai.
django-firebase
A production-ready Django app implementing Firebase Model Context Protocol (MCP) server with 14 Firebase tools for AI agents. Features standalone agent, HTTP/stdio transport, LangChain integration, and complete Firebase service coverage (Auth, Firestore, Storage).