XL

xiaotonng/lc2mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

55 stars 16 forks 품질 58 트렌드 0MIT

xiaotonng/lc2mcp는 https://github.com/xiaotonng/lc2mcp.]에서 수입된 MCP 서버 후보입니다

개요

xiaotonng/lc2mcp는 https://github.com/xiaotonng/lc2mcp.]에서 수입된 MCP 서버 후보입니다

개요(AI 번역)

** 빠른 MCP 도구로 LangChain 도구를 변환 — 코드의 한 줄에.**

당신의 공구를 rewriting 중지하십시오. 그냥 그들을 적응.

lc2mcp]는 기존 LangChain 도구을 FastMCP 도구로 변환하는 경량 어댑터이며, Claude, Cursor 및 MCP 호환 클라이언트에 신속하게 MCP 서버를 구축할 수 있습니다.


✨ 특징

특징 묘사
자주하는 질문 랑체인 툴을 FastMCP 툴로 변환하는 1개의 함수 호출
인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 센터
영 보일러판 자동 Pydantic → JSON Schema 변환
인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션 인포메이션
Progress & Logging MCP 진행 알림 및 로깅에 대한 전체 지원
automatically️ Namespace Support 접두사 도구 이름 및 핸들 충돌 자동

⭐ 빠른 시작

설치

##3 라인에서 MCP

도구는 이제 Claude, Cursor 및 MCP 클라이언트에서 사용할 수 있습니다.

# # # 도구 매개 변수 설명

MCP 도구 스키마의 매개 변수 설명을 포함하려면 두 가지 옵션이 있습니다

이 페이지는 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=True or args_schema, parameter descriptions from docstrings will not be extracted.


🔌 How It Works

┌─────────────────┐      ┌─────────────┐      ┌─────────────────┐
│  LangChain Tool │ ───▶ │   lc2mcp    │ ───▶ │  FastMCP Tool   │
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →