
Mcp Langchain Bridge
@archimedes-market
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 対応クライアントに追加してください。
{
"mcpServers": {
"langchain-bridge": {
"command": "mcp-langchain-bridge",
"args": [
"serve"
]
}
}
}ツール
ツールは検出されませんでした
ツールは 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_schemabecomes 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_KEYis 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.
FAQ from Mcp Langchain Bridge
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.
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.
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.
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.
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 とエージェント」の他のコンテンツ
MCP-NixOS - Because Your AI Assistant Shouldn't Hallucinate About Packages
utensilsMCP-NixOS - Model Context Protocol Server for NixOS resources
Shell and Coding agent for Claude and other mcp clients
rusiaamanShell and coding agent on mcp clients
Perplexity Ask MCP Server
ppl-aiThe official MCP server implementation for the Perplexity API Platform
MCP Client for Ollama (ollmcp)
joniglHarness the power of local LLMs with this TUI MCP Client for Ollama. Featuring all core MCP primitives (tools, prompts, resources), agent mode, multi-server, model switching, streaming responses, human-in-the-loop, thinking mode, model params config, system prompts, and saved pre
Intervals.icu MCP Server
mvilanovaModel Context Protocol (MCP) server for connecting Claude and ChatGPT with the Intervals.icu API.
コメント