xiaotonng/lc2mcp

View on GitHub ↗

Convert LangChain tools to FastMCP tools

61 ★15 forksPythonUpdated 7mo ago

What you need to know

A lightweight adapter that converts existing LangChain tools into FastMCP tools in one line of code, unlocking 1000+ LangChain community tools for MCP clients.

Install

pip install lc2mcp

Usage

  • •Wrap a LangChain tool with @tool and call register_tools(mcp, [tool])
  • •Optionally add parse_docstring or args_schema for parameter descriptions
  • •Run the FastMCP server and connect Claude or Cursor

Key features

  • ✓Instant LangChain to FastMCP conversion
  • ✓Access to 1000+ LangChain community tools
  • ✓Automatic Pydantic to JSON Schema conversion
  • ✓Context injection for auth and user info
  • ✓Progress notifications and logging
  • ✓Tool name namespacing and conflict handling

Best for

Developers with existing LangChain tools who want to expose them as MCP servers quickly.

Caveats

  • ⚠Requires LangChain >= 1.0.0 and FastMCP >= 2.0.0
  • ⚠Python 3.10, 3.11, 3.12+
Clients: Claude · Cursor · Any MCP-compatible client

Reviewed 2026-08-11

Topics

ai-toolsanthropicclaudecursorfastmcplangchainllmmcpmodel-context-protocol
Stars
61★
Forks
15
Language
Python
License
MIT
Created
2026-01-21
Last push
2026-01-31