LangChain MCP Tools
MCP to LangChain Tools Conversion Utility / 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 to langchain tools conversion utility / typescript
MCP to LangChain Tools Conversion Utility / TypeScript
This server falls under the APIs and Developer Tools categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP to LangChain Tools Conversion Utility / TypeScript
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx langchain-mcp-tools-tsConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use LangChain MCP Tools
langchain-mcp-tools-ts (published as @h1deya/langchain-mcp-tools) is a TypeScript utility library that converts MCP server tools into LangChain-compatible tool objects, enabling LangChain agents to call any MCP server's capabilities as native tools. It handles parallel initialization of multiple MCP servers, performs provider-specific schema transformations to prevent compatibility issues with OpenAI, Google Gemini, Anthropic, and xAI, and exposes a simple cleanup lifecycle for resource management. Developers building LangChain agents who want to leverage the growing ecosystem of MCP servers can drop this utility in without writing manual adapter code.
Prerequisites
- Node.js 18+ with npm or yarn
- TypeScript project with LangChain (@langchain/core and relevant LLM provider packages) installed
- One or more MCP servers to integrate (local or remote)
- API keys for your chosen LLM provider (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY)
Install the package
Add the langchain-mcp-tools package to your TypeScript project.
npm i @h1deya/langchain-mcp-toolsDefine your MCP server configurations
Create a configuration object for the MCP servers you want to use. The format matches Claude for Desktop's MCP server configuration.
const mcpServers = {
filesystem: {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
},
fetch: {
command: "uvx",
args: ["mcp-server-fetch"]
}
};Convert MCP tools to LangChain tools
Call convertMcpToLangchainTools with your server configs and optionally specify the LLM provider for schema compatibility transformations.
import { convertMcpToLangchainTools } from "@h1deya/langchain-mcp-tools";
const { tools, cleanup } = await convertMcpToLangchainTools(
mcpServers,
{ llmProvider: "anthropic" }
);Create a LangChain agent with the converted tools
Pass the tools array to your LangChain agent or chain as you would any native LangChain tool.
import { createReactAgent } from "@langchain/langgraph/prebuilt";
import Anthropic from "@anthropic-ai/sdk";
const agent = createReactAgent({ model, tools });
const result = await agent.invoke({ messages: [{ role: "user", content: "List files in /tmp" }] });Clean up MCP server connections
Always call cleanup() when done to properly close MCP server connections and free resources.
await cleanup();LangChain MCP Tools Examples
Client configuration
Example TypeScript code showing the full integration pattern with an Anthropic model.
{
"dependencies": {
"@h1deya/langchain-mcp-tools": "latest",
"@langchain/anthropic": "latest",
"@langchain/langgraph": "latest"
}
}Prompts to try
Examples of what your LangChain agent can do once MCP tools are integrated.
- "List all files in the /tmp directory using the filesystem server"
- "Fetch the content of https://example.com and summarize it"
- "Search my notes vault for mentions of 'project deadline'"
- "What tools are available from the connected MCP servers?"
- "Use the GitHub MCP server to list open pull requests in my repository"Troubleshooting LangChain MCP Tools
Schema validation errors when using with Google Gemini or OpenAI
Pass the correct llmProvider option to convertMcpToLangchainTools (e.g., `{ llmProvider: "google_gemini" }` or `{ llmProvider: "openai" }`). This triggers provider-specific schema transformations that fix incompatibilities between MCP tool schemas and provider expectations.
MCP server process fails to start
Verify the command and args in your server config are correct and the binary is installed. For npx-based servers, ensure Node.js is in PATH. For uvx-based servers, ensure uv is installed. Check stderr output by adding `stderr: "pipe"` to the server config.
Tools array is empty after conversion
Confirm the MCP server started successfully and actually exposes tools. Test the server independently using the MCP Inspector (`npx @modelcontextprotocol/inspector`) to verify it lists tools before trying to convert them.
Frequently Asked Questions about LangChain MCP Tools
What is LangChain MCP Tools?
LangChain MCP Tools is a Model Context Protocol (MCP) server that mcp to langchain tools conversion utility / 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 APIs Servers
Looking for alternatives to LangChain MCP Tools? Here are other popular apis servers you can use with Claude, Cursor, and VS Code.
Kong
โ 43.4k๐ฆ The API and AI Gateway
API Mega List
โ 5.4kThis GitHub repo is a powerhouse collection of APIs you can start using immediately to build everything from simple automations to full-scale applications. One of the most valuable API lists on GitHubโperiod. ๐ช
Fetch
โ 5.4kFetch web content and convert to markdown for AI consumption
Fusio
โ 2.1kSelf-Hosted API Management for Builders
Korean Law
โ 1.8k๊ตญ๊ฐ๋ฒ๋ น์ ๋ณดMCP v4.0 | ๋ฒ์ ์ฒ 41๊ฐ API โ 17๊ฐ MCP ๋๊ตฌ. ๋ฒ๋ นยทํ๋กยท์กฐ๋ก ๊ฒ์ + LLM ํ๊ฐ ๋ฐฉ์ง ์ธ์ฉ๊ฒ์ฆ + ์กฐ๋ฌธ ์ํฅ ๊ทธ๋ํ(impact_map) + ์์ ๋น๊ต ์๋ diff(time_travel) + ์๋ฏผ 5๋จ๊ณ ์คํ ๊ฐ์ด๋(action_plan) | 41 Korean legal APIs โ 17 MCP tools
RuleGo
โ 1.5kโ๏ธRuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
Browse More APIs MCP Servers
Explore all apis 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.