SkillAgentSearch skills...

langchain-mcp-client

πŸ¦œπŸ”— LangChain Model Context Protocol (MCP) Client

Install / Use

claude mcp add datalayer -- npx -y github:datalayer/langchain-mcp-client

If the server publishes to npm under a different name, use that package instead β€” check the repo README.

About this skill
πŸ”Œ

MCP Server

Model Context Protocol server

Quality Score

63/100

Supported Platforms

Claude Code
Claude Desktop

Tags

<!-- ~ Copyright (c) 2023-2024 Datalayer, Inc. ~ ~ BSD 3-Clause License -->

Datalayer

Become a Sponsor

🦜 πŸ”— LangChain MCP Client

Github Actions Status PyPI - Version

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:

  1. LLM Configuration: Set up your LLM parameters.
  2. MCP Servers: Specify the MCP servers to connect to.
  3. 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).

Related Skills

View on GitHub
GitHub Stars10
CategoryDevelopment
Updated1y ago
Forks3

Languages

Jupyter Notebook

Security Score

68/100

Audited on May 20, 2025

2 medium1 low1 info