
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 とエージェント」の他のコンテンツ
🔎 GPT Researcher
assafelovicAn autonomous agent that conducts deep research on any data using any LLM providers
Open Multi-Agent Canvas
CopilotKitThe open-source multi-agent chat interface that lets you manage multiple agents in one dynamic conversation and add MCP servers for deep research
MCP-NixOS - Because Your AI Assistant Shouldn't Hallucinate About Packages
utensilsMCP-NixOS - Model Context Protocol Server for NixOS resources
Intervals.icu MCP Server
mvilanovaModel Context Protocol (MCP) server for connecting Claude and ChatGPT with the Intervals.icu API.
欢迎来到 智言平台
Shy2593666979AgentChat 是一个基于 LLM 的智能体交流平台,内置默认 Agent 并支持用户自定义 Agent。通过多轮对话和任务协作,Agent 可以理解并协助完成复杂任务。项目集成 LangChain、Function Call、MCP 协议、RAG、Memory、HITL、Skill、Milvus 和 ElasticSearch 等技术,实现高效的知识检索与工具调用,使用 FastAPI 构建高性能后端服务。
コメント