Applies to v1.3.18

Connecting MCP Clients

Purpose

This page connects an MCP client — an AI assistant such as Claude Desktop, Claude Code or VS Code with GitHub Copilot, or the MCP client of an agent framework — to the tools your platform publishes. It then walks through a first tools/call by hand, so you can see exactly what a client sends and receives. The transport mechanics, every supported method and the configuration settings are described in Runtime Protocols And MCP Support.

What You Need

From your platform administrator:

  • the base URL of the platform, for example https://apimapper.example.com;
  • the tenant id and the client id of a client application that has at least one toolset assigned to it;
  • either nothing more, if your client signs its user in itself (see below), or a credential — a bearer token your identity provider issues, or an API key issued for that client application.

The MCP server URL is then:

https://apimapper.example.com/runtime/{tenantId}/{clientId}/mcp

The client application decides which tools appear; the tools' access policies decide which of them this caller may use. Two client applications in the same tenant can therefore see different tool catalogs from the same platform.

Choosing How The Client Authenticates

Let the client sign the user in. Clients that implement MCP authorization need only the URL. Their first request is answered 401 with a WWW-Authenticate header naming the platform's protected-resource metadata; from there the client finds the platform's authorization server, registers itself, and opens a browser on the Portal's sign-in, where the user signs in — with an external identity provider and MFA where configured — and approves the client on a consent screen. The client then calls the Runtime as that user, limited to the scopes the user approved (tools:read to list tools, tools:invoke to call them). See Browser Sign-In For MCP Clients.

Give the client a static header. For a client that cannot sign a user in, or for an unattended agent, configure a request header the client sends on every request:

Credential Header
Bearer token from your identity provider Authorization: Bearer <access-token>
Application API key X-Api-Key: <api-key>

A bearer token expires, so a static header suits short sessions and testing; an API key suits an unattended client. Treat either as a secret: prefer a client setting that reads it from an environment variable or a secret store over pasting it into a configuration file that is shared or committed.

Configuring Common Clients

Every client below needs the same three values. Where each one goes, and the exact name of the setting, is defined by the client — follow its own documentation for adding a remote MCP server over Streamable HTTP.

Value What to enter
Server URL https://apimapper.example.com/runtime/{tenantId}/{clientId}/mcp
Transport Streamable HTTP (sometimes labelled "HTTP"). Use SSE only for a client that offers nothing else — see below
Authentication The client's own OAuth sign-in, or one of the headers above
  • Claude Desktop — add a remote MCP server or connector with the server URL. See the client's documentation for where remote servers are configured and whether it offers OAuth sign-in or custom headers.
  • VS Code with GitHub Copilot — add an HTTP MCP server with the server URL, and a header if you use one. See the VS Code documentation for the MCP server configuration file and its format.
  • Claude Code — add an HTTP MCP server with the server URL, and a header if you use one. See the Claude Code documentation for the command and options.
  • An agent framework's MCP client — create a Streamable HTTP client transport with the server URL and the header. If the framework is in .NET, TypeScript, Python or Java, consider the platform's SDK instead, which also handles session recovery and correlation: see Using The SDKs.

After connecting, the client should list the tools published to the client application. If it lists none, see If the client lists no tools.

Streamable HTTP Or Legacy SSE

The Runtime serves MCP 2026-07-28 and MCP 2025-11-25 on the same endpoint, /mcp. A 2026-07-28 client sends every message as a POST, with no handshake and no session, and opens a subscriptions/listen stream for change notifications. A 2025-11-25 client uses the Streamable HTTP transport: POST for each JSON-RPC message, GET to open a server-to-client stream, and DELETE to end a session. Use this endpoint for every client that supports either; the Runtime tells them apart by the version each request declares.

The older HTTP+SSE transport of MCP 2024-11-05 is served for clients that support nothing else: the client opens GET /runtime/{tenantId}/{clientId}/sse, reads the address to post to from the first endpoint event, and posts its messages to /runtime/{tenantId}/{clientId}/messages?sessionId=…, receiving the answers on the stream.

Both transports reach the same tools, under the same governance and audit. See Transports.

A First Tool Call By Hand

The requests below are what any MCP client sends. They use curl with an API key; a bearer token works the same way with an Authorization header instead.

MCP=https://apimapper.example.com/runtime/<tenant-id>/<client-id>/mcp
AUTH="X-Api-Key: <api-key>"

Each POST lists both application/json and text/event-stream in Accept, as the specification requires. The Runtime may then answer a request as a short Server-Sent Events stream: the JSON-RPC response arrives on a line that starts with data:. The responses below show that JSON.

These use MCP 2025-11-25, which every current client speaks. For MCP 2026-07-28, see The Same Call With MCP 2026-07-28 below.

1. Initialize. The response carries a session id in the Mcp-Session-Id header; -i shows it.

curl -i -X POST "$MCP" -H "$AUTH" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize",
       "params":{"protocolVersion":"2025-11-25","capabilities":{},
                 "clientInfo":{"name":"curl","version":"1.0"}}}'

Send the session id on every later request, and announce that initialization is complete. A notification is answered 202 with no body.

SESSION="Mcp-Session-Id: <session-id>"

curl -X POST "$MCP" -H "$AUTH" -H "$SESSION" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","method":"notifications/initialized"}'

2. List the tools.

curl -X POST "$MCP" -H "$AUTH" -H "$SESSION" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "tools": [
      {
        "name": "crm-get-customer",
        "title": "get-customer",
        "description": "Returns a customer by its customer number.",
        "inputSchema": {
          "type": "object",
          "properties": { "customerNumber": { "type": "string", "description": "The customer number." } },
          "required": ["customerNumber"]
        },
        "annotations": { "readOnlyHint": true }
      }
    ]
  }
}

A tool's name is {toolset}-{endpoint}; it is the name you call it by. Its inputSchema uses the field names the administrator published for AI callers, not the downstream API's own names. When more tools remain than fit in one page, the result carries nextCursor: pass it back as params.cursor to get the next page.

3. Call a tool.

curl -X POST "$MCP" -H "$AUTH" -H "$SESSION" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "X-Correlation-Id: order-4711" \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call",
       "params":{"name":"crm-get-customer","arguments":{"customerNumber":"C-1001"}}}'
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [ { "type": "text", "text": "{\"customerNumber\":\"C-1001\",\"name\":\"Example Ltd\"}" } ],
    "structuredContent": { "customerNumber": "C-1001", "name": "Example Ltd" },
    "isError": false
  }
}

The result carries the response both as text and as structuredContent. When the downstream system answers with an error status, the call still succeeds at the protocol level: the result has isError: true and a text content naming the downstream status, so the model can read it and decide what to do. A caller that is not allowed to use the tool receives a JSON-RPC error instead. See Errors, Limits & Correlation.

The optional X-Correlation-Id header ties the call to an identifier your own system already knows; see Correlation IDs.

4. End the session when you are done. The Runtime also ends idle sessions on its own, after 30 minutes by default.

curl -X DELETE "$MCP" -H "$AUTH" -H "$SESSION"

What tools/list Returns, And How Toolset Modes Change It

Each toolset is configured with a schema discovery mode, which the administrator can override per tool. It decides how much of each tool's schema tools/list sends, trading completeness against the tokens it costs the model:

Mode What inputSchema contains What the client must do
Full The complete schema, with descriptions and formats Nothing
Data Structure Only The real field names, nesting and required flags, without descriptions; plus an optional _schema_discovery hint field Nothing for standard clients; a model may fetch the full schema first
Lazy Only a _schema_discovery placeholder Call discover_tool_schema with the tool's name before the first call

Whenever any tool uses a reduced mode, tools/list also includes the discover_tool_schema tool, which returns a tool's full input and output schema. A call to a Lazy tool whose only argument is the placeholder is refused with an instruction to discover the schema first. Lazy mode therefore needs a model or client that follows that instruction; standard MCP clients expect a real schema at discovery time and work best with the other two modes. See Schema Discovery Modes.

Tool annotations — readOnlyHint, destructiveHint, idempotentHint, openWorldHint — are set by the administrator and tell a client which tools are safe to call freely or to retry.

Toolsets with a system prompt also expose it through resources/list and resources/read, which clients attach as context automatically, and through prompts/list and prompts/get, which clients offer as slash commands. See MCP Resources vs MCP Prompts.

The Same Call With MCP 2026-07-28

There is no handshake and no session. Each request names its protocol version in params._meta and in the MCP-Protocol-Version header, and mirrors its method in Mcp-Method — and, for tools/call, the tool's name in Mcp-Name. A header that does not match the body is refused with -32020.

META='"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}'

curl -X POST "$MCP" -H "$AUTH" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "MCP-Protocol-Version: 2026-07-28" -H "Mcp-Method: tools/list" \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/list\",\"params\":{$META}}"

curl -X POST "$MCP" -H "$AUTH" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "MCP-Protocol-Version: 2026-07-28" -H "Mcp-Method: tools/call" -H "Mcp-Name: <tool-name>" \
  -d "{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/call\",\"params\":{\"name\":\"<tool-name>\",\"arguments\":{},$META}}"

Each result carries "resultType": "complete"; the tools/list result also carries ttlMs, how long it may be reused. server/discover returns the versions and capabilities the Runtime supports, if the client wants them first. See MCP 2026-07-28.

Staying Current: list_changed Notifications

When an administrator publishes, unpublishes or reassigns tools, the Runtime sends notifications/tools/list_changed to the tenant's connected clients. The notification carries no detail; a client that receives it calls tools/list again.

An MCP 2026-07-28 client receives it by opening a subscriptions/listen stream with toolsListChanged: true; the stream also carries prompt and resource list changes when asked for, and is ended by the Runtime after an hour, when the client simply opens a new one.

For MCP 2025-11-25, it is delivered only to a session with an open stream — a GET on the MCP endpoint, or a recent streamed answer still held for resumption. A client that only sends plain POST requests never receives it, and should call tools/list again at the start of each conversation instead. See Tool List Change Notifications.

Sessions

Sessions exist only in MCP 2025-11-25 and earlier; an MCP 2026-07-28 client has none, and a session header it sends is ignored. The session id returned by initialize identifies your session on every later request. A session that has idled out, been ended, or is otherwise unknown to the Runtime is answered 404: initialize again and continue. The session is bound to the tenant, client application and caller that opened it; presenting it with a different credential is treated as an unknown session.

If The Client Lists No Tools

An empty tools/list is not an error. Check, with your administrator:

  • that a toolset is assigned to the client application in the URL, and that the toolset is active and contains published tools;
  • that the tools' access policies allow your caller — its issuer, client id, roles, scopes or groups, or the claims on your API key;
  • for a client that signed its user in, that the user approved the tools:read scope.

A credential problem is never an empty list: it is a 401. See Errors, Limits & Correlation.