https://github.com/rectalogic/langchain-mcp
Model Context Protocol tool support for LangChain
https://github.com/rectalogic/langchain-mcp
Last synced: 7 months ago
JSON representation
Model Context Protocol tool support for LangChain
- Host: GitHub
- URL: https://github.com/rectalogic/langchain-mcp
- Owner: rectalogic
- Created: 2024-11-26T15:05:28.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-11-27T21:44:03.000Z (7 months ago)
- Last Synced: 2024-11-27T22:28:56.526Z (7 months ago)
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mcp - Langchain - Support for LangChain. (Tools / Community)
- awesome-mcp-servers - rectalogic/langchain-mcp - Provides MCP tool calling support in LangChain, allowing for the integration of MCP tools into LangChain workflows. (Frameworks / 🛠️ <a name="other-tools-and-integrations"></a>Other Tools and Integrations)
- awesome-mcp-servers - rectalogic/langchain-mcp - Provides MCP tool calling support in LangChain, allowing for the integration of MCP tools into LangChain workflows. (Frameworks / 🛠️ <a name="other-tools-and-integrations"></a>Other Tools and Integrations)
- awesome-mcp - Langchain - Community - Support for LangChain (Go)
- awesome-mcp-devtools - langchain-mcp - Provides MCP tool calling support in LangChain (SDKs / Python)
- awesome-mcp-servers - @modelcontextprotocol/server-langchain - LangChainでのMCPツール呼び出しサポートを提供し、LangChainワークフローにMCPツールを統合できるようにします。 (フレームワーク / 🛠️ <a name="other-tools-and-integrations"></a>その他のツールと統合)
- awesome-mcp - rectalogic/langchain-mcp - 提供 LangChain 中 MCP 工具调用支持,允许将 MCP 工具集成到 LangChain 工作流中。 (框架)
- awesome-mcp - rectalogic/langchain-mcp - 提供 LangChain 中 MCP 工具调用支持,允许将 MCP 工具集成到 LangChain 工作流中。 (框架)
- awesome-mcp-servers - LangChain MCP Toolkit - Model Context Protocol tool support for LangChain (Table of Contents / Developer Tools)
- awesome-mcp-servers - LangChain MCP Toolkit - Model Context Protocol tool support for LangChain (Table of Contents / Developer Tools)
- awesome-mcp-devtools - langchain-mcp - Provides MCP tool calling support in LangChain (SDKs / Python)
README
# langchain-mcp
[Model Context Protocol](https://modelcontextprotocol.io) tool calling support in LangChain.
Create a `langchain_mcp.MCPToolkit` with an `mcp.ClientSession`,
then `await toolkit.initialize()` and `toolkit.get_tools()` to get the list of `langchain_core.tools.BaseTool`s.Example:
https://github.com/rectalogic/langchain-mcp/blob/8fa8445a24755bf91789f52718c32361ed916f46/tests/demo.py#L34-L43
## Demo
You can run the demo against [Groq](https://groq.com/) `llama-3.1-8b-instant`:
```sh-session
$ export GROQ_API_KEY=xxx
$ uv run tests/demo.py "Read and summarize the file ./LICENSE"
Secure MCP Filesystem Server running on stdio
Allowed directories: [ '/users/aw/projects/rectalogic/langchain-mcp' ]
The file ./LICENSE is a MIT License agreement. It states that the software is provided "as is" without warranty and that the authors and copyright holders are not liable for any claims, damages, or other liability arising from the software or its use.
```