Simple CLI MCP Client Using LangChain / Python
@hideya
About Simple CLI MCP Client Using LangChain / Python
Simple CLI MCP Client Implementation Using LangChain ReAct Agent / Python
Overview
What is Simple CLI MCP Client Using LangChain / Python?
A command‑line application that demonstrates how to use Model Context Protocol (MCP) server tools via the LangChain ReAct Agent. It runs on Python 3.11+ and is aimed at developers integrating MCP with LangChain.
How to use Simple CLI MCP Client Using LangChain / Python?
Install dependencies with make install, copy .env.template to .env and populate API keys for Anthropic, OpenAI, and/or Groq. Configure LLM and MCP servers in llm_mcp_config.json5 (JSON5 format with environment variable substitution). Run with make start; press Enter at the prompt to use built‑in example queries that invoke MCP tools.
Key features of Simple CLI MCP Client Using LangChain / Python
- Converts MCP tools into LangChain‑compatible
BaseToolobjects viaconvert_mcp_to_langchain_tools() - Supports parallel initialization of multiple MCP servers
- Works with LLMs from Anthropic, OpenAI, and Groq
- Config file uses JSON5 (comments, trailing commas) and
${...}env variable substitution - Includes configurable example queries for quick testing
Use cases of Simple CLI MCP Client Using LangChain / Python
- Prototype a LangChain ReAct agent that calls MCP‑exposed tools
- Test MCP server integration without a full IDE or desktop app
- Compare tool‑calling behavior across different LLM providers
- Automate CLI workflows that chain multiple MCP tool invocations
FAQ from Simple CLI MCP Client Using LangChain / Python
What is the Model Context Protocol (MCP)?
MCP is an open protocol that standardises how applications provide context and tools to LLMs. This client connects to MCP servers and exposes their tools to a LangChain agent.
Which LLM providers are supported?
Anthropic, OpenAI, and Groq are currently supported. You must provide the corresponding API keys in .env.
How does the config file differ from Claude for Desktop’s?
The configuration follows the same structure as Claude for Desktop’s mcpServers, but the key name is changed to mcp_servers (snake_case) to match JSON conventions.
How do I set up API keys?
Copy .env.template to .env, then fill in the keys. The .gitignore already excludes .env to prevent accidental commits. Use ${KEY_NAME} in the JSON5 config to reference environment variables.
Is there a TypeScript version?
Yes, a TypeScript version of this MCP client is available here.
What is the license?
The project is released under the MIT License.
Basic information
More Agent Frameworks MCP clients
Tester Client for Model Context Protocol (MCP)
apifyModel Context Protocol (MCP) Client for Apify's Actors
Where On-Device and Cloud LLMs Meet
hazyresearchBig & Small LLMs working together
Ollama MCP (Model Context Protocol)
mihirrdMCP client for local ollama models
DISCLAIMER
mario-andreschakMCP-Hub and -Inspector, Multi-Model Workflow and Chat Interface
mcp-cli
wong2A CLI inspector for the Model Context Protocol
Comments