mcpField
M
Mcp Langchain Bridge

Mcp Langchain Bridge

Local
github.com/archimedes-marketAI & Agents0Updated 23w ago

About Mcp Langchain Bridge

MCP LangChain Bridge wraps LangChain chains, agents, and tools as MCP servers for teams using existing LangChain workflows with MCP clients. It adds schema-based registration, call tracing, retry and timeout policies, and output validation.

Key features

  1. 01Maps tool argument schemas to MCP inputs
  2. 02Per-tool retries and timeouts
  3. 03OpenTelemetry call tracing
  4. 04Validates outputs with Pydantic schemas
  5. 05Wraps LangGraph entrypoints

Use cases

  1. 01Expose existing LangChain tools to MCP clients
  2. 02Serve a retrieval chain without rewriting it
  3. 03Add tracing and failure policies to tool calls

MCP support

It exposes LangChain chains, agents, and tools as MCP tools for clients such as Claude Desktop and Cursor. Tool inputs are derived from LangChain argument schemas.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Archimedes Trust Report — VERIFIED 92/100

Verified asset on Archimedes Market. View the full 4-dimension Trust Report (security · quality · license · complexity) and the curated catalog on the asset page.


MCP LangChain Bridge

Expose any LangChain chain, agent, or tool as an MCP server. The point is to take orchestration logic that already exists in LangChain — RAG chains, agentic workflows, custom tools — and make it agent-callable from Claude Desktop, Cursor, or any MCP client.

What you get

  • Auto-schema: each LangChain tool's args_schema becomes the MCP tool's input schema. Pydantic v2 generation built in.
  • Retry policies: configurable retry/backoff per tool, with circuit-breaker behavior on persistent failures.
  • Timeouts: per-tool execution timeout, configurable via decorator or env var.
  • Tracing: OpenTelemetry spans on every tool call. Drops into LangSmith if LANGSMITH_API_KEY is set.
  • Output validation: results validated against Pydantic schemas before returning to the agent.

Usage

from mcp_langchain_bridge import bridge
from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun

server = bridge.create_server(
    name="research-tools",
    tools=[
        DuckDuckGoSearchRun(),
        WikipediaQueryRun(),
        # Any LangChain BaseTool subclass works
    ],
    retry={"max_attempts": 3, "backoff": "exponential"},
    timeout=30.0,
)

server.run()

Why this matters

LangChain has the largest tool ecosystem in the agent space. MCP has the cleanest agent-host integration. Bridging the two avoids rewriting in either direction:

  • You don't need to port your retrieval chain to native MCP tool definitions
  • You don't need to abandon Claude Desktop because your existing stack is LangChain
  • LangGraph state machines remain unchanged — the MCP layer wraps the entrypoint

Limitations

  • Streaming responses from chains are buffered into the MCP response (MCP spec doesn't yet support streaming for tool calls). Long-running chains should be checkpointed externally.
  • LangChain custom callback handlers fire as expected, but UI updates targeted at notebook environments won't surface to the MCP client.

License

MIT.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.