
xiaotonng/lc2mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
xiaotonng/lc2mcp は https://github.com/xiaotonng/lc2mcp. からインポートされた MCP サーバーの候補です
概要
xiaotonng/lc2mcp は https://github.com/xiaotonng/lc2mcp. からインポートされた MCP サーバーの候補です
概要(AI 翻訳)
LangChain ツールを FastMCP ツールへ変換 — コードの 1 行で。
ツールの書き換えを停止します。 それらを適応させるだけです。
[[lc2mcp は、既存の LangChain ツール を FastMCP ツール に変換する軽量アダプターで、Claude、Cursor、および MCP 互換クライアントに MCP サーバーをすばやく構築できます。
お問い合わせ
✨ 機能
| 特集 | 概要 | お問い合わせ お問い合わせ LangChainツールをFastMCPツールに変換するための1つの関数呼び出し | | 特定非営利活動法人 エコシステムアクセス** | 1000以上のLangChainコミュニティツールのロック解除(Search, Wikipedia, SQL, APIなど) | | ゼロボイラプレート | 自動ピダンティック → JSON スキーマ変換 | | 🔐 * コンテキストインジェクション** | auth、ユーザー情報、ツールのコンテキストをリクエスト | | 特定商取引法に基づく表記 | MCP 進捗通知・ログの完全サポート | | ️️**** ネームスペースサポート** | プレフィックス ツール名とコンフリクトを自動的に処理 |
お問い合わせ
すぐにスタート
インストール
##3 行を MCP へ
ツールは、Claude、Cursor、および任意のMCPクライアントにご利用いただけます。
ツール パラメータ 説明
MCP ツールスキーマにパラメーターの説明を含めるには、2 つのオプションがあります
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
lc2mcp
Convert LangChain tools to FastMCP tools — in one line of code.
Stop rewriting your tools. Just adapt them.
lc2mcp is a lightweight adapter that converts existing LangChain tools into FastMCP tools, enabling you to quickly build MCP servers accessible to Claude, Cursor, and any MCP-compatible client.
✨ Features
| Feature | Description |
|---|---|
| 🔄 Instant Conversion | One function call to convert any LangChain tool to FastMCP tool |
| 📦 Ecosystem Access | Unlock 1000+ LangChain community tools (Search, Wikipedia, SQL, APIs…) |
| 🎯 Zero Boilerplate | Automatic Pydantic → JSON Schema conversion |
| 🔐 Context Injection | Pass auth, user info, and request context to tools |
| 📊 Progress & Logging | Full support for MCP progress notifications and logging |
| 🏷️ Namespace Support | Prefix tool names and handle conflicts automatically |
🚀 Quick Start
Installation
pip install lc2mcp
3 Lines to MCP
from langchain_core.tools import tool
from fastmcp import FastMCP
from lc2mcp import register_tools
@tool
def get_weather(city: str) -> str:
"""Get current weather for a city."""
return f"Sunny, 25°C in {city}"
mcp = FastMCP("weather-server")
register_tools(mcp, [get_weather]) # ← That's it!
if __name__ == "__main__":
mcp.run()
Your tool is now available to Claude, Cursor, and any MCP client.
Tool Parameter Descriptions
To include parameter descriptions in the MCP tool schema, you have two options:
Option 1: Use parse_docstring=True (Recommended for simplicity)
@tool(parse_docstring=True)
def get_weather(city: str, unit: str = "celsius") -> str:
"""Get current weather for a city.
Args:
city: The name of the city to query
unit: Temperature unit (celsius or fahrenheit)
"""
return f"Sunny, 25°C in {city}"
Option 2: Use args_schema (Recommended for complex types)
from pydantic import BaseModel, Field
class WeatherInput(BaseModel):
city: str = Field(description="The name of the city to query")
unit: str = Field(default="celsius", description="Temperature unit")
@tool(args_schema=WeatherInput)
def get_weather(city: str, unit: str = "celsius") -> str:
"""Get current weather for a city."""
return f"Sunny, 25°C in {city}"
Note: Without
parse_docstring=Trueorargs_schema, parameter descriptions from docstrings will not be extracted.
🔌 How It Works
┌─────────────────┐ ┌─────────────┐ ┌─────────────────┐
│ LangChain Tool │ ───▶ │ lc2mcp │ ───▶ │ FastMCP Tool │
インストール
This server does not publish a one-line install command.
Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →