Creativity · MCP — integration

Using MCP Servers in LangChain

LangChain added first-class MCP support via the `langchain-mcp-adapters` package. It lets a LangChain or LangGraph agent connect to any MCP server — over stdio or HTTP — and expose that server's tools as LangChain BaseTool instances. You get to keep your LangGraph orchestration while pulling in the growing ecosystem of MCP servers (filesystem, GitHub, Slack, Postgres, etc.) without rewriting tool wrappers.

MCP facts

Kind
integration
Ecosystem
anthropic-mcp
Language
Python / TypeScript
Transports
stdio, http, sse

Capabilities

  • Adapter: MCP tools -> LangChain BaseTool instances
  • MultiServerMCPClient bundles several MCP servers into one tool list
  • Pairs with LangGraph's create_react_agent prebuilt

Install

pip install langchain-mcp-adapters langgraph

Configuration

from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_anthropic import ChatAnthropic

client = MultiServerMCPClient({
  "filesystem": {
    "command": "npx",
    "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
    "transport": "stdio"
  }
})
tools = await client.get_tools()
agent = create_react_agent(ChatAnthropic(model="claude-opus-4-7"), tools)

Frequently asked questions

What does langchain-mcp-adapters give me?

It translates MCP tool schemas into LangChain tools and handles the session plumbing. You write LangChain/LangGraph code as usual; the adapter does the protocol work.

Can I mix MCP tools with native LangChain tools?

Yes. The adapter returns a list of BaseTool objects that sit alongside any other tools you define, so your agent's tool list is a simple concatenation.

Does it work with LangGraph?

Yes — that's the primary target. You can pass the MCP-derived tools to create_react_agent, or wire them into custom nodes in a StateGraph.

Sources

  1. langchain-mcp-adapters — accessed 2026-04-20
  2. LangGraph docs — accessed 2026-04-20