Before you begin
Both endpoints authenticate the same way:- Agent ID: Open the agent, expand Advanced settings in the sidebar, and under Developer, click View code snippets. For more information, see Get the agent ID and URL.
- Credential: Create a personal access token (PAT) and send it in the
X-Api-Keyheader. On a self-hosted instance that has Fleet external OIDC configured, you can send an access token from your identity provider asAuthorization: Bearer <token>instead. - Workspace ID: Copy the ID of the workspace that owns the agent and send it in the
X-Tenant-Idheader. An API key cannot look up workspace IDs, so copy it from the LangSmith UI. - Permissions: Sending a task requires the
fleet-agents:invokepermission and run access to the agent. An agent you cannot run returns404.
https://api.smith.langchain.com. For another region, use that region’s API URL from Regions. On a self-hosted instance, use https://<your-langsmith-domain>/api, so the MCP endpoint is https://<your-langsmith-domain>/api/v1/fleet/agents/<AGENT_ID>/mcp.
On self-hosted LangSmith, the MCP and A2A endpoints require Helm chart version 0.18.0 or later (LangSmith
0.18.2026112100), with Fleet enabled.Connect over MCP
The MCP endpoint is aPOST route on the agent’s Fleet API URL:
Add the agent to Claude Code
Register the endpoint as an HTTP MCP server:Add the agent to another MCP client
Clients that read anmcpServers configuration, such as Cursor’s mcp.json, accept the endpoint and headers directly:
Understand the MCP tools
The server describes itself with the agent’s name and description, so the client’s model knows when to delegate to it. It exposes four tools:
Each tool returns the reply as text and as a structured result with
thread_id, run_id, status, reply, and interrupts. The status is completed, running, interrupted, or error.
Handle long runs
A tool call waits up to 5 minutes and sends progress notifications while the agent works. If the run is still going after that, the result hasstatus: running and the run continues. Call get_thread to read the reply once the run finishes.
Disconnecting the client does not stop a run. To stop it, call cancel_run.
Answer interrupts
When the agent pauses for a decision, the result hasstatus: interrupted and lists the pending prompts in interrupts. Decisions should come from the user, not the calling model.
- Tool approvals and questions: Each interrupt lists its
requests, each with anindexand its ownallowed_decisions:approveorrejecta tool call, orrespondto a question. Passdecisionstorespond_to_interruptwith one entry per index, for example[{"index": 0, "decision": "respond", "message": "Urgent"}, {"index": 1, "decision": "approve"}]. When one decision appears in the interrupt’sallowed_decisions, you can pass a singledecisioninstead. - Sign-ins: The interrupt carries
sign_ins, each with anauth_url. Send the user to that URL, then callrespond_to_interruptwithdecision: "continue", orskipto go on without signing in.
MCP limits
- Message size: Messages are capped at 32 KiB.
- One run per thread: A thread runs one request at a time. A second
send_messageon a thread that isrunningfails until the run finishes or is canceled. - Transport: The server uses stateless Streamable HTTP. It accepts
POSTonly, keeps no sessions, and does not send requests to the client.
Connect over A2A
The A2A endpoint speaks A2A v1.0 over JSON-RPC. The agent card sits at the conventional path under the agent’s URL, so A2A clients can use the agent URL as their base URL:fleet-agents:read or fleet-agents:invoke permission and read access to the agent.
Send a message
SendA2A-Version: 1.0 with each request to get v1.0 response shapes. Without the header, the endpoint returns the v0.3 response format, which differs from the task shapes on this page. Also send Accept: application/json, or Accept: text/event-stream for SendStreamingMessage:
Supported A2A methods
The endpoint also accepts the A2A v0.3 method names
message/send, message/stream, tasks/get, and tasks/cancel.
Continue a conversation
A message’scontextId is a Fleet thread ID. Omit it to start a new thread, or pass the contextId from an earlier task to continue that conversation.
Passing a new UUID as contextId creates the thread with that ID. A thread that belongs to another agent, or that you cannot see, returns error -32001.
Handle long runs
SendMessage holds the request open until the run finishes. For agents that run for a while, use SendStreamingMessage: its first event carries the task id and contextId.
Disconnecting does not stop a run. Call GetTask later for the result, or CancelTask to stop it.
Answer interrupts
When the agent needs a decision, the task comes back in stateTASK_STATE_INPUT_REQUIRED with an Interrupt artifact that holds the pending interrupt. To answer, send a message with the task’s taskId and contextId and a data part that carries the resume value:
A2A limits
- Request size: Request bodies are capped at 10 MiB.
- One run per thread: A thread runs one request at a time.
- No push notifications: Poll with
GetTaskor useSendStreamingMessage. - No security schemes on the card: The agent card does not list security schemes yet. Configure the
X-Api-KeyandX-Tenant-Idheaders in your A2A client directly.
See also
Connect these docs to your agent of choice via MCP for real-time answers.

