langchain
Model Context Protocol tool support for LangChain
claude mcp add --transport stdio rectalogic-langchain-mcp uv run tests/demo.py Read and summarize the file ./LICENSE \ --env GROQ_API_KEY="Your Groq API key for demo execution (optional for local testing)"
How to use
This MCP server exposes LangChain-compatible tool calling through the Model Context Protocol. It uses a LangChain MCP Toolkit that integrates with an mcp.ClientSession. After initializing the toolkit, you can call toolkit.get_tools() to retrieve the list of LangChain tools (BaseTool instances) available for the current session. Use these tools to perform schema-aware, model-context-driven actions within your application. The included demo shows how to execute a LangChain-based workflow against a Groq-backed environment by running a Python script through uv, which demonstrates file-reading and summarization capabilities via MCP-tooling integration.
How to install
Prerequisites:
- Python 3.8+ installed on your system
- uv (the Python execution runner used in the example) installed and available in PATH
- Internet access to install Python packages
Installation steps:
-
Install the MCP package from PyPI (or install from source if you have a clone):
- pip install langchain-mcp
-
(Optional) If you want to run the included demo exactly as shown, ensure you have a Groq API key for testing. Set it in your environment:
- export GROQ_API_KEY=your_key_here
-
Run the demo using uv (as shown in the README example):
- uv run tests/demo.py "Read and summarize the file ./LICENSE"
-
If you’re developing locally, install dependencies and run the script directly with Python as an alternative:
- python -m pip install -r requirements.txt # if a requirements file is provided
- python tests/demo.py "Read and summarize the file ./LICENSE"
Additional notes
Notes and tips:
- The demo relies on GROQ for the data source. You can either provide a valid GROQ_API_KEY or adapt the demo to a different data source.
- The MCP setup shown uses the uv runner to execute a Python script that exercises the LangChain MCP toolkit; ensure your environment has access to the script path used in the command.
- If you encounter issues with tool discovery, verify that the LangChain MCP Toolkit is correctly installed and that the Python path includes the project modules.
- Environment variables used in the example are placeholder suggestions; replace or extend with variables relevant to your environment (e.g., API keys, endpoint URLs).
- This package is aligned with the LangChain MCP ecosystem; for newer adapters or official implementations, consider alternative packages such as langchain-mcp-adapters.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP