Protocol versions

Checked against FrontMCP 1.12.2 on

MCP 2026-07-28

A FrontMCP server speaks five MCP revisions, from 2024-11-05 to 2026-07-28, over Streamable HTTP and stdio. There's no setting to choose one: each request is served under the revision its client declares. The one exception is a stdio server with channels, which declines 2026-07-28 so that Claude Code opens a session (below). The four older revisions share one design, a session that the client opens with initialize. 2026-07-28 drops it: every request stands on its own and carries its own version and capabilities, and the server never sends a request back to the client. This page says how FrontMCP tells the two apart, and lists what 2026-07-28 changed, with a link to the page that shows each change. The Playground's client speaks 2026-07-28, so the examples on this site do too; what older clients get was checked on a Node server. Choosing a transport compares stdio, Streamable HTTP and the older HTTP+SSE, and what 2026-07-28 changed for each.

// Over HTTP, a 2026-07-28 request names its revision in a header and in the body:
//   MCP-Protocol-Version: 2026-07-28
//   { "method": "tools/list", "params": { "_meta": { "io.modelcontextprotocol/protocolVersion": "2026-07-28" } } }

@FrontMcp({ info, apps, transport: { defaultProtocolVersion: "2026-07-28" } }) // for requests that name none

Reference

Supported revisions

RevisionHow a client startsSessions
2026-07-28With any request. server/discover tells it what the server offers, if it wants to know first.None.
2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05With initialize. Over HTTP, the answer includes an Mcp-Session-Id the client sends from then on; over stdio, the connection holds the session.One per client.

server/discover lists the five in supportedVersions, newest first. initialize answers with the revision the client asked for when it's one of the older four, and with 2025-11-25 when it's one FrontMCP doesn't know. An initialize that asks for 2026-07-28 in its params, without the header or _meta below, is an older client: it gets 2025-11-25 and a session. (initialize also accepts 2024-10-07, which isn't listed.) The initialize answers were checked on a Node server.

How a request's revision is chosen

FrontMCP serves a request as 2026-07-28 when any of these is true:

  • its params have _meta["io.modelcontextprotocol/protocolVersion"], which only 2026-07-28 clients send;
  • its MCP-Protocol-Version header names a revision other than the older four: 2026-07-28, or one FrontMCP doesn't know, which gets -32022;
  • its method is server/discover or subscriptions/listen, which only 2026-07-28 has.

Otherwise the request belongs to an older revision: an initialize, a request with an Mcp-Session-Id, or one whose MCP-Protocol-Version header is one of the older four. A request that names no revision at all is served by transport.defaultProtocolVersion.

Over HTTP, a request served as 2026-07-28 because it said so must say so in both places, with the same value, and send the other mirrored headers: a missing or different one gets HTTP 400 and -32020, before anything else runs.

Legacy HTTP+SSE requests

On the Node server, GET <entryPath>/sse opens the legacy stream and names <entryPath>/message?sessionId=… for the client's posts. The message endpoint accepts any Accept value, or no header: accepted messages get 202 Accepted, and their results arrive on the SSE stream. The posts still need a valid session, and transport.protocol must enable legacy SSE. The Playground uses createFetchHandler(), which doesn't serve this transport; see Choosing a transport.

Changed in 1.10.11: before, Accept: */* or application/* on an initialize post to the message endpoint got 404, preventing the official SDK's SSEClientTransport from connecting with its default headers. See Cannot POST /mcp/message.

Streamable HTTP posts to the entry path keep their Accept rules. For clients that use initialize, send Accept: application/json, text/event-stream; */*, application/* and text/plain still aren't served there. MCP 2026-07-28 request routing is unchanged.

A stateless fetch handler, including a Worker without a Durable Object session, serves older clients' calls as POST requests. A standalone GET gets 405, JSON-RPC -32000 Method not allowed., and Allow: POST, DELETE; PUT gets the same response. Changed in 1.10.12: before, GET could open an event stream that couldn't send anything. Durable Object sessions keep their GET stream. This is separate from 2026-07-28, which already rejects GET and DELETE with 405 and Allow: POST.

Revisions over stdio

One stdio connection serves both protocol eras, unless the server has channels (below). server/discover and subscriptions/listen select 2026-07-28, as does a request with _meta["io.modelcontextprotocol/protocolVersion"]. Stdio has no HTTP headers, so the mirrored-header checks don't apply. Results carry resultType and the server's info in _meta, just as they do over HTTP.

Until the connection sends initialize, a call that names no revision follows transport.defaultProtocolVersion, which defaults to "legacy" on stdio. After initialize, calls that name no revision stay in that session, even with "2026-07-28" configured. Explicit 2026-07-28 requests still work on the same connection.

A connection that uses 2026-07-28 without initialize gets no session broadcasts. Ask for log messages and progress on each request, and use subscriptions/listen for changes. notifications/cancelled with params.requestId aborts an inline call's this.signal while its request is in flight, or ends its listen stream; closing the connection aborts requests in flight. Tasks belong to the connection that created them.

Changed in 1.10.5: before, server/discover over stdio returned -32601, and a 2026-07-28 tool call was answered as an older revision. initialize sessions keep their existing behavior. This also applies to frontmcp dev --stdio --serve. The stdio bridge of frontmcp dev --stdio without --serve, and of runShared(), speaks to an HTTP server and doesn't serve 2026-07-28: below.

A stdio server with channels declines 2026-07-28

A stdio server that serves channels, because an app lists a channel with channels: { enabled: true } or because an event has the channel option, speaks only the four older revisions to its stdio client. Every request that would be served as 2026-07-28 gets JSON-RPC error -32022, with those four in data.supported and 2026-07-28 in data.requested: server/discover, subscriptions/listen, a request with the revision in _meta, and a request that names no revision when transport.defaultProtocolVersion is "2026-07-28". A 2026-07-28 notification is ignored. A client that speaks both eras then sends initialize, and the connection is a session:

{"jsonrpc":"2.0","id":"probe","method":"server/discover"}
{"jsonrpc":"2.0","id":"probe","error":{"code":-32022,"message":"Unsupported protocol version: 2026-07-28","data":{"supported":["2025-11-25","2025-06-18","2025-03-26","2024-11-05"],"requested":"2026-07-28"}}}

The reason is Claude Code. Its documentation says that it asks a stdio server for 2026-07-28 first, and that it doesn't register as a channel a server that negotiates that revision: see Channels in Claude Code. A FrontMCP server answered that probe, so its channels reached no Claude Code session.

Changed in 1.12.0: before, a stdio server with channels served 2026-07-28 like any other. Over HTTP nothing changed: the same server serves all five revisions there, and server/discover lists them. A stdio server with channels: { enabled: true } and no channel, and no event with the channel option, still serves 2026-07-28. Each of these was run on 1.12.0-rc.1, on a server started with runStdio(); that a notification is ignored is from the framework's source.

The stdio bridge

frontmcp dev --stdio without --serve, and a session of runShared(), don't serve stdio themselves: a bridge sends each message of the stdio client to an HTTP server, in a session. It doesn't send the headers 2026-07-28 needs over HTTP, so a 2026-07-28 request doesn't get through:

The server behind the bridgeA 2026-07-28 request from the stdio client gets
Has channels-32022 from the bridge, with the server's earlier revisions in data.supported, as from a stdio server with channels. The client falls back to initialize. Changed in 1.12.0: before, it got -32099, like the row below.
Has no channels-32099 dev_server_unreachable, with data.reason: "forward_failed", as before. initialize works.

So a client that only speaks 2026-07-28 can't use the bridge. For a server without channels, give it frontmcp dev --stdio --serve or a runStdio() server; a server with channels serves that revision over HTTP only. Both rows were run on 1.12.0-rc.1, through frontmcp dev --stdio and through a runShared() session. Through the stdio bridge describes what else the bridge does for channels.

Internal protocol imports

FrontMCP uses @frontmcp/protocol internally for the underlying SDK's types, schemas and server transports, and @frontmcp/protocol/client for its client and client transports. Changed in 1.10.10: before, the root also exported the client APIs. Neither path is an application API: import MCP types from @frontmcp/sdk, and use McpClient from @frontmcp/testing for a raw test client. This import change does not change the supported revisions or their request formats.

transport.defaultProtocolVersion

A request names no revision when it has no MCP-Protocol-Version header, no _meta version and no Mcp-Session-Id, and isn't an initialize: a bare JSON-RPC call. transport.defaultProtocolVersion decides how to serve it:

ValueA request that names no revision
"2026-07-28"Served as 2026-07-28. The mirrored headers aren't required, since the client never agreed to send them, but one it does send must match the body.
"legacy"Served as an older revision. FrontMCP's Node HTTP server wants a session first, and answers -32600 Session not initialized — send `initialize` first. Behind createFetchHandler(), which keeps no sessions, the call is answered on its own, as an event stream.

The default depends on how the server is served: "legacy" on FrontMCP's Node HTTP server and on stdio, and "2026-07-28" behind createFetchHandler(): Cloudflare Workers, Deno, Bun, and the Playground. On stdio the setting applies only until initialize; it does not change the routing of explicitly versioned requests. A stdio server with channels declines 2026-07-28 whatever the setting says: with "2026-07-28", a request that names no revision gets -32022 until the client sends initialize. The HTTP defaults were checked on Node; Serving requests that name no revision shows the second.

What 2026-07-28 changed

What changedWhat FrontMCP doesShown on
No sessions, no initialize. Each request carries the client's version, clientInfo and clientCapabilities in _meta, and a capability counts only on the request that declares it.initialize and ping get 404 and -32601 Method not found: initialize was removed in protocol 2026-07-28. An anonymous caller is a new caller on every request.Sessions, A server anyone can call
server/discover tells a client the revisions, capabilities and instructions, as initialize did.Lists the tasks extension, whether or not a tool runs as a task. Instructions include the compact skills line by default; skillsConfig.injectInstructions selects a catalog instead.What server/discover returns
Mirrored HTTP headers. MCP-Protocol-Version, Mcp-Method, Mcp-Name, and Mcp-Param-<name> for arguments marked x-mcp-header, so a proxy can route without reading the body.Checked against the body before anything else runs: -32020 when one is missing or different.Request headers, Header parameters
Every result says what it is, in resultType: complete, input_required or task.Every result also carries the server's info in _meta["io.modelcontextprotocol/serverInfo"]. Lists, reads and server/discover carry ttlMs and cacheScope, how long and how widely a client may cache them: 60 seconds for tools/list, 0 for resources/read.What server/discover returns
No requests from the server. Elicitation, sampling and roots become an input_required result, which the client answers by sending its request again.The tool runs again from the top with the answer. requestState is signed with VAULT_SECRET (or JWT_SECRET), so every instance needs the same one.How an elicitation travels, this.sample(), High availability
Notifications belong to a request. A client asks for log messages and progress on the request itself, with io.modelcontextprotocol/logLevel and a progressToken; logging/setLevel is gone.Over HTTP the answer is an event stream; over stdio it is JSON lines. Both send the requested notifications before the result. A request that doesn't ask gets no log messages.Asking for log messages, Asking for progress
subscriptions/listen replaces the GET stream and resources/subscribe.A stream that starts with what the server will send.Listening for changes, Channels
Tasks are an extension, io.modelcontextprotocol/tasks, without tasks/result and tasks/list, and with tasks/update.Over HTTP, only signed-in callers can start a task. Over stdio, the connection owns its tasks.Background tasks
Trace context in _meta. A client may send traceparent and tracestate in a request's _meta.Copied to the result's _meta. Only the traceparent header joins the server's trace.Joining a trace
New error codes. -32020, -32021 and -32022; a missing resource is -32602 (it was -32002). GET and DELETE on the endpoint get 405.As the protocol says.Error codes

Caveats

  • frontmcp test defaults to an older revision. Set test.use({ protocolVersion: "2026-07-28" }) to use the Playground's revision. New in 1.11.3: the testing client supports 2026-07-28 and mcp.discover() on every revision. See Testing.
  • A stdio server with channels doesn't serve 2026-07-28. Its stdio client gets -32022 and uses initialize. HTTP clients of the same server aren't affected. Changed in 1.12.0: before, it served that revision over stdio too. See above.
  • A remote app speaks the older revision to its server unless you set transportOptions.protocolVersion: see Talking to a 2026-07-28 server.
  • Malformed method parameters differ by revision. Under 2026-07-28, a request that fails its handler's request schema gets -32602 with Invalid params: <field>: <problem>, before the handler runs. inputResponses, when present, must be an object whose values are objects. Bad tool arguments still produce a tool result with isError: true and INVALID_INPUT. On the older path, the underlying MCP SDK can instead answer a malformed request with -32603 and raw Zod issues. The example below shows the 2026-07-28 responses.

This schema check covers shared MCP handlers, including tools/call, prompts/get and resources/read. server/discover and tasks-extension methods use separate dispatch paths.


Usage

Asking which revisions a server speaks

A client that wants to know before it calls anything sends server/discover. The tests also send a revision FrontMCP doesn't know, and a request whose header and body disagree:

Open
import { test, expect } from "@frontmcp/testing";
import { FrontMcpInstance } from "@frontmcp/sdk";
import { config } from "./main";

test("server/discover lists every revision the server speaks", async ({ mcp }) => {
  const { result } = (await mcp.raw.request({ jsonrpc: "2.0", id: 1, method: "server/discover" })) as any;
  expect(result.supportedVersions).toEqual(["2026-07-28", "2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"]);
});

test("a revision FrontMCP doesn't know: 400 and -32022, with the ones it does", async () => {
  const server = await FrontMcpInstance.createFetchHandler(config);
  const response = await server(listTools("2099-01-01", "2099-01-01"));
  expect(response.status).toBe(400);
  expect((await response.json()).error).toEqual({
    code: -32022,
    message: "Unsupported protocol version: 2099-01-01",
    data: { supported: ["2026-07-28", "2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"], requested: "2099-01-01" },
  });
});

test("a header and a body that disagree: 400 and -32020", async () => {
  const server = await FrontMcpInstance.createFetchHandler(config);
  const response = await server(listTools("2026-07-28", "2025-11-25"));
  expect(response.status).toBe(400);
  expect((await response.json()).error).toEqual({
    code: -32020,
    message: "Header mismatch: mcp-protocol-version header value '2026-07-28' does not match body value '2025-11-25'",
  });
});

/** A tools/list that names one revision in its header and another in its body. */
function listTools(header: string, body: string) {
  return new Request("https://desk.example.com/", {
    method: "POST",
    headers: { "content-type": "application/json", "mcp-protocol-version": header, "mcp-method": "tools/list" },
    body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/list", params: { _meta: { "io.modelcontextprotocol/protocolVersion": body } } }),
  });
}

Starting FrontMCP in your browser…

FrontMCP starts when this example comes into view.

Changed in 1.9.5: initialize answers with one of the four older revisions above. A client that asks for one FrontMCP doesn't speak, like 2024-10-07, gets 2025-11-25; before, it got 2024-10-07 back.

An older client doesn't send server/discover. It asks for a revision in initialize, and reads the one it got from the answer's protocolVersion.

Rejecting malformed requests

A client can send a valid JSON-RPC envelope whose parameters don't fit the method: a tools/call without name, for example. Under MCP 2026-07-28, FrontMCP answers it with HTTP 200 and JSON-RPC -32602, naming the invalid field. It logs no internal error and doesn't run the tool. An inputResponses value that isn't an object of objects is rejected the same way:

Open
import { test, expect } from "@frontmcp/testing";
import { FrontMcpInstance } from "@frontmcp/sdk";
import { config, runs } from "./main";

const handler = FrontMcpInstance.createFetchHandler(config);

async function call(params: Record<string, unknown>) {
  const response = await (await handler)(new Request("https://desk.example.com/", {
    method: "POST",
    headers: {
      "content-type": "application/json",
      "mcp-protocol-version": "2026-07-28",
      "mcp-method": "tools/call",
      ...(typeof params.name === "string" ? { "mcp-name": params.name } : {}),
    },
    body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "tools/call", params: {
      ...params, _meta: { "io.modelcontextprotocol/protocolVersion": "2026-07-28" },
    } }),
  }));
  expect(response.status).toBe(200);
  return response.json();
}

test("a missing tool name gets Invalid params", async () => {
  const response = await call({ arguments: {} });
  expect(response.error).toEqual({
    code: -32602,
    message: "Invalid params: params.name: Invalid input: expected string, received undefined",
  });
  expect(response.result).toBeUndefined();
});

test("malformed inputResponses is rejected before the tool runs", async () => {
  const before = runs.count;
  for (const inputResponses of ["invalid", { confirm: "yes" }]) {
    const response = await call({ name: "search_tickets", arguments: { query: "log" }, inputResponses });
    expect(response.error.code).toBe(-32602);
    expect(response.error.message).toContain("Invalid params: params.inputResponses");
    expect(response.result).toBeUndefined();
  }
  expect(runs.count).toBe(before);
});

test("well-formed inputResponses lets the tool run", async () => {
  const before = runs.count;
  const response = await call({ name: "search_tickets", arguments: { query: "log" }, inputResponses: { confirm: { action: "accept", content: {} } } });
  expect(response.error).toBeUndefined();
  expect(response.result.structuredContent).toEqual({ query: "log", tickets: [] });
  expect(runs.count).toBe(before + 1);
});

test("bad tool arguments are still an INVALID_INPUT tool result", async () => {
  const before = runs.count;
  const response = await call({ name: "search_tickets", arguments: { query: 42 } });
  expect(response.error).toBeUndefined();
  expect(response.result).toMatchObject({ isError: true, _meta: { code: "INVALID_INPUT" } });
  expect(runs.count).toBe(before);
});

Starting FrontMCP in your browser…

FrontMCP starts when this example comes into view.

Changed in 1.10.13: before, a tools/call without name could return a successful result containing a raw ZodError and stack, with an internal error logged. Malformed inputResponses could reach the tool. These requests now fail before the handler runs. A well-formed inputResponses object passes this shape check; answering an actual input_required result also needs its matching requestState.

Calling over stdio

Send one JSON object per line, without HTTP headers or an initialize handshake:

{"jsonrpc":"2.0","id":1,"method":"server/discover"}
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"search_tickets","arguments":{"query":"log"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"desk-client","version":"1.0.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}

The first answer lists the five revisions in result.supportedVersions. The second has result.resultType: "complete" and the tool's result. A server with channels answers both with -32022 instead: send it initialize first, and call the tool without _meta. A tool that asks a question returns input_required; the client answers by retrying the call, as over HTTP. A missing capability gets -32021, and an unsupported revision gets -32022.

Serving requests that name no revision

Some clients and scripts send plain JSON-RPC, with no header, no _meta and no session. Behind createFetchHandler(), as here, such a request is served as 2026-07-28, and the headers it doesn't send aren't required:

Open
import { test, expect } from "@frontmcp/testing";
import { FrontMcpInstance } from "@frontmcp/sdk";
import { config } from "./main";

const call = { jsonrpc: "2.0", id: 1, method: "tools/call", params: { name: "search_tickets", arguments: { query: "log" } } };
const post = (headers: Record<string, string>) =>
  new Request("https://desk.example.com/", { method: "POST", headers: { "content-type": "application/json", ...headers }, body: JSON.stringify(call) });

test("a bare call is served as 2026-07-28", async () => {
  const server = await FrontMcpInstance.createFetchHandler(config);
  const response = await server(post({}));
  expect(response.status).toBe(200);
  expect((await response.json()).result).toMatchObject({ resultType: "complete", structuredContent: { query: "log", tickets: [] } });
});

test("a header it does send must still match the body", async () => {
  const server = await FrontMcpInstance.createFetchHandler(config);
  const response = await server(post({ "mcp-name": "close_ticket" }));
  expect(response.status).toBe(400);
  expect((await response.json()).error.message).toBe("Header mismatch: mcp-name header value 'close_ticket' does not match body value 'search_tickets'");
});

Starting FrontMCP in your browser…

FrontMCP starts when this example comes into view.

FrontMCP's Node server answers the same bare call with -32600 Session not initialized — send `initialize` first, because it defaults to "legacy". To serve such clients there, set the default:

main.ts
@FrontMcp({
  info: { name: "help-desk", version: "1.0.0" },
  apps: [HelpDeskApp],
  transport: { defaultProtocolVersion: "2026-07-28" },
})
export default class Server {}

With it, the Node server answered the bare call as above, and initialize still opened a session for older clients. This was checked on a Node server.

Listening for changes

A 2026-07-28 client has no session to subscribe with, so it sends subscriptions/listen, naming the notifications it wants, and keeps reading the answer: an HTTP event stream, or JSON lines on stdio, that stays open. (A stdio server with channels declines it, like every 2026-07-28 request.) Its first message, notifications/subscriptions/acknowledged, repeats the request's list without what the server can't send. Changed in 1.11.0: before, the acknowledgment did not filter resource URIs by subscription access. Resource URIs are now acknowledged only when the caller can subscribe, and access is checked again before an update is sent:

Open
import { test, expect } from "@frontmcp/testing";
import { FrontMcpInstance } from "@frontmcp/sdk";
import { config } from "./main";

test("the stream starts by saying what it will carry", async () => {
  const server = await FrontMcpInstance.createFetchHandler(config);
  const wanted = { toolsListChanged: true, promptsListChanged: true, resourcesListChanged: true, resourceSubscriptions: ["desk://queue"] };
  const response = await server(listen(wanted));
  expect(response.headers.get("content-type")).toContain("text/event-stream");

  const stream = response.body!.getReader();
  expect(await nextMessage(stream)).toEqual({
    jsonrpc: "2.0",
    method: "notifications/subscriptions/acknowledged",
    params: {
      // No promptsListChanged: the server has no prompts.
      notifications: { toolsListChanged: true, resourcesListChanged: true, resourceSubscriptions: ["desk://queue"] },
      _meta: { "io.modelcontextprotocol/subscriptionId": 7 },
    },
  });
  void stream.cancel(); // the client goes away
});

function listen(notifications: Record<string, unknown>) {
  return new Request("https://desk.example.com/", {
    method: "POST",
    headers: { "content-type": "application/json", accept: "text/event-stream", "mcp-protocol-version": "2026-07-28", "mcp-method": "subscriptions/listen" },
    body: JSON.stringify({
      jsonrpc: "2.0",
      id: 7,
      method: "subscriptions/listen",
      params: { notifications, _meta: { "io.modelcontextprotocol/protocolVersion": "2026-07-28" } },
    }),
  });
}

// The next message on the stream, or null when none comes within 200 ms.
async function nextMessage(stream: ReadableStreamDefaultReader<Uint8Array>) {
  const chunk = await Promise.race([stream.read(), new Promise<null>((resolve) => setTimeout(() => resolve(null), 200))]);
  if (!chunk || chunk.done) return null;
  const data = new TextDecoder().decode(chunk.value).split("\n").find((line) => line.startsWith("data: "));
  return data ? JSON.parse(data.slice("data: ".length)) : null;
}

Starting FrontMCP in your browser…

FrontMCP starts when this example comes into view.

Every message on the stream carries the request's id as _meta["io.modelcontextprotocol/subscriptionId"]. The stream carries a list change when the server's own list of tools, prompts or resources changes, and channel events to a client that asks for them. A resource's own this.notifyUpdated() reaches it, as notifications/resources/updated to the streams that listed its URI, and so does a tool's this.notifyResourceUpdated(uri), which takes the same path. Changed in 1.9.5: before, a tool's this.notifyResourceUpdated(uri) went only to older clients' sessions. The resource's notification was checked on Node.

Calling a 2026-07-28 server from code

FrontMCP has a 2026-07-28 client of its own, McpStatelessClient from @frontmcp/sdk (the MCP SDK's 1.x client, which FrontMCP builds on, stops at 2025-11-25: see the comparison). It sends the headers and _meta on every request, answers input_required results with its handlers and sends the request again, and polls tasks to the end:

Open
import { test, expect } from "@frontmcp/testing";
import { FrontMcpInstance, McpStatelessClient } from "@frontmcp/sdk";
import { config } from "./main";

async function connect(options: Partial<ConstructorParameters<typeof McpStatelessClient>[0]> = {}) {
  const server = await FrontMcpInstance.createFetchHandler(config);
  return new McpStatelessClient({
    url: "https://desk.example.com/",
    // Hands each request to the server above, so this runs here. A real client leaves it out.
    fetchImpl: (url, init) => server(new Request(url, init)),
    ...options,
  });
}

test("discover() and listTools()", async () => {
  const desk = await connect();
  expect((await desk.discover()).supportedVersions).toContain("2026-07-28");
  expect((await desk.listTools()).map((tool) => tool.name)).toEqual(["close_ticket"]);
});

test("callTool() answers the tool's question, and resolves with the result", async () => {
  const asked: unknown[] = [];
  const desk = await connect({
    capabilities: { elicitation: { form: {} } },
    handlers: {
      onElicit: async (params) => {
        asked.push(params.message);
        return { action: "accept", content: { confirm: true } };
      },
    },
  });
  const result = await desk.callTool("close_ticket", { id: "T-1" });
  expect(asked).toEqual(["Close ticket T-1?"]);
  expect(result.structuredContent).toEqual({ id: "T-1", status: "closed" });
});

test("without the elicitation capability, the call fails with -32021", async () => {
  const desk = await connect();
  await expect(desk.callTool("close_ticket", { id: "T-1" })).rejects.toMatchObject({
    name: "McpStatelessError",
    code: -32021,
    message: "This request requires the `elicitation` client capability",
  });
});

Starting FrontMCP in your browser…

FrontMCP starts when this example comes into view.

OptionDescription
urlRequired. The server's MCP endpoint.
capabilitiesSent on every request, like { elicitation: { form: {} } } or { extensions: { "io.modelcontextprotocol/tasks": {} } }. Defaults to none.
headersSent on every request, like Authorization.
clientInfo{ name, version }. Defaults to frontmcp-20260728-client.
handlersonElicit, onSample and onListRoots: how to answer what a tool asks. A request with no handler fails with Server requested elicitation but no handler is configured.
logLevel, onNotificationlogLevel asks for log messages on every request; onNotification receives each notification that arrives before a result.
maxInputRoundsHow many times a tool may ask before the call fails with Server kept requesting input after 8 rounds. Defaults to 8.
requestTimeoutMsHow long to wait for an answer to one request.
fetchImplThe fetch to send with. Defaults to the global one.

Besides discover(), listTools() and callTool(), it has readResource(), listResources(), listResourceTemplates(), listPrompts(), getPrompt(), cancelTask(taskId), listen(notifications, onNotification) for subscriptions/listen, and request(method, params). Errors are McpStatelessErrors, with the JSON-RPC code. A tool that fails returns a result with isError: true, as with any client.

Serving clients on older revisions

Nothing has to be set: an older client opens a session with initialize on the same endpoint, and every request it sends with its Mcp-Session-Id is served as before. Which older transports it may use, Streamable HTTP or the old SSE one, is transport.protocol; sessions need MCP_SESSION_SECRET in production. A few things differ for these clients, each on its page:

FeatureBefore 2026-07-28
Asking the userFrontMCP sends elicitation/create to the client, and this.elicit() waits for the answer. A client that can't show forms gets a sendElicitationResult tool: see this.elicit.
Log messagesThe client sets a level with logging/setLevel: see this.notify.
Resource changesresources/subscribe, and notifications/resources/updated to the subscribed sessions: see Telling clients a resource changed.
Taskstask in the call, tasks/result, tasks/list, and status notifications: see Clients on older protocol versions.
Anonymous callersOne caller for the whole session, so a task it starts can be read back.
Behind createFetchHandler()No session is kept: see Serving clients on older protocol versions.

Troubleshooting

Invalid params: params.name: Invalid input: expected string, received undefined

A 2026-07-28 tools/call has no name. Send the registered tool name as params.name. A malformed request gets JSON-RPC -32602; a valid request with arguments that fail the tool's schema gets an INVALID_INPUT tool result instead. See Rejecting malformed requests.

Invalid params: params.inputResponses: …

inputResponses must be an object keyed by input request id, with an object for each answer. A string at either level gets -32602 before the tool runs; an invalid answer value names its path, such as params.inputResponses.confirm. See How an elicitation travels for a complete retry.

Method not found for server/discover over stdio

Changed in 1.10.5: before, the stdio server returned -32601 for server/discover. Upgrade the server. When reloading it, use frontmcp dev --stdio --serve. runStdio() and built servers started with --stdio serve discovery without initialize.

Unsupported protocol version: …

HTTP 400 with JSON-RPC error -32022. The request's MCP-Protocol-Version header or _meta["io.modelcontextprotocol/protocolVersion"] names a revision FrontMCP doesn't speak; data.supported lists the ones it does. The first example's second test gets it. Send one of those, or upgrade the server when a newer one is what the client needs. Over stdio, the same request gets JSON-RPC error -32022, without an HTTP status.

Unsupported protocol version: 2026-07-28 comes from a stdio server with channels, or from the stdio bridge in front of one: it declines the revision so that its client opens a session. Send initialize. Changed in 1.12.0: before, a stdio server with channels served that revision, and the bridge answered -32099.

Header mismatch: mcp-protocol-version header value '…' does not match body value '…'

HTTP 400 with -32020. The header and _meta["io.modelcontextprotocol/protocolVersion"] name different revisions. They must be the same. Other mismatches, and missing headers, are in createFetchHandler()'s troubleshooting.

Method not found: initialize was removed in protocol 2026-07-28

HTTP 404 with -32601. The client sent initialize with a 2026-07-28 header or _meta, so FrontMCP served it as 2026-07-28, which has no initialize. A 2026-07-28 client starts with any request, or server/discover; an older client must not send the 2026-07-28 header. The same goes for ping, logging/setLevel, resources/subscribe, tasks/result and tasks/list.

Session not initialized — send `initialize` first

JSON-RPC error -32600 from FrontMCP's Node server. The request named no revision and carried no session, and the server defaults to "legacy". Have the client declare 2026-07-28 with the header and _meta, or set transport: { defaultProtocolVersion: "2026-07-28" }.

Report a docs issue · Report a security concern privately