
langchain mcp client
🦜🔗 LangChain Model Context Protocol (MCP) Client
Repository Info
About This Server
🦜🔗 LangChain Model Context Protocol (MCP) Client
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
🦜 🔗 LangChain MCP Client
This simple Model Context Protocol (MCP) client demonstrates the use of MCP server tools by LangChain ReAct Agent.
- 🌐 Seamlessly connect to any MCP servers.
- 🤖 Use any LangChain-compatible LLM for flexible model selection.
- 💬 Interact via CLI, enabling dynamic conversations.
Conversion to LangChain Tools
It leverages a utility function convert_mcp_to_langchain_tools(). This function handles parallel initialization of specified multiple MCP servers and converts their available tools into a list of LangChain-compatible tools (List[BaseTool]).
Installation
The python version should be 3.11 or higher.
pip install langchain_mcp_client
Configuration
Create a .env file containing all the necessary API_KEYS to access your LLM.
Configure the LLM, MCP servers, and prompt example in the llm_mcp_config.json5 file:
- LLM Configuration: Set up your LLM parameters.
- MCP Servers: Specify the MCP servers to connect to.
- Example Queries: Define example queries that invoke MCP server tools. Press Enter to use these example queries when prompted.
Usage
Below an example with a Jupyter MCP Server:
Check the llm_mcp_config.json5 configuration (commands depends if you are running on Linux or macOS/Windows).
# Start jupyterlab.
make jupyterlab
# Launch the CLI.
make cli
This is a prompt example.
create matplolib examples with many variants in jupyter

Credits
This initial code of this repo is taken from hideya/mcp-client-langchain-py (MIT License) and from langchain_mcp_tools (MIT License).
Quick Start
Clone the repository
git clone https://github.com/datalayer/langchain-mcp-clientInstall dependencies
cd langchain-mcp-client
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.