MCP Catalogs
Home

lc2mcp

by xiaotonng·69·Score 45

A lightweight adapter that converts existing LangChain tools into FastMCP tools in one line of code.

developer-toolsai-llmproductivity
15
Forks
7
Open issues
4 mo ago
Last commit
2d ago
Indexed

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:

you:Converting existing LangChain tools to serve MCP clients like Claude and Cursor
you:Building MCP servers quickly using LangChain's rich ecosystem of 1000+ community tools
you:Injecting authentication and user context into tools through MCP context
you:Handling tool name conflicts and organizing tools with prefixes

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 README
  • get_weatherget_weather(city: str, unit: str = "celsius") -> str

    Get current weather for a city.

  • whoamiwhoami(runtime: ToolRuntime[UserContext]) -> str

    Return the current user.

  • process_dataprocess_data(data: str, mcp_ctx: Context) -> str

    Process data with progress reporting.

  • DuckDuckGoSearchRun

    Perform a search using DuckDuckGo.

  • WikipediaQueryRun

    Query Wikipedia for information.

Comparable tools

langchain-mcp-adaptersfastmcpmcp-server-sdk

Installation

pip install lc2mcp

For 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

GitHub →

Last updated · Auto-generated from public README + GitHub signals.