MCP Client Using LangChain / TypeScript
@hideya
About MCP Client Using LangChain / TypeScript
Simple CLI MCP Client Implementation Using LangChain ReAct Agent / TypeScript
Overview
What is MCP Client Using LangChain / TypeScript?
This is a simple Model Context Protocol (MCP) client that demonstrates the use of MCP server tools by a LangChain ReAct Agent. It runs on Node.js 16+ and is intended for developers integrating MCP tools into LangChain-based applications.
How to use MCP Client Using LangChain / TypeScript?
Install dependencies with npm install, set up API keys in a .env file, and configure the LLM and MCP servers in llm_mcp_config.json5. Run the app with npm start. Verbose mode is available via npm run start:v, and command-line options via npm run start:h. At the prompt, press Enter to use example queries that invoke MCP server tools.
Key features of MCP Client Using LangChain / TypeScript
- Uses LangChain ReAct Agent to invoke MCP server tools.
- Supports multiple MCP servers via parallel initialization.
- Converts MCP tools into LangChain-compatible
StructuredTool[]. - Supports LLMs from Anthropic, OpenAI, and Groq.
- Configuration uses JSON5 format with environment variable substitution.
- Built-in example queries for quick testing of tool invocations.
Use cases of MCP Client Using LangChain / TypeScript
- Integrating external MCP tools into LangChain agents for task automation.
- Rapidly prototyping and testing MCP server interactions from a CLI.
- Demonstrating parallel MCP server initialization and tool conversion.
- Comparing behavior across supported LLM providers (Anthropic, OpenAI, Groq).
FAQ from MCP Client Using LangChain / TypeScript
What makes this client different from Claude for Desktop?
The configuration format follows the same structure as Claude for Desktop, but uses the key mcp_servers (snake_case) instead of mcpServers, and it runs on LangChain’s ReAct Agent rather than proprietary AI.
Which LLMs are supported?
Anthropic, OpenAI, and Groq are currently supported via their respective API keys.
How do I set up MCP servers?
Configure them in llm_mcp_config.json5 using the same pattern as Claude for Desktop (with mcp_servers) and reference environment variables with ${...} notation.
Is there a Python version?
Yes, a Python version is available at the repository linked in the README.
What is the license?
MIT.
Basic information
More Agent Frameworks MCP clients
Open MCP Client
copilotkitMCP Agent Graph (MAG)
keta1930MCP Agent Graph (MAG) is an agent development framework for rapidly building agent systems. This project is based on graphs, nodes, and MCP to quickly construct complex Agent systems.
Unified MCP Client Library
pietrozullomcp-use is the easiest way to interact with mcp servers with custom agents
MCP Tool Langgraph Integration
paulrobelloMCP Tools Langraph Integration
Unified MCP Client Library
mcp-usemcp-use is the easiest way to interact with mcp servers with custom agents
Comments