mcp

An integration guide for Model Context Protocol, an open standard that lets applications give language models tools and context, in LangGraph agents.

In plain words
What is it for?
Use it to connect LangGraph agents to MCP servers over local command-line communication or network-based transports such as SSE, then let the agents call those tools.
Why use it?
It removes the need to build separate connections for every tool server by showing how one client can access tools from multiple servers.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/langchain-ai/langgraphjs/mcp
Clone the repo
git clone --depth 1 https://github.com/langchain-ai/langgraphjs
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 738 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00738
Opus 5 $0.00000 $0.00369
Sonnet 5 $0.00000 $0.00148
Haiku 4.5 $0.00000 $0.00074

Measured 2d ago against content hash 3b4987694e3d, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

mcp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/docs/agents/mcp.md · 103 lines

How it starts

The opening of the file, as written. The whole thing — 103 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MCP Integration

Model Context Protocol (MCP) is an open protocol that standardizes how applications provide tools and context to language models. LangGraph agents can use tools defined on MCP servers through the @langchain/mcp-adapters library.

MCP

Install the @langchain/mcp-adapters library to use MCP tools in LangGraph:

npm install @langchain/mcp-adapters

Use MCP tools

The @langchain/mcp-adapters package enables agents to use tools defined across one or more MCP servers.

// highlight-next-line
import { MultiServerMCPClient } from "@langchain/mcp-adapters";
import { initChatModel } from "langchain/chat_models/universal";
import { createReactAgent } from "@langchain/langgraph/prebuilt";

// highlight-next-line
const client = new MultiServerMCPClient({
  mcpServers: {
    "math": {
      command: "python",
      // Replace with absolute path to your math_server.py file
      args: ["/path/to/math_server.py"],
      transport: "stdio",
    },
    "weather": {
      // Ensure your start your weather server on port 8000
      url: "http://localhost:8000/sse",
      transport: "sse",
    }
  }
})

const llm = await initChatModel("anthropic:claude-3-7-sonnet-latest");
const agent = createReactAgent({
  llm,
  // highlight-next-line
  tools: await client.getTools()
});
 
const mathResponse = await agent.invoke(
  { messages: [ { role: "user", content: "what's (3 + 5) x 12?" } ] }
);
const weatherResponse = await agent.invoke(
  { messages: [ { role: "user", content: "what is the weather in nyc?" } ] }
);
await client.close();

Custom MCP servers

To create your own MCP servers, you can use the mcp library in Python (or @modelcontextprotocol/sdk in TypeScript). These libraries provide a simple way to define tools and run them as servers.

Install the MCP library:

pip install mcp

Use the following reference implementations to test your agent with MCP tool servers.

Read the full file on GitHub · 103 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 103 lines · 0 tokens per session scan A 3b4987694e3d

Subscribe to this mod's changes

mcp is an agent published in the GitHub repository langchain-ai/langgraphjs (3,242 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 738 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

affaan-m-agentshield

Explain why this repository is useful for advanced web development, 3D frontend, animations, UI systems, or creative development.

SAIRAMANALADI/vybe-intelligence-vault · 0 tokens

akihirookuda95-openai-agents-sdk-tutorial

Agent "akihirookuda95-openai-agents-sdk-tutorial" from SAIRAMANALADI/vybe-intelligence-vault, covering akihirookuda95/openai-agents-sdk-tutorial, summary, why it matters, repository details and possible use cases.

SAIRAMANALADI/vybe-intelligence-vault · 0 tokens

alexpeclub-ai-coding-starter-kit

Explain why this repository is useful for advanced web development, 3D frontend, animations, UI systems, or creative development.

SAIRAMANALADI/vybe-intelligence-vault · 0 tokens

overview

The Agent Starter Pack follows a "bring your own agent" approach. It provides several production-ready agent templates designed to accelerate your development while offering the flexibility to use your preferred agent framework or pattern.

GoogleCloudPlatform/agent-starter-pack · 0 tokens

iteration

The iteration agent of /auto. Runs the /auto-iteration-loop skill — an autonomous review loop that consumes /auto-verify's four-state output (PASS / FAIL / INCONCLUSIVE / ZEROELIGIBLEVARIANTS) plus the orthogonal deferred bucket and routes each claim to the right back-edge (① variant-only fix / ② baseline-script fix /…

zjunlp/Mechanist · 143 tokens

huyen-agents

Updated 2025: This is a summary of Chip Huyen's blog and book chapter on agents, with some added context to provide a comprehensive overview of their design, capabilities, and practical applications.

alirezadir/Agentic-AI-Systems · 0 tokens