Skip to content
Meshes as MCP Servers

Meshes as MCP Servers

Every mesh is also an MCP server. An MCP client, such as a coding agent or a chat app, connects to it over HTTP and calls the intents of the mesh as tools. Each tool call is a request to the mesh.

Addresses

The path names the version that runs, or a route that picks one:

PathRuns
/mcp/meshes/{mesh_id}/versions/{version}The version with this number
/mcp/meshes/{mesh_id}/version_labels/{version_label}The version with this label
/mcp/meshes/{mesh_id}/draftThe draft
/mcp/routes/{route_id}The version that the route picks for each new conversation

On the hosted service, the address starts with https://api.partite.ai. Through an access point, put /access-points/{access_point_id} before the path, for example https://api.partite.ai/access-points/<ACCESS_POINT_ID>/mcp/routes/<ROUTE_ID>.

To get the address, press Connect on the mesh settings page. Choose the version or route, then choose MCP.

The server uses the Streamable HTTP transport. It keeps no session between HTTP requests, and it refuses JSON-RPC batches.

Authentication

Send a bearer token in the Authorization header. The token is one of these:

  • An API key with the scope Converse with meshes. Use the address without an access point. See API Keys.
  • A token for an access point: one from a trusted issuer of the access point, or one that the access point issues to its clients. Use the access point’s address. See Access Points.

An MCP client that does OAuth can find out where to get a token. A call to the access point’s address without a token gets 401, with a WWW-Authenticate header that points to the metadata. The access point has no dynamic client registration, so give the MCP client the ID and secret of an access point client. For the authorization code flow, also add the MCP client’s redirect URI to the access point client.

A self-hosted Partite Mesh takes calls without a token until you set REQUIRE_AUTH=true. See Self-Hosting.

Tools

Each intent of the version is a tool:

  • The tool name is the intent name.
  • The input schema is the input schema of the intent. An intent whose input isn’t an object is not listed.
  • The output schema is the schema of the intent’s response. When the intent has several responses, it is anyOf their schemas. When a response has no schema, the tool has no output schema.
  • The tool has no description. A model picks and fills the tool from its name and input schema, so give intents clear names and describe the input fields. See Message Schemas.

The list leaves out the intents that the caller’s boundaries refuse. Each intent is checked as a Request create, with the tags from the headers.

The server offers only tools. It has no resources and no prompts.

On a route, listing the tools and calling one are separate HTTP requests, and each one picks a version. So the list can come from a different version than the one a call runs on. A call to a tool that the picked version doesn’t have fails with unknown tool. Keep the same intents in every version of a route. When the headers name an existing conversation, both use the version of that conversation.

Calling a tool

The arguments of a call are the input of a new request. The call returns when the request ends:

RequestTool result
CompletesThe response, as JSON text and as structuredContent
FailsA tool error with the error message
Is cancelledA tool error: The request was cancelled.

Arguments that don’t match the input schema give a tool error, so the model can correct the call. A boundary rule that refuses the request also gives a tool error, with the rule’s message and the decision ID.

While the request runs, a client that sent a progress token gets the request’s messages and thinking as progress notifications.

If the client disconnects before the result, the request is cancelled. To keep long requests running, use a client that supports tasks.

Conversations

Each tool call starts a new conversation, unless the client names one. To keep calls in one conversation, send the Partite-Conversation-External-Id header. The first call with an external ID starts a conversation with that ID. Later calls with the same ID continue the conversation, on the version it started on. The external ID follows the rules of the Conversation API. An external ID whose conversation is on another mesh is refused.

Most MCP clients send the same headers on every call. With a fixed external ID, every call from the client goes to the same conversation.

Through an access point, a caller reaches only the conversations it created.

These headers set the conversation and its requests, as they do for AG-UI:

HeaderSets
Partite-Conversation-External-IdThe external ID of the conversation
Partite-Conversation-TagsThe tags of a new conversation
Partite-Request-TagsThe tags of each request
Partite-Notification-ChannelThe notification channel of a new conversation. The channel must exist.
Partite-Conversation-Tracingfalse turns tracing off for a new conversation

When a call continues an existing conversation, the headers for a new conversation are ignored.

A tags header holds name=value pairs, separated by commas or on several header lines, for example Partite-Conversation-Tags: team=support,customer=acme. Percent-encode a comma, a %, characters outside ASCII, and spaces at either end. A tags header can be at most 8 KB.

Boundaries apply over MCP as they do elsewhere. When the headers name no existing conversation, every request that lists or calls tools is checked as a Conversation create. If a rule refuses, the server answers 403 with a problem document, and the client can’t list or call tools. Boundary modifications can set the tags and tracing of the conversation.

Questions and approvals

An agent can ask the user something during a request with a client task, such as ask_question. A boundary can make a tool call wait for the user’s approval. Over MCP, both become an elicitation: a form for the user to fill in.

  • The form has the top-level properties of the answer’s schema. A property that a form can’t hold, such as an object, becomes a string that holds JSON.
  • The message names the task and shows its input. For an approval, it shows the rule’s message, the tool and the arguments.
  • _meta["ai.partite/outputSchema"] holds the full schema of the answer. _meta["ai.partite/presentations"] holds the presentations of the task, such as an A2UI surface, when it has any.
  • Accepting the form sends the answer. Declining or dismissing it cancels the task. For a client task, the agent gets an error. For an approval, the tool call is declined.

How the client gets the form depends on what it supports:

ClientWhat happens
Supports the Tasks extension (io.modelcontextprotocol/tasks)The form is part of the task. See Long requests as tasks.
Uses MCP version 2026-07-28 or later, and takes form elicitationThe tool result asks for input, with inputRequests and a requestState. The client calls the tool again with the answers in inputResponses and the same requestState.
NeitherThe request is cancelled. The tool result is an error that names the task that the client couldn’t answer.

A task whose answer isn’t a JSON object can’t be shown as a form. The mesh handles it as it does for a client that can’t answer.

For more on client tasks, see Client Tasks and AG-UI.

Long requests as tasks

When the client supports the Tasks extension, a tool call returns a task at once, and the request runs on. A disconnect doesn’t cancel it. The client polls with tasks/get, about once a second. The status of the task is one of these:

StatusMeaning
workingThe request runs. statusMessage has the last message of the request.
input_requiredThe request waits for an answer. inputRequests has the form. Answer with tasks/update.
completedThe request ended. result has the tool result, as in Calling a tool.
cancelledThe request was cancelled.

tasks/cancel cancels the request. If the client doesn’t take form elicitation, a task that waits for an answer stays working, and its statusMessage names what it waits for. The client can cancel it.

Client configuration

This is a .mcp.json file for Claude Code. It calls a route with an API key from the environment variable PARTITE_API_KEY, and tags every conversation:

{
  "mcpServers": {
    "support": {
      "type": "http",
      "url": "https://api.partite.ai/mcp/routes/<ROUTE_ID>",
      "headers": {
        "Authorization": "Bearer ${PARTITE_API_KEY}",
        "Partite-Conversation-Tags": "team=support"
      }
    }
  }
}

Other MCP clients take the same address and headers in their own format.

Related