LangChain MCP Tools
MCP Tools Usage From LangChain ReAct Agent / Example in TypeScript
What is LangChain MCP Tools?
LangChain MCP Tools is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp tools usage from langchain react agent / example in typescript
MCP Tools Usage From LangChain ReAct Agent / Example in TypeScript
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP Tools Usage From LangChain ReAct Agent / Example in Type
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx langchain-mcp-tools-ts-usageConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use LangChain MCP Tools
LangChain MCP Tools is a TypeScript example project that demonstrates how to use MCP server tools from within a LangChain ReAct agent. It uses the convertMcpToLangchainTools() utility to initialize multiple MCP servers in parallel and convert their exposed tools into LangChain StructuredTool objects that a ReAct agent can call. Developers building AI agents in TypeScript who want to combine LangChain's reasoning capabilities with the rich MCP tool ecosystem can use this as a working reference implementation.
Prerequisites
- Node.js 18 or higher and npm 8 or higher installed
- An OpenAI API key (the default LLM is gpt-4.5-mini) or another supported provider key
- Optionally uv or uvx for running Python-based MCP servers
- The MCP servers you want to integrate must be installed and accessible
- Basic familiarity with LangChain and the ReAct agent pattern
Clone the repository
Clone the langchain-mcp-tools-ts-usage repository to your local machine.
git clone https://github.com/hideya/langchain-mcp-tools-ts-usage.git
cd langchain-mcp-tools-ts-usageInstall dependencies
Install the npm packages required by the project including LangChain, the MCP tools adapter, and provider SDKs.
npm installCreate and configure the .env file
Copy the provided template and add your LLM provider API key. The default setup uses OpenAI, but Anthropic, Google GenAI, and xAI are also supported.
cp .env.template .env
# Then edit .env and set:
# OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxReview and customize the MCP server configuration
Edit the MCP server definitions in the configuration to point to the servers you want the ReAct agent to use. Each server entry specifies the command, args, and any required environment variables.
Run the example agent
Start the application. The ReAct agent will initialize the configured MCP servers, convert their tools, and begin accepting task requests.
npm startLangChain MCP Tools Examples
Client configuration
This project is itself an MCP client. The following shows how to configure it as an MCP server entry if you want to expose it through another client.
{
"mcpServers": {
"langchain-react-agent": {
"command": "node",
"args": ["/path/to/langchain-mcp-tools-ts-usage/dist/index.js"],
"env": {
"OPENAI_API_KEY": "sk-xxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}Prompts to try
Example tasks you can give to the LangChain ReAct agent once it is running with MCP tools connected.
- "Search the web for recent TypeScript MCP server releases and summarize the top results."
- "Read the file README.md from the filesystem MCP server and list its main sections."
- "Use the available tools to answer: what is the current Node.js LTS version?"
- "Combine results from multiple tools to compile a report on MCP adoption trends."Troubleshooting LangChain MCP Tools
ReAct agent fails with tool schema validation errors
The convertMcpToLangchainTools() utility applies provider-specific schema transformations. If you switch LLM providers, update the provider configuration in the source so the correct transformation is applied for that model's tool-calling format.
MCP server fails to initialize during startup
Check that the command and args for each MCP server in your configuration are correct and that the server binary or script is accessible. Run the server command manually in a terminal to see startup errors directly.
OPENAI_API_KEY not found or authentication rejected
Ensure the .env file exists in the project root and contains a valid OPENAI_API_KEY value. The dotenv package loads this file at startup; if you renamed it or placed it elsewhere, the key will not be found.
Frequently Asked Questions about LangChain MCP Tools
What is LangChain MCP Tools?
LangChain MCP Tools is a Model Context Protocol (MCP) server that mcp tools usage from langchain react agent / example in typescript It connects AI assistants to external tools and data sources through a standardized interface.
How do I install LangChain MCP Tools?
Follow the installation instructions on the LangChain MCP Tools GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with LangChain MCP Tools?
LangChain MCP Tools works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is LangChain MCP Tools free to use?
Yes, LangChain MCP Tools is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
LangChain MCP Tools Alternatives — Similar Coding Agents Servers
Looking for alternatives to LangChain MCP Tools? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up LangChain MCP Tools in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use LangChain MCP Tools?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.