lc2mcp
by xiaotonng·★ 69·Score 45
A lightweight adapter that converts existing LangChain tools into FastMCP tools in one line of code.
Overview
lc2mcp is a simple but powerful tool adapter that bridges the gap between LangChain's extensive tool ecosystem and the Model Context Protocol (MCP). It enables developers to expose existing LangChain tools to MCP clients like Claude and Cursor without rewriting the tools. The library converts LangChain tools to MCP-compatible formats automatically, handling Pydantic to JSON schema conversion, parameter descriptions, tool namespacing, and context injection.
Try asking AI
After installing, here are 4 things you can ask your AI assistant:
When to choose this
When you have existing LangChain tools and want to expose them via MCP without rewriting, or when you need access to LangChain's extensive ecosystem of community tools.
When NOT to choose this
If you're building from scratch without existing LangChain tools, or if you need the opposite direction (MCP to LangChain conversion), in which case langchain-mcp-adapters would be more appropriate.
Tools this server exposes
5 tools extracted from the READMEget_weatherget_weather(city: str, unit: str = "celsius") -> strGet current weather for a city.
whoamiwhoami(runtime: ToolRuntime[UserContext]) -> strReturn the current user.
process_dataprocess_data(data: str, mcp_ctx: Context) -> strProcess data with progress reporting.
DuckDuckGoSearchRunPerform a search using DuckDuckGo.
WikipediaQueryRunQuery Wikipedia for information.
Comparable tools
Installation
pip install lc2mcpFor Claude Desktop integration, add to your claude_desktop_config.json:
{
"mcpServers": {
"lc2mcp-example": {
"command": "python",
"args": ["-m", "fastmcp", "run", "/path/to/your/script.py"]
}
}
}Compare lc2mcp with
Last updated · Auto-generated from public README + GitHub signals.