/mcp on Agent Server.
Agent Server supports MCP protocol revisions 2024-11-05 through 2026-07-28. Clients on revisions up to 2025-11-25 start with an initialize handshake. On 2026-07-28, each request carries its own protocol metadata, in _meta and in the MCP-Protocol-Version header, so clients connect without a handshake. When an agent pauses for input, Agent Server asks a client that supports elicitation for it. For more information, see Human-in-the-loop over MCP.
The protocol revisions, tool fields, result format, session behavior, and
Origin check described on this page require langgraph-api>=0.18.0./mcp endpoint. For Managed Deep Agents URL discovery and identity headers, see Connect MCP clients to a managed deep agent.
You can set up custom authentication middleware to authenticate a user with an MCP server to get access to user-scoped tools within your LangSmith deployment.
An example architecture for this flow:
Requirements
To use MCP, ensure you have the following dependencies installed:langgraph-api >= 0.2.3langgraph-sdk >= 0.1.61
langgraph-api 0.18.0 or later, the endpoint also needs the mcp package in the version range that langgraph-api requires. Installing langgraph-api provides it. If your dependencies pin another version of mcp, Agent Server starts without the endpoint and logs MCP endpoint disabled: the installed MCP SDK is not supported. The /info response then reports "mcp": false under flags.
Usage overview
To enable MCP:- Upgrade to use langgraph-api>=0.2.3. If you are deploying LangSmith, this will be done for you automatically if you create a new revision.
- MCP tools (agents) will be automatically exposed.
- Connect with any MCP-compliant client that supports Streamable HTTP.
Client
Use an MCP-compliant client to connect to the Agent Server. The following examples show how to connect using different programming languages.- JavaScript/TypeScript
- Python
Note
Replace serverUrl with your Agent Server URL and configure authentication headers as needed.
Expose an agent as MCP tool
When deployed, your agent will appear as a tool in the MCP endpoint with this configuration:- Tool name: The agent’s name. Agent Server trims it and replaces each run of whitespace with
_. It also removes characters that MCP does not allow in tool names and cuts the name to 128 characters. - Tool title: The agent’s name.
- Tool description: The agent’s description, or
Tool based on the <name> assistantwhen the agent has none. - Tool input schema: The agent’s input schema.
- Tool annotations:
readOnlyHint,destructiveHint, andidempotentHintarefalse, andopenWorldHintistrue.
context object to the tools/call parameters, next to arguments.
Setting name and description
You can set the name and description of your agent inlanggraph.json:
Schema
Define clear, minimal input and output schemas to avoid exposing unnecessary internal complexity to the LLM. The default MessagesState usesAnyMessage, which supports many message types but is too general for direct LLM exposure.
Instead, define custom agents or workflows that use explicitly typed input and output structures.
For example, a workflow answering documentation questions might look like this:
Use user-scoped MCP tools in your deployment
To make user-scoped tools available to your LangSmith deployment, start with implementing a snippet like the following:- Your MCP server URL. A URL target uses Streamable HTTP.
- Pass a bearer token with
auth=onClient. For non-bearer headers (such asx-api-key), useStreamableHttpTransport(url, headers=...)instead. See Authentication. - Discover tools from the MCP server.
Session behavior
The MCP endpoint does not use sessions. Each/mcp request is independent, and Agent Server answers it with JSON, not an event stream. The endpoint accepts only POST requests. A tool call that pauses for input keeps its state on the server between requests, linked by requestState. For more information, see Human-in-the-loop over MCP.
Authentication
The/mcp endpoint uses the same authentication as the rest of the LangGraph API. Refer to the authentication guide for setup details.
Requests that include an Origin header, such as requests from a browser, must come from an allowed origin. Agent Server reads the allowed origins from allow_origins or allow_origin_regex in the http.cors configuration, or from the CORS_ALLOW_ORIGINS environment variable. A wildcard (*) does not allow any origin on this endpoint. Agent Server always allows origins on localhost, 127.0.0.1, and [::1], and rejects a request from any other origin with HTTP 403.
Disable MCP
To disable the MCP endpoint, setdisable_mcp to true in your langgraph.json configuration file:
/mcp endpoint.
The endpoint runs each tool call through the runs API. When disable_runs is true, every tool call fails with JSON-RPC error -32602.
Connect these docs to your agent of choice via MCP for real-time answers.

