Official Python SDK for building Model Context Protocol servers and clients that connect LLM applications to tools, data and prompts.
hideya/mcp-client-langchain-py
A text-based CLI client built with LangChain and Python for testing and exploring MCP servers from the command line.
- Stars
- 13
- Forks
- 4
- Open issues
- 0
- Last commit
- 2 months ago
What is it?
mcp-chat is a simple command-line client for Model Context Protocol (MCP) servers. It connects to local stdio servers or remote HTTP servers, loads their tools, and lets you chat with them through a LangChain ReAct agent backed by an LLM of your choice.
The tool is configured with a JSON5 file that follows the same structure as Claude for Desktop's MCP configuration, with environment variable substitution for API keys and tokens. It supports OpenAI, Anthropic, Google GenAI, xAI, Cerebras and Groq models, and can save logs from local stdio servers to a chosen directory.
Only MCP Tools are supported, and tool results are limited to text content. Resources, Prompts and Sampling are not implemented. The project is built on the langchain-mcp-tools package and targets MCP protocol version 2025-03-26.
Key features
- 01Connects to local stdio MCP servers and remote HTTP MCP servers.
- 02Chats with MCP tools through a LangChain ReAct agent using a configurable LLM.
- 03Uses JSON5 configuration compatible with Claude for Desktop's MCP format.
- 04Substitutes environment variables into config values for credentials.
- 05Supports OpenAI, Anthropic, Google GenAI, xAI, Cerebras and Groq models.
- 06Saves stdio server logs to a directory and offers a verbose mode.
Use cases
- Testing an MCP server's tools before wiring it into an application.
- Exploring what capabilities a new MCP server exposes.
- Prototyping integrations between an LLM and external tools.
Quick start
- 1
Install the mcp-chat tool with pip
pip install mcp-chat - 2
Create the configuration file llm_mcp_config.json5 with your LLM and MCP server settings
- 3
Set your LLM API keys in a .env file
- 4
Run the tool
mcp-chat
Things to know
- Only text results of tool calls are supported; images and other content types are filtered out.
- Only MCP Tools are supported; Resources, Prompts, and Sampling are not implemented.
- Does not support the MCP 2026-07-28 specification; it targets protocol version 2025-03-26.
- Requires an API key from at least one supported LLM provider.
Topics
FAQ
- What is mcp-client-langchain-py?
- A text-based CLI client built with LangChain and Python for testing and exploring MCP servers from the command line. mcp-chat is a simple command-line client for Model Context Protocol (MCP) servers. It connects to local stdio servers or remote HTTP servers, loads their tools, and lets you chat with them through a LangChain ReAct agent backed by an LLM of your choice.
- Is mcp-client-langchain-py free to use? What license does it have?
- mcp-client-langchain-py is open source under the MIT license. Check the license terms before using it in commercial products.
- Is mcp-client-langchain-py still maintained?
- Updated within 6 months. The last commit to mcp-client-langchain-py was on Aug 23, 2026.
- What can I use mcp-client-langchain-py for?
- Testing an MCP server's tools before wiring it into an application. Exploring what capabilities a new MCP server exposes. Prototyping integrations between an LLM and external tools.
- How do I install mcp-client-langchain-py?
- Install the mcp-chat tool with pip: pip install mcp-chat Create the configuration file llm_mcp_config.json5 with your LLM and MCP server settings Set your LLM API keys in a .env file Run the tool: mcp-chat
- Where can I get mcp-client-langchain-py?
- The source code and installation instructions are on GitHub: https://github.com/hideya/mcp-client-langchain-py
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An opinionated, batteries-included agent harness for Python that runs long multi-step tasks out of the box on LangGraph.
A lightweight Python library that gives one OpenAI-style API across many LLM providers, plus an Agents API with tools and MCP support.
The official TypeScript SDK for building Model Context Protocol servers and clients that give LLM applications standardized context.
A cross-platform desktop AI assistant that connects to major LLM providers and acts as an MCP client with a local knowledge base.
Java server and admin platform for Xiaozhi ESP32 voice devices, covering device monitoring, voice and persona management, and conversation logs.