MCP.so
ログイン

MCP Langchain Bridge

@archimedes-market

基本情報

カテゴリ

AI とエージェント

ライセンス

MIT

トランスポート

stdio

作者

archimedes-market

投稿者

Emmanuel “CUBE” Kubikus

MCP Langchain Bridge について

Expose any LangChain chain, agent, or tool as an MCP server. Schema-aware tool registration, tool-call tracing, retry and timeout policies, and structured output validation. Bridges the LangChain ecosystem into Claude / ChatGPT / Cursor without rewri

MCP Langchain Bridge の設定

以下の設定を使って、このサーバーを MCP 対応クライアントに追加してください。

{
  "mcpServers": {
    "langchain-bridge": {
      "command": "mcp-langchain-bridge",
      "args": [
        "serve"
      ]
    }
  }
}

MCP Langchain Bridge のツール

ツール一覧はまだありません

この掲載には表示できるツール一覧がまだありません。サーバーにツールがないという意味ではありません。対応機能はプロジェクトのドキュメントをご確認ください。

ツールは README から自動的に抽出されます。メンテナーは ## Tools という見出しの下に記載することで、このタブに反映できます。

概要

What is Mcp Langchain Bridge?

Mcp Langchain Bridge is a Python library that exposes any LangChain chain, agent, or tool—such as RAG chains, agentic workflows, or custom tools—as a Model Context Protocol (MCP) server. It is designed for developers who want to make existing LangChain orchestration logic callable from any MCP client, including Claude Desktop and Cursor.

How to use Mcp Langchain Bridge?

Import the bridge module from mcp_langchain_bridge, then call bridge.create_server() with a server name, a list of LangChain BaseTool instances (or any subclass), and optional retry and timeout settings. The server is started with .run().

Key features of Mcp Langchain Bridge

  • Auto‑schema: each LangChain tool’s args_schema becomes the MCP tool’s input schema (Pydantic v2).
  • Configurable retry/backoff per tool with circuit‑breaker behavior.
  • Per‑tool execution timeout, configurable via decorator or environment variable.
  • OpenTelemetry tracing on every tool call; integrates with LangSmith when LANGSMITH_API_KEY is set.
  • Output validation against Pydantic schemas before returning results to the agent.

Use cases of Mcp Langchain Bridge

  • Make a LangChain retrieval‑augmented generation (RAG) chain available as an MCP tool in Claude Desktop without rewriting.
  • Expose LangChain agents (e.g., tool‑using agents) to any MCP‑compatible IDE or chat interface.
  • Wrap custom LangChain tools with retry and timeout policies for production‑grade MCP deployments.
  • Bridge LangGraph state machines into the MCP ecosystem without altering the graph logic.
  • Add telemetry and output validation to existing LangChain tool sets used via MCP.

よくある質問

1

How does this compare to native MCP tool definitions?

You avoid porting LangChain tools to native MCP definitions, and you don’t need to abandon Claude Desktop because your existing stack is LangChain. LangGraph state machines remain unchanged—the MCP layer wraps only the entrypoint.

2

What are the runtime requirements?

You need a Python environment with the `mcp_langchain_bridge` package and LangChain installed (e.g., `langchain_community`). Any LangChain `BaseTool` subclass works.

3

Does Mcp Langchain Bridge support streaming responses?

No. Streaming responses from chains are buffered into the MCP response because the MCP spec does not yet support streaming for tool calls. Long‑running chains should be checkpointed externally.

4

Can I trace tool calls with LangSmith?

Yes. OpenTelemetry spans are emitted on every tool call, and they automatically integrate with LangSmith when the `LANGSMITH_API_KEY` environment variable is set.

5

What happens to custom LangChain callbacks?

Custom callback handlers fire as expected, but UI updates targeted at notebook environments will not surface to the MCP client.

コメント

「AI とエージェント」の他のコンテンツ