LC2MCP

v1.0.0Developer Toolsstable

Convert LangChain tools to FastMCP tools

ai-toolsanthropicclaudecursorfastmcp
Share:
69
Stars
0
Downloads
0
Weekly
0/5

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

Convert LangChain tools to MCP format
Enable LangChain integration with MCP ecosystem
xiaotonng

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedMay 13, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx lc2mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

Install lc2mcp

Install the lc2mcp package from PyPI. This also installs fastmcp and langchain-core as dependencies.

pip install lc2mcp
2

Install 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 wikipedia
3

Create 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()
4

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"]
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "lc2mcp": { "command": "npx", "args": ["-y", "lc2mcp"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides