MCP.so
登录

Langchain MCP Server

@rectalogic

基本信息

分类

AI 与智能体

许可证

MIT

传输方式

stdio

作者

rectalogic

关于 Langchain MCP Server

Model Context Protocol tool support for LangChain

Langchain MCP Server 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "langchain-mcp": {
      "command": "uv",
      "args": [
        "run",
        "tests/demo.py",
        "Read and summarize the file ./LICENSE"
      ]
    }
  }
}

Langchain MCP Server 工具

工具列表暂未提供

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

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

概览

What is langchain-mcp?

langchain-mcp provides Model Context Protocol (MCP) tool calling support within LangChain. It enables LangChain applications to use tools exposed by any MCP server by wrapping them as LangChain BaseTool instances. This is for developers building LangChain-based agents or chains that need to call external tools via the MCP standard.

How to use langchain-mcp?

Create a langchain_mcp.MCPToolkit by passing it an mcp.ClientSession, then call await toolkit.initialize() followed by toolkit.get_tools() to retrieve a list of LangChain BaseTools. The toolkit handles the MCP client‑server lifecycle and tool discovery.

Key features of langchain-mcp

  • Integrates MCP tool calling into LangChain workflows
  • Exposes an async MCPToolkit class for session management
  • Automatically converts MCP tools into BaseTool objects
  • Works with any MCP server that communicates over a ClientSession

Use cases of langchain-mcp

  • Adding filesystem, database, or API tools from MCP servers to a LangChain agent
  • Combining MCP tools with LangChain’s chat models and chains in a unified pipeline

常见问题

1

Is this the official LangChain MCP integration?

No. LangChain now has a more official implementation called `langchain-mcp-adapters`. This repository is a community alternative.

2

What does langchain-mcp require?

It requires Python and can be installed via PyPI as `langchain-mcp`. The demo also uses the `uv` tool for running.

3

How do I run the included demo?

Set the `GROQ_API_KEY` environment variable and execute `uv run tests/demo.py "Read and summarize the file ./LICENSE"` (or equivalent) against an MCP filesystem server.

评论

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