LangSmith/Deployment/Q/How do deployed agents work together over the MCP endpoint?
Properties
- logseq-entity
- Logseq/Entity/Question
- see-also
- A2A, LangSmith/Deep Agents
How do deployed agents work together over the MCP endpoint, including from Claude/Code or Codex?
AI Answer
- Answer/Official from Agent Server: MCP endpoint, researched by Anthropic/Model/Claude/5/5/Opus on 2026-09-29 Tue
- Short answer: every LangSmith/Deployment serves
/mcp, and each agent in it shows up there as one MCP tool. Any MCP client that speaks Streamable HTTP — another agent, Claude/Code, Codex — can list those tools and call an agent like any other tool. What the endpoint exposes
- The Agent Server implements MCP over the Streamable HTTP transport at
/mcp. It is on by default inlanggraph-api>=0.2.3;"disable_mcp": trueinlanggraph.jsonturns it off. - Each deployed agent becomes one tool: the tool name is the agent's name, the description is the agent's description, and the input schema is the agent's input schema. Name and description are set in
langgraph.json. - The docs recommend explicit, minimal input and output schemas. The default
MessagesStateaccepts any message type, which is too loose for another model to fill in well. - Auth is the same as the rest of the deployment's API; on LangSmith that is an
X-Api-Keyheader. - The endpoint has no sessions. Every
/mcpcall is independent, so one tool call is one fresh run of the agent, with no thread carried to the next call.
- The Agent Server implements MCP over the Streamable HTTP transport at
Agent to agent
- An agent in one deployment can load another deployment's
/mcptools withlangchain-mcp-adapters(load_mcp_toolsorMultiServerMCPClient) and hand them to its own model. The calling agent's model then decides when to delegate to the other agent, the same way it picks any tool. - That makes deployed agents interchangeable: swapping one for another means pointing the client at a different URL.
- Because calls are stateless, MCP suits one-shot delegation: ask a question, get an answer.
- For long-running or multi-turn work between agents, the docs point to other routes: A2A, served per assistant at
/a2a/{assistant_id}with tasks and streaming (A2A endpoint), or LangSmith/Deep Agents async subagents, which launch, check, steer and cancel runs on a remote deployment over the Agent Protocol (Async subagents).
- For long-running or multi-turn work between agents, the docs point to other routes: A2A, served per assistant at
- An agent in one deployment can load another deployment's
From Claude/Code
From Codex
codex mcp add --urlregisters a Streamable HTTP server, but its only auth flag is--bearer-token-env-var, which sendsAuthorization: Bearer. LangSmith expectsX-Api-Key, so set the header in~/.codex/config.toml:- toml
[mcp_servers.finance-agent] url = "https://<deployment-host>/mcp" env_http_headers = { "X-Api-Key" = "LANGSMITH_API_KEY" } env_http_headersmaps a header name to the environment variable that holds its value. Checked against thecodex mcp add --helpoutput and the config keys of codex-cli 0.158.0, not against a live deployment.
User-scoped tools