# mcp-client-langchain-ts

A TypeScript equivalent of mcp-client-langchain-py: a simple command-line client, built on a LangChain ReAct agent, for testing and exploring Model Context Protocol servers, with automatic tool-schema adjustments for broader LLM compatibility.

mcp-client-langchain-ts is a text-based Node.js CLI for trying out MCP servers from the terminal, built on a LangChain ReAct agent and the @h1deya/langchain-mcp-tools package's convertMcpToLangchainTools function. Beyond basic tool discovery and calling, it automatically adjusts an MCP server's tool schemas for better compatibility with different LLMs, which the author notes can make some otherwise-failing MCP servers work correctly.

Configuration is a JSON5 file, llm_mcp_config.json5, listing MCP servers and the LLM provider to use - OpenAI, Anthropic, Google AI Studio, xAI, Cerebras or Groq - with API keys supplied through environment variables or a .env file; both local, package-run MCP servers and remote URL-based ones are supported. It installs globally through npm as the mcp-client-cli command and requires Node.js 18 or later.

Like its Python sibling, it currently targets MCP protocol version 2025-03-26 rather than the newer 2026-07-28 specification, and only text tool-call results are supported.

Website: https://github.com/hideya/mcp-client-langchain-ts
