LC2MCP
Convert LangChain tools to FastMCP tools
What is LC2MCP?
LC2MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to convert langchain tools to fastmcp tools
Convert LangChain tools to FastMCP tools
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Convert LangChain tools to FastMCP tools
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx lc2mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use LC2MCP
lc2mcp is a Python adapter that converts LangChain tools — including @tool-decorated functions and BaseTool subclasses — into FastMCP tools, making them available as MCP server endpoints. It handles Pydantic-to-JSON-schema conversion automatically, supports optional MCP context injection for progress reporting and logging, and includes namespace prefixing to avoid tool name collisions. Use it to bring the rich LangChain community tool ecosystem (DuckDuckGo, Wikipedia, Arxiv, and hundreds more) into any MCP-compatible AI client such as Claude Desktop or Cursor.
Prerequisites
- Python 3.10 or later installed
- pip for installing Python packages
- LangChain tools you want to expose (from langchain-core, langchain-community, or custom @tool functions)
- An MCP-compatible client such as Claude Desktop or Cursor
Install lc2mcp
Install the lc2mcp package from PyPI. This also installs fastmcp and langchain-core as dependencies.
pip install lc2mcpInstall your LangChain tools
Install any LangChain community tools you want to expose. For example, DuckDuckGo search and Wikipedia tools are in langchain-community.
pip install langchain-community duckduckgo-search wikipediaCreate your MCP server script
Write a Python file that imports your LangChain tools, creates a FastMCP instance, and registers the tools using lc2mcp's register_tools function.
from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun
from langchain_community.utilities import WikipediaAPIWrapper
from fastmcp import FastMCP
from lc2mcp import register_tools
mcp = FastMCP("langchain-tools")
register_tools(mcp, [
DuckDuckGoSearchRun(),
WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()),
])
if __name__ == "__main__":
mcp.run()Add the server to Claude Desktop config
Open your Claude Desktop configuration file and add an entry that runs your server script using Python. Replace the path with the actual location of your script.
{
"mcpServers": {
"langchain-tools": {
"command": "python",
"args": ["/absolute/path/to/your_server.py"]
}
}
}Restart Claude Desktop and verify
Restart Claude Desktop so it launches the new server. The LangChain tools will appear as MCP tools Claude can use. Ask Claude to search for something with DuckDuckGo to confirm.
LC2MCP Examples
Client configuration
Claude Desktop config entry that runs a custom lc2mcp server script exposing LangChain community tools.
{
"mcpServers": {
"langchain-tools": {
"command": "python",
"args": ["/Users/yourname/mcp-servers/langchain_server.py"]
}
}
}Prompts to try
Example prompts that exercise LangChain tools exposed via lc2mcp.
- "Search DuckDuckGo for the latest news about Model Context Protocol and summarize the top results"
- "Look up the Wikipedia article on Large Language Models and give me a brief overview"
- "Use the search tool to find recent Python tutorials on async programming"
- "Search for 'transformer architecture explained' and tell me which results are from academic sources"Troubleshooting LC2MCP
register_tools raises a schema validation error for a LangChain tool
Some older LangChain tools use non-standard Pydantic v1 schemas. Try upgrading langchain-community to the latest version. If the error persists, wrap the tool in a simple @tool-decorated function that manually specifies the input schema.
Tool name conflicts when registering multiple LangChain tools
Use the name_prefix parameter in register_tools to namespace your tools: register_tools(mcp, tools, name_prefix='search.'). This prevents collisions and makes tool names clearer in the Claude UI.
Claude Desktop cannot start the server — 'python not found'
Use the full absolute path to the Python executable in the command field (e.g. '/usr/local/bin/python3' or the path inside your virtual environment). Run 'which python3' or 'which python' in your terminal to find it.
Frequently Asked Questions about LC2MCP
What is LC2MCP?
LC2MCP is a Model Context Protocol (MCP) server that convert langchain tools to fastmcp tools It connects AI assistants to external tools and data sources through a standardized interface.
How do I install LC2MCP?
Follow the installation instructions on the LC2MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with LC2MCP?
LC2MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is LC2MCP free to use?
Yes, LC2MCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
LC2MCP Alternatives — Similar Developer Tools Servers
Looking for alternatives to LC2MCP? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up LC2MCP 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 LC2MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.