MCP.so
登录

MCP to LangChain/LangGraph Adapter

@SDCalvo

基本信息

分类

AI 与智能体

传输方式

stdio

作者

SDCalvo

关于 MCP to LangChain/LangGraph Adapter

Addapter that turns MCP server tools into langchain usable tools

MCP to LangChain/LangGraph Adapter 配置

暂无标准配置

该服务器的 README 中没有可解析的 MCP 配置块,请前往代码仓库查看安装说明。

代码仓库

MCP to LangChain/LangGraph Adapter 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is MCP to LangChain/LangGraph Adapter?

It bridges MCP (Multi‑modal Conversational Procedure) servers and LangChain/LangGraph frameworks, converting MCP tools into LangChain‑compatible tools for use in agents, chains, and graph‑based AI applications.

How to use MCP to LangChain/LangGraph Adapter?

Install the required Python packages (mcp, langchain, langchain‑openai, langgraph, python‑dotenv). Create an MCP server script (e.g., simple_server.py), then instantiate MCPAdapter with the script path. Call get_tools() to retrieve LangChain tools and integrate them into LangChain agents or LangGraph react agents.

Key features of MCP to LangChain/LangGraph Adapter

  • Connects to any MCP server via stdio transport.
  • Automatically discovers and converts MCP tools to LangChain BaseTool.
  • Supports both LangChain agents and LangGraph react agents.
  • Manages conversation history with LangGraph memory checkpoints.
  • Allows custom environment variables per server process.

Use cases of MCP to LangChain/LangGraph Adapter

  • Adding MCP‑exposed tools (e.g., math, weather) to an LLM agent.
  • Building conversational agents in LangGraph with persistent state.
  • Wrapping legacy or custom tools as MCP servers for LangChain pipelines.

常见问题

1

What are the required dependencies?

You need `mcp`, `langchain`, `langchain‑openai`, `langgraph`, and `python‑dotenv` installed via pip or pipenv.

2

How do I connect to an MCP server?

Provide the path to the MCP server script to `MCPAdapter`; the adapter launches and manages the server process automatically over stdio.

3

Do I need an API key?

The adapter itself requires no API key. To use OpenAI models in examples, set an `OPENAI_API_KEY` in a `.env` file or environment.

4

What transport does the adapter use?

The provided examples use stdio transport. Other transports are not documented in the README.

5

How can I debug connection issues?

Add logging to your MCP server script with `logging.basicConfig` to capture debug output to a file and stream.

评论

AI 与智能体 分类下的更多 MCP 服务器