@modelcontextprotocol/server-everything 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +35 -20
  2. package/dist/docs/architecture.md +6 -5
  3. package/dist/docs/extension.md +5 -3
  4. package/dist/docs/features.md +65 -71
  5. package/dist/docs/how-it-works.md +31 -16
  6. package/dist/docs/instructions.md +14 -7
  7. package/dist/docs/startup.md +28 -33
  8. package/dist/docs/structure.md +63 -29
  9. package/dist/prompts/args.js +2 -2
  10. package/dist/prompts/completions.js +3 -3
  11. package/dist/prompts/resource.js +3 -2
  12. package/dist/resources/files.js +9 -1
  13. package/dist/resources/index.js +7 -2
  14. package/dist/resources/minted.js +119 -0
  15. package/dist/resources/subscriptions.js +44 -122
  16. package/dist/resources/templates.js +5 -4
  17. package/dist/server/context.js +47 -0
  18. package/dist/server/index.js +113 -55
  19. package/dist/server/logging.js +39 -66
  20. package/dist/server/roots.js +41 -62
  21. package/dist/server/tasks.js +295 -0
  22. package/dist/tools/get-header-params.js +95 -0
  23. package/dist/tools/get-roots-list.js +49 -50
  24. package/dist/tools/gzip-file-as-resource.js +24 -5
  25. package/dist/tools/index.js +72 -14
  26. package/dist/tools/simulate-research-query.js +166 -201
  27. package/dist/tools/toggle-simulated-logging.js +33 -20
  28. package/dist/tools/toggle-subscriber-updates.js +33 -23
  29. package/dist/tools/trigger-elicitation-request-async.js +99 -204
  30. package/dist/tools/trigger-elicitation-request.js +197 -196
  31. package/dist/tools/trigger-list-changed.js +57 -0
  32. package/dist/tools/trigger-log-messages.js +60 -0
  33. package/dist/tools/trigger-long-running-operation.js +3 -3
  34. package/dist/tools/trigger-multi-step-elicitation.js +125 -0
  35. package/dist/tools/trigger-resource-update.js +52 -0
  36. package/dist/tools/trigger-sampling-request-async.js +79 -143
  37. package/dist/tools/trigger-sampling-request.js +51 -45
  38. package/dist/tools/trigger-url-elicitation.js +148 -111
  39. package/dist/transports/sse.js +11 -2
  40. package/dist/transports/stdio.js +42 -22
  41. package/dist/transports/streamableHttp.js +96 -10
  42. package/package.json +10 -3
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # Everything MCP Server
2
+
2
3
  **[Architecture](docs/architecture.md)
3
4
  | [Project Structure](docs/structure.md)
4
5
  | [Startup Process](docs/startup.md)
@@ -6,13 +7,25 @@
6
7
  | [Extension Points](docs/extension.md)
7
8
  | [How It Works](docs/how-it-works.md)**
8
9
 
9
-
10
10
  This MCP server attempts to exercise all the features of the MCP protocol. It is not intended to be a useful server, but rather a test server for builders of MCP clients. It implements prompts, tools, resources, sampling, and more to showcase MCP capabilities.
11
11
 
12
12
  ## Tools, Resources, Prompts, and Other Features
13
13
 
14
14
  A complete list of the registered MCP primitives and other protocol features demonstrated can be found in the [Server Features](docs/features.md) document.
15
15
 
16
+ ## Protocol versions
17
+
18
+ The server serves both protocol eras, over stdio and Streamable HTTP, from one process:
19
+
20
+ - **2026-07-28** clients connect with `server/discover`, send their protocol version, identity and capabilities with each request, and have no session. The server demonstrates the revision's new features for them: multi-round-trip requests (`input_required`) with `requestState`, `subscriptions/listen` change notifications, per-request log levels, cache hints (`ttlMs` / `cacheScope`), the tasks extension (`io.modelcontextprotocol/tasks`) under the `extensions` capability, and `x-mcp-header` with JSON Schema 2020-12 tool schemas.
21
+ - **2025-era** clients connect with the `initialize` handshake, as before. Elicitation, sampling and roots are served to them from the same multi-round-trip handlers through the SDK's legacy shim.
22
+
23
+ Roots, sampling and logging are deprecated as of 2026-07-28 and stay available, labelled deprecated. [Server Features](docs/features.md) marks which era each feature belongs to.
24
+
25
+ ## Requirements
26
+
27
+ Node.js 24 or later, when the server runs through `npx` or from source.
28
+
16
29
  ## Usage with Claude Desktop (uses [stdio Transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#stdio))
17
30
 
18
31
  Add to your `claude_desktop_config.json`:
@@ -22,10 +35,7 @@ Add to your `claude_desktop_config.json`:
22
35
  "mcpServers": {
23
36
  "everything": {
24
37
  "command": "npx",
25
- "args": [
26
- "-y",
27
- "@modelcontextprotocol/server-everything"
28
- ]
38
+ "args": ["-y", "@modelcontextprotocol/server-everything"]
29
39
  }
30
40
  }
31
41
  }
@@ -38,12 +48,7 @@ On Windows, use `cmd /c` to launch `npx`:
38
48
  "mcpServers": {
39
49
  "everything": {
40
50
  "command": "cmd",
41
- "args": [
42
- "/c",
43
- "npx",
44
- "-y",
45
- "@modelcontextprotocol/server-everything"
46
- ]
51
+ "args": ["/c", "npx", "-y", "@modelcontextprotocol/server-everything"]
47
52
  }
48
53
  }
49
54
  }
@@ -93,46 +98,56 @@ On Windows, use:
93
98
  }
94
99
  ```
95
100
 
96
- ## Running from source with [HTTP+SSE Transport](https://modelcontextprotocol.io/specification/2024-11-05/basic/transports#http-with-sse) (deprecated as of [2025-03-26](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports))
101
+ ## Run from source with [Streamable HTTP Transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http)
97
102
 
98
103
  ```shell
99
104
  cd src/everything
100
105
  npm install
101
- npm run start:sse
106
+ npm run start:streamableHttp
102
107
  ```
103
108
 
104
- ## Run from source with [Streamable HTTP Transport](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http)
109
+ The endpoint is `http://localhost:3001/mcp` (`PORT` overrides the port). It serves 2026-07-28 clients statelessly and 2025-era clients with sessions, from the same URL.
110
+
111
+ ## Running from source with [HTTP+SSE Transport](https://modelcontextprotocol.io/specification/2024-11-05/basic/transports#http-with-sse) (deprecated as of [2025-03-26](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports))
105
112
 
106
113
  ```shell
107
114
  cd src/everything
108
115
  npm install
109
- npm run start:streamableHttp
116
+ npm run start:sse
110
117
  ```
111
118
 
119
+ The HTTP+SSE transport serves 2025-era clients only, and the server prints a deprecation warning when it starts. Prefer Streamable HTTP.
120
+
112
121
  ## Running as an installed package
113
- ### Install
122
+
123
+ ### Install
124
+
114
125
  ```shell
115
126
  npm install -g @modelcontextprotocol/server-everything@latest
116
127
  ```
117
128
 
118
129
  ### Run the default (stdio) server
130
+
119
131
  ```shell
120
132
  npx @modelcontextprotocol/server-everything
121
133
  ```
122
134
 
123
135
  ### Or specify stdio explicitly
136
+
124
137
  ```shell
125
138
  npx @modelcontextprotocol/server-everything stdio
126
139
  ```
127
140
 
128
- ### Run the SSE server
141
+ ### Run the streamable HTTP server
142
+
129
143
  ```shell
130
- npx @modelcontextprotocol/server-everything sse
144
+ npx @modelcontextprotocol/server-everything streamableHttp
131
145
  ```
132
146
 
133
- ### Run the streamable HTTP server
147
+ ### Run the SSE server (deprecated, 2025-era clients only)
148
+
134
149
  ```shell
135
- npx @modelcontextprotocol/server-everything streamableHttp
150
+ npx @modelcontextprotocol/server-everything sse
136
151
  ```
137
152
 
138
153
  ## License
@@ -14,18 +14,19 @@ It explains how the server starts, how transports are wired, where tools, prompt
14
14
 
15
15
  ### Purpose
16
16
 
17
- A minimal, modular MCP server showcasing core Model Context Protocol features. It exposes simple tools, prompts, and resources, and can be run over multiple transports (STDIO, SSE, and Streamable HTTP).
17
+ A minimal, modular MCP server showcasing core Model Context Protocol features. It exposes simple tools, prompts, and resources, and can be run over multiple transports (STDIO, Streamable HTTP, and the deprecated HTTP+SSE). It serves both protocol eras: 2026-07-28 clients (`server/discover`, per-request `_meta`, no sessions) and 2025-era clients (`initialize`), from one server factory.
18
18
 
19
19
  ### Design
20
20
 
21
- A small “server factory” constructs the MCP server and registers features.
22
- Transports are separate entry points that create/connect the server and handle network concerns.
21
+ A small “server factory” constructs the MCP server for a protocol era and registers features.
22
+ Transports are separate entry points that serve the factory and handle network concerns: the SDK's `serveStdio` and `createMcpHandler` entries pick each client's era.
23
23
  Tools, prompts, and resources are organized in their own submodules.
24
24
 
25
25
  ### Multi‑client
26
26
 
27
- The server supports multiple concurrent clients. Tracking per session data is demonstrated with
28
- resource subscriptions and simulated logging.
27
+ The server supports multiple concurrent clients. Per-connection state (resource subscriptions,
28
+ simulated logging) lives on the server instance serving the connection, and state that must outlive
29
+ a 2026-07-28 request (tasks, minted resources) is stored under handles the server mints.
29
30
 
30
31
  ## Build and Distribution
31
32
 
@@ -9,8 +9,10 @@
9
9
 
10
10
  ## Adding Tools
11
11
 
12
- - Create a new file under `tools/` with your `registerXTool(server)` function that registers the tool via `server.registerTool(...)`.
13
- - Export and call it from `tools/index.ts` inside `registerTools(server)`.
12
+ - Create a new file under `tools/` with your `registerXTool(server)` function that registers the tool via `server.registerTool(...)`. Take the `context` (`server/context.ts`) as a second argument if the tool needs the protocol era, the change publisher, or state that lives as long as the connection.
13
+ - Export and call it from `tools/index.ts`, in the function for the eras that get it: `registerTools(server, context)` for both, `registerModernTools` for 2026-07-28 only, `registerLegacyTools` or `registerConditionalTools` (capability-gated) for the 2025 era only.
14
+ - Never keep state in a module-level map keyed by session id: the 2026-07-28 protocol has no sessions, and its HTTP path builds a fresh server per request. Keep per-connection state in the registration closure, and state that must outlive a request under a handle the server mints (as `server/tasks.ts` and `resources/minted.ts` do).
15
+ - For client input (elicitation, sampling, roots), return `inputRequired(...)` from the handler rather than sending a request; the SDK's legacy shim serves the same handler to 2025-era clients.
14
16
 
15
17
  ## Adding Prompts
16
18
 
@@ -20,4 +22,4 @@
20
22
  ## Adding Resources
21
23
 
22
24
  - Create a new file under `resources/` with your `registerXResources(server)` function using `server.registerResource(...)` (optionally with `ResourceTemplate`).
23
- - Export and call it from `resources/index.ts` inside `registerResources(server)`.
25
+ - Export and call it from `resources/index.ts` inside `registerResources(server, context)`.
@@ -7,27 +7,54 @@
7
7
  | [Extension Points](extension.md)
8
8
  | [How It Works](how-it-works.md)**
9
9
 
10
+ ## Protocol eras
11
+
12
+ The server serves two protocol eras from one process, over stdio and over Streamable HTTP. A client's first message picks its era:
13
+
14
+ - **2026-07-28** (`modern`): the client opens with `server/discover`, with no `initialize` and no session, and sends its protocol version, identity and capabilities in each request's `_meta`.
15
+ - **2025-era** (`legacy`, 2024-10-07 through 2025-11-25): the client opens with the `initialize` handshake. The HTTP+SSE transport serves this era only.
16
+
17
+ Each feature below is marked **both**, **2026-07-28** or **2025-era**. Roots, sampling and logging are deprecated as of 2026-07-28 (SEP-2577), as is the HTTP+SSE transport; they stay available and are labelled deprecated in their descriptions.
18
+
19
+ | Feature | 2026-07-28 | 2025-era |
20
+ | ------------------------------------------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
21
+ | Discovery | `server/discover` | `initialize` |
22
+ | Client input (elicitation, sampling, roots) | in-band: the tool returns `input_required`, the client retries | the SDK's legacy shim sends real server-to-client requests for the same handler |
23
+ | State across rounds | `requestState`, signed and expiring | the same, replayed by the shim |
24
+ | Change notifications | on a `subscriptions/listen` stream the client opened | unsolicited, or after `resources/subscribe` |
25
+ | Log level | per request, `_meta` `io.modelcontextprotocol/logLevel` (none named: no logs) | per session, `logging/setLevel` |
26
+ | Tasks | the `io.modelcontextprotocol/tasks` extension | not served |
27
+ | Cache hints | `ttlMs` / `cacheScope` on lists, reads and `server/discover` | not sent |
28
+ | `x-mcp-header` | mirrored into `Mcp-Param-*` headers over Streamable HTTP | not mirrored |
29
+
10
30
  ## Tools
11
31
 
12
- - `echo` (tools/echo.ts): Echoes the provided `message: string`. Uses Zod to validate inputs.
13
- - `get-annotated-message` (tools/get-annotated-message.ts): Returns a `text` message annotated with `priority` and `audience` based on `messageType` (`error`, `success`, or `debug`); can optionally include an annotated `image`.
14
- - `get-env` (tools/get-env.ts): Returns all environment variables from the running process as pretty-printed JSON text.
15
- - `get-resource-links` (tools/get-resource-links.ts): Returns an intro `text` block followed by multiple `resource_link` items. For a requested `count` (1–10), alternates between dynamic Text and Blob resources using URIs from `resources/templates.ts`.
16
- - `get-resource-reference` (tools/get-resource-reference.ts): Accepts `resourceType` (`text` or `blob`) and `resourceId` (positive integer). Returns a concrete `resource` content block (with its `uri`, `mimeType`, and data) with surrounding explanatory `text`.
17
- - `get-roots-list` (tools/get-roots-list.ts): Returns the last list of roots sent by the client.
18
- - `gzip-file-as-resource` (tools/gzip-file-as-resource.ts): Accepts a `name` and `data` (URL or data URI), fetches the data subject to size/time/domain constraints, compresses it, registers it as a session resource at `demo://resource/session/<name>` with `mimeType: application/gzip`, and returns either a `resource_link` (default) or an inline `resource` depending on `outputType`.
19
- - `get-structured-content` (tools/get-structured-content.ts): Demonstrates structured responses. Accepts `location` input and returns both backward‑compatible `content` (a `text` block containing JSON) and `structuredContent` validated by an `outputSchema` (temperature, conditions, humidity).
20
- - `get-sum` (tools/get-sum.ts): For two numbers `a` and `b` calculates and returns their sum. Uses Zod to validate inputs.
21
- - `get-tiny-image` (tools/get-tiny-image.ts): Returns a tiny PNG MCP logo as an `image` content item with brief descriptive text before and after.
22
- - `trigger-long-running-operation` (tools/trigger-long-running-operation.ts): Simulates a multi-step operation over a given `duration` and number of `steps`; reports progress via `notifications/progress` when a `progressToken` is provided by the client.
23
- - `toggle-simulated-logging` (tools/toggle-simulated-logging.ts): Starts or stops simulated, random‑leveled logging for the invoking session. Respects the client’s selected minimum logging level.
24
- - `toggle-subscriber-updates` (tools/toggle-subscriber-updates.ts): Starts or stops simulated resource update notifications for URIs the invoking session has subscribed to.
25
- - `trigger-elicitation-request` (tools/trigger-elicitation-request.ts): Issues an `elicitation/create` request using form-mode fields (strings, numbers, booleans, enums, and format validation) and returns the resulting action/content. Requires client form-mode elicitation: `elicitation.form`, or an `elicitation` object that declares neither mode.
26
- - `trigger-url-elicitation` (tools/trigger-url-elicitation.ts): Issues an `elicitation/create` request in URL mode (`mode: "url"`) with an `elicitationId`, or throws MCP error `-32042` (`UrlElicitationRequiredError`) when `errorPath=true`. On the error path the prerequisite elicitation it returns points at a different URL than the failing request (`https://modelcontextprotocol.io`); when the client satisfies it and retries the same call, the retry ignores `errorPath` and proceeds via the request path, so the client does not loop on the same error. The retry marker is one-shot per `(session, url, elicitationId)`: it is cleared on the recognized retry, so re-running the error path with identical arguments without an intervening prerequisite is treated as a retry and proceeds. Requires client capability `elicitation.url`.
27
- - `trigger-sampling-request` (tools/trigger-sampling-request.ts): Issues a `sampling/createMessage` request to the client/LLM using provided `prompt` and optional generation controls; returns the LLM's response payload.
28
- - `simulate-research-query` (tools/simulate-research-query.ts): Demonstrates MCP Tasks (SEP-1686) with a simulated multi-stage research operation. Accepts `topic` and `ambiguous` parameters. Returns a task that progresses through stages with status updates. If `ambiguous` is true and client supports elicitation, sends an elicitation request directly to gather clarification before completing.
29
- - `trigger-sampling-request-async` (tools/trigger-sampling-request-async.ts): Demonstrates bidirectional tasks where the server sends a sampling request that the client executes as a background task. Server polls for status and retrieves the LLM result when complete. Requires client to support `tasks.requests.sampling.createMessage`.
30
- - `trigger-elicitation-request-async` (tools/trigger-elicitation-request-async.ts): Demonstrates bidirectional tasks where the server sends an elicitation request that the client executes as a background task. Server polls while waiting for user input. Requires client form-mode elicitation (as for `trigger-elicitation-request`) and `tasks.requests.elicitation.create`.
32
+ - `echo` (tools/echo.ts), **both**: Echoes the provided `message: string`. Uses Zod to validate inputs.
33
+ - `get-annotated-message` (tools/get-annotated-message.ts), **both**: Returns a `text` message annotated with `priority` and `audience` based on `messageType` (`error`, `success`, or `debug`); can optionally include an annotated `image`.
34
+ - `get-env` (tools/get-env.ts), **both**: Returns all environment variables from the running process as pretty-printed JSON text.
35
+ - `get-header-params` (tools/get-header-params.ts), **both**: Returns its `region` argument and the `Mcp-Param-Region` HTTP header it arrived in. Its input and output schemas are plain JSON Schema 2020-12, and `region` carries `x-mcp-header: "Region"`, so a 2026-07-28 Streamable HTTP client mirrors it into that header and the server refuses a call whose header disagrees with the body (`-32020`). The header is `null` on stdio and for a 2025-era client.
36
+ - `get-resource-links` (tools/get-resource-links.ts), **both**: Returns an intro `text` block followed by multiple `resource_link` items. For a requested `count` (1–10), alternates between dynamic Text and Blob resources using URIs from `resources/templates.ts`.
37
+ - `get-resource-reference` (tools/get-resource-reference.ts), **both**: Accepts `resourceType` (`text` or `blob`) and `resourceId` (positive integer). Returns a concrete `resource` content block (with its `uri`, `mimeType`, and data) with surrounding explanatory `text`.
38
+ - `get-roots-list` (tools/get-roots-list.ts), **both**, deprecated: Asks the client for its roots with a multi-round-trip request (`inputRequired.listRoots()`) and lists them. Needs client capability `roots`.
39
+ - `gzip-file-as-resource` (tools/gzip-file-as-resource.ts), **both**: Accepts a `name` and `data` (URL or data URI), fetches the data subject to size/time/domain constraints, compresses it, and returns either a `resource_link` (default) or an inline `resource` depending on `outputType`, with `mimeType: application/gzip`. The linked resource is registered as a session resource at `demo://resource/session/<name>` for a 2025-era client, and stored for ten minutes at a minted `demo://resource/minted/<id>/<name>` for a 2026-07-28 client.
40
+ - `get-structured-content` (tools/get-structured-content.ts), **both**: Demonstrates structured responses. Accepts `location` input and returns both backward‑compatible `content` (a `text` block containing JSON) and `structuredContent` validated by an `outputSchema` (temperature, conditions, humidity).
41
+ - `get-sum` (tools/get-sum.ts), **both**: For two numbers `a` and `b` calculates and returns their sum. Uses Zod to validate inputs.
42
+ - `get-tiny-image` (tools/get-tiny-image.ts), **both**: Returns a tiny PNG MCP logo as an `image` content item with brief descriptive text before and after.
43
+ - `simulate-research-query` (tools/simulate-research-query.ts), **2026-07-28**: Runs as a task on the tasks extension. The call returns a task handle; the task works through four stages, one a second, which the client follows with `tasks/get`. With `ambiguous: true` and an elicitation-capable client it pauses at `input_required`, carrying a clarification request the client answers with `tasks/update`. Needs a client that declares the extension.
44
+ - `toggle-simulated-logging` (tools/toggle-simulated-logging.ts), **2025-era**, deprecated: Starts or stops simulated, random‑leveled logging for the connection. Respects the level the client set with `logging/setLevel`.
45
+ - `toggle-subscriber-updates` (tools/toggle-subscriber-updates.ts), **2025-era**, deprecated: Starts or stops simulated resource update notifications for URIs the connection has subscribed to with `resources/subscribe`.
46
+ - `trigger-elicitation-request` (tools/trigger-elicitation-request.ts), **both**: Asks for a form of every field type form-mode elicitation supports (strings, numbers, booleans, enums, and format validation) with a multi-round-trip request, and returns the resulting action/content. Needs client form-mode elicitation: `elicitation.form`, or an `elicitation` object that declares neither mode.
47
+ - `trigger-elicitation-request-async` (tools/trigger-elicitation-request-async.ts), **2026-07-28**: Runs as a task whose `input_required` status carries a form elicitation; the client answers with `tasks/update` and the task completes with a summary. Needs a client that declares the tasks extension and form-mode elicitation.
48
+ - `trigger-list-changed` (tools/trigger-list-changed.ts), **both**: Sends `notifications/<list>/list_changed` for `tools`, `prompts` or `resources`: on 2026-07-28 to each `subscriptions/listen` stream that asked for that list, on a 2025-era connection unsolicited.
49
+ - `trigger-log-messages` (tools/trigger-log-messages.ts), **both**, deprecated: Sends one log message at each level during the call. A 2026-07-28 request gets those at or above the level its `_meta` names (none if it names none); a 2025-era client those at or above its `logging/setLevel` level.
50
+ - `trigger-long-running-operation` (tools/trigger-long-running-operation.ts), **both**: Simulates a multi-step operation over a given `duration` and number of `steps`; reports progress via `notifications/progress` when a `progressToken` is provided by the client.
51
+ - `trigger-multi-step-elicitation` (tools/trigger-multi-step-elicitation.ts), **both**: Asks for a name, then for a favorite color addressed by that name, carrying the first answer to the second round in `requestState`. The state is HMAC-signed and expires after ten minutes; a tampered or expired one is refused with `-32602`. A blank name or a color that is not a choice is asked again. Needs form-mode elicitation.
52
+ - `trigger-resource-update` (tools/trigger-resource-update.ts), **both**: Sends `notifications/resources/updated` for a URI: on 2026-07-28 to each listen stream whose `resourceSubscriptions` name it, on a 2025-era connection once the client has subscribed to it.
53
+ - `trigger-sampling-request` (tools/trigger-sampling-request.ts), **both**, deprecated: Asks the client's LLM for a completion with a multi-round-trip request, using the provided `prompt` and `maxTokens`; returns the LLM's response payload. Needs client capability `sampling`.
54
+ - `trigger-sampling-request-async` (tools/trigger-sampling-request-async.ts), **2026-07-28**, deprecated: Runs as a task whose `input_required` status carries a sampling request; the client answers with `tasks/update` and the task completes with the result. Needs a client that declares the tasks extension and sampling.
55
+ - `trigger-url-elicitation` (tools/trigger-url-elicitation.ts), **both**: Directs the user to a URL (URL-mode elicitation). On 2026-07-28 the elicitation comes in-band (`input_required`), with no `elicitationId`. On a 2025-era connection it issues an `elicitation/create` request in URL mode with an `elicitationId`, or throws MCP error `-32042` (`UrlElicitationRequiredError`) when `errorPath=true`. On the error path the prerequisite elicitation it returns points at a different URL than the failing request (`https://modelcontextprotocol.io`); when the client satisfies it and retries the same call, the retry ignores `errorPath` and proceeds via the request path, so the client does not loop on the same error. The retry marker is one-shot per `(url, elicitationId)` on the connection: it is cleared on the recognized retry, so re-running the error path with identical arguments without an intervening prerequisite is treated as a retry and proceeds. Needs client capability `elicitation.url`.
56
+
57
+ On a 2025-era connection the tools that need a client capability are registered only for a client that declared it at `initialize`. On 2026-07-28 they are always listed, because the capabilities arrive with each request, and the SDK refuses a call whose embedded request the client did not declare (`-32021`).
31
58
 
32
59
  ## Prompts
33
60
 
@@ -40,66 +67,33 @@
40
67
 
41
68
  - Dynamic Text: `demo://resource/dynamic/text/{index}` (content generated on the fly)
42
69
  - Dynamic Blob: `demo://resource/dynamic/blob/{index}` (base64 payload generated on the fly)
43
- - Static Documents: `demo://resource/static/document/<filename>` (serves files from `src/everything/docs/` as static file-based resources)
44
- - Session Scoped: `demo://resource/session/<name>` (per-session resources registered dynamically; available only for the lifetime of the session)
45
-
46
- ## Resource Subscriptions and Notifications
47
-
48
- - Simulated update notifications are opt‑in and off by default.
49
- - Clients may subscribe/unsubscribe to resource URIs using the MCP `resources/subscribe` and `resources/unsubscribe` requests.
50
- - Use the `toggle-subscriber-updates` tool to start/stop a per‑session interval that emits `notifications/resources/updated { uri }` only for URIs that session has subscribed to.
51
- - Multiple concurrent clients are supported; each client’s subscriptions are tracked per session and notifications are delivered independently via the server instance associated with that session.
70
+ - Static Documents: `demo://resource/static/document/<filename>` (serves files from `src/everything/docs/` as static file-based resources; a 2026-07-28 read carries a one-hour public cache hint)
71
+ - Session Scoped, **2025-era**: `demo://resource/session/<name>` (per-session resources registered dynamically; available only for the lifetime of the session)
72
+ - Minted, **2026-07-28**: `demo://resource/minted/<id>/<name>` (resources a tool created, under a server-minted id; readable by any client that has the URI, for ten minutes; the process keeps at most 100 of them and 64 MiB of content, dropping the oldest first)
52
73
 
53
- ## Simulated Logging
74
+ A read of a resource that does not exist (an unknown URI, a template id that is not a positive integer, an expired minted resource) is answered with `-32602` and the URI in the error's `data`.
54
75
 
55
- - Simulated logging is available but off by default.
56
- - Use the `toggle-simulated-logging` tool to start/stop periodic log messages of varying levels (debug, info, notice, warning, error, critical, alert, emergency) per session.
57
- - Clients can control the minimum level they receive via the standard MCP `logging/setLevel` request.
58
-
59
- ## Tasks (SEP-1686)
60
-
61
- The server advertises support for MCP Tasks, enabling long-running operations with status tracking:
62
-
63
- - **Capabilities advertised**: `tasks.list`, `tasks.cancel`, `tasks.requests.tools.call`
64
- - **Task Store**: Uses `InMemoryTaskStore` from SDK experimental for task lifecycle management
65
- - **Message Queue**: Uses `InMemoryTaskMessageQueue` for task-related messaging
66
-
67
- ### Task Lifecycle
68
-
69
- 1. Client calls `tools/call` with `task: true` parameter
70
- 2. Server returns `CreateTaskResult` with `taskId` instead of immediate result
71
- 3. Client polls `tasks/get` to check status and receive `statusMessage` updates
72
- 4. When status is `completed`, client calls `tasks/result` to retrieve the final result
73
-
74
- ### Task Statuses
76
+ ## Resource Subscriptions and Notifications
75
77
 
76
- - `working`: Task is actively processing
77
- - `input_required`: Task needs additional input (server sends elicitation request directly)
78
- - `completed`: Task finished successfully
79
- - `failed`: Task encountered an error
80
- - `cancelled`: Task was cancelled by client
78
+ - **2026-07-28**: a client opens a `subscriptions/listen` stream whose filter names the notifications it wants (`toolsListChanged`, `promptsListChanged`, `resourcesListChanged`, and `resourceSubscriptions` for per-resource updates). `trigger-list-changed` and `trigger-resource-update` publish onto those streams; over Streamable HTTP, through the handler's subscription bus, so a change made in one request reaches streams other requests opened.
79
+ - **2025-era**: clients subscribe and unsubscribe to resource URIs with `resources/subscribe` and `resources/unsubscribe`. `toggle-subscriber-updates` starts or stops a per-connection interval that emits `notifications/resources/updated { uri }` for the URIs that connection subscribed to, and `trigger-resource-update` sends one on demand. List changes arrive unsolicited.
80
+ - Each client's subscriptions belong to the server instance serving its connection, so concurrent clients are independent.
81
81
 
82
- ### Demo Tools
82
+ ## Logging
83
83
 
84
- **Server-side tasks (client calls server):**
85
- Use the `simulate-research-query` tool to exercise the full task lifecycle. Set `ambiguous: true` to trigger elicitation - the server will send an `elicitation/create` request directly and await the response before completing.
84
+ Logging is deprecated as of 2026-07-28 (SEP-2577) and remains available on both eras.
86
85
 
87
- **Client-side tasks (server calls client):**
88
- Use `trigger-sampling-request-async` or `trigger-elicitation-request-async` to demonstrate bidirectional tasks where the server sends requests that the client executes as background tasks. These require the client to advertise `sampling` with `tasks.requests.sampling.createMessage`, or form-mode `elicitation` with `tasks.requests.elicitation.create`, respectively.
86
+ - **2026-07-28**: a request names its log level in `_meta` (`io.modelcontextprotocol/logLevel`); a request that names none gets no log messages. Use `trigger-log-messages` to see the filter at work.
87
+ - **2025-era**: clients set the minimum level for the session with `logging/setLevel`. `toggle-simulated-logging` starts or stops periodic log messages of varying levels (debug, info, notice, warning, error, critical, alert, emergency).
89
88
 
90
- ### Bidirectional Task Flow
89
+ ## Tasks
91
90
 
92
- MCP Tasks are bidirectional - both server and client can be task executors:
91
+ **2026-07-28.** The server implements the server side of the [tasks extension](https://github.com/modelcontextprotocol/ext-tasks) (`io.modelcontextprotocol/tasks`, SEP-2663), advertised under `capabilities.extensions` in `server/discover`. `simulate-research-query`, `trigger-sampling-request-async` and `trigger-elicitation-request-async` answer `tools/call` with a task handle (`resultType: "task"`) for a client that declares the extension, and serve:
93
92
 
94
- | Direction | Request Type | Task Executor | Demo Tool |
95
- | ---------------- | ------------------------ | ------------- | ----------------------------------- |
96
- | Client -> Server | `tools/call` | Server | `simulate-research-query` |
97
- | Server -> Client | `sampling/createMessage` | Client | `trigger-sampling-request-async` |
98
- | Server -> Client | `elicitation/create` | Client | `trigger-elicitation-request-async` |
93
+ - `tasks/get`: the task's status, `statusMessage`, `ttlMs` and `pollIntervalMs`, plus its `inputRequests` while `input_required` and its `result` once `completed`;
94
+ - `tasks/update`: the client's `inputResponses` to the outstanding input requests;
95
+ - `tasks/cancel`: stop a task that has not finished.
99
96
 
100
- For client-side tasks:
97
+ A task tool called by a client whose request does not declare the extension, or the capability its task asks for input with (`sampling` for `trigger-sampling-request-async`, form-mode `elicitation` for `trigger-elicitation-request-async`), is refused with `-32021` (missing required client capability), naming what is missing in `data.requiredCapabilities`; so is a `tasks/*` request from a client without the extension. An unknown or expired task, and a `tasks/update` whose answers exceed 64 KiB serialized, are refused with `-32602`. A `tasks/cancel` is acknowledged whatever the task's status (cancellation is cooperative), and a finished task stays as it ended. An update's answers to requests that are not outstanding (never issued, already answered, or sent while the task is not waiting for input) are ignored, as the extension asks. Each input request a task makes has its own key, never reused once answered, so a request asked again after an answer that does not fit gets a new key (`form-2`, `sampling-2`). The process keeps at most 100 tasks, each until its TTL; at that limit a new task is refused with a tool error. The task id is a server-minted UUID, so a task lives across requests (each 2026-07-28 HTTP request is served by a fresh server instance) and is reached only through its handle. A task's progress is computed from the clock when it is read, so nothing runs in the background.
101
98
 
102
- 1. Server sends request with task metadata (e.g., `params.task.ttl`)
103
- 2. Client creates task and returns `CreateTaskResult` with `taskId`
104
- 3. Server polls `tasks/get` for status updates
105
- 4. When complete, server calls `tasks/result` to retrieve the result
99
+ The 2025-11-25 core task methods (`tasks/result`, `tasks/list`, task-augmented requests) are not served: SDK v2 removed the experimental layer they were built on.
@@ -9,37 +9,52 @@
9
9
 
10
10
  # Conditional Tool Registration
11
11
 
12
- ### Module: `server/index.ts`
12
+ ### Modules: `server/index.ts`, `tools/index.ts`
13
13
 
14
14
  - Some tools require client support for the capability they demonstrate. These are:
15
15
  - `get-roots-list`
16
16
  - `trigger-elicitation-request`
17
+ - `trigger-multi-step-elicitation`
17
18
  - `trigger-sampling-request`
18
- - Client capabilities aren't known until after initilization handshake is complete.
19
- - Most tools are registered immediately during the Server Factory execution, prior to client connection.
20
- - To defer registration of these commands until client capabilities are known, a `registerConditionalTools(server)` function is invoked from an `onintitialized` handler.
19
+ - `trigger-url-elicitation`
20
+ - **2025 era**: client capabilities aren't known until the initialization handshake is complete, so these tools are registered by `registerConditionalTools(server, context)`, invoked from an `oninitialized` handler, for a client that declared the capability.
21
+ - **2026-07-28**: there is no handshake, and each request carries the client's capabilities in `_meta`, so `registerModernTools(server, context)` registers them up front. The SDK refuses a call whose embedded request the client did not declare (`-32021`).
22
+
23
+ # Multi-Round-Trip Requests
24
+
25
+ ### Modules: the elicitation, sampling and roots tools
26
+
27
+ - A tool that needs client input returns `inputRequired({ inputRequests })` instead of a result. A 2026-07-28 client fulfils the embedded requests and retries the call with `inputResponses`; for a 2025-era client the SDK's legacy shim sends real `elicitation/create`, `sampling/createMessage` or `roots/list` requests and re-enters the handler with the answers. Each handler is written once.
28
+ - The handler reads the answers with `inputResponse(...)` (any kind, including a decline) or `acceptedContent(..., schema)` (a validated form answer).
29
+ - A flow of several rounds carries what it has learned in `requestState`. `trigger-multi-step-elicitation` mints it with `roundStateCodec` (HMAC-signed, ten-minute expiry, process-wide key), passed to the server as `requestState.verify`, so a tampered or expired state is refused with `-32602` before the handler runs.
30
+
31
+ # Tasks
32
+
33
+ ### Module: `server/tasks.ts`
34
+
35
+ - Serves the tasks extension (`io.modelcontextprotocol/tasks`) on 2026-07-28: `tasks/get`, `tasks/update` and `tasks/cancel`, with explicit schemas.
36
+ - `createTask(behavior, options)` stores a task under a minted UUID and returns the `tools/call` result that hands its handle to the client (`resultType: "task"`). A task's `behavior` works out its state from the clock (`stateAt`) and takes the client's answers (`receive`), so nothing runs in the background. Tasks past their TTL are dropped when the store is next touched.
21
37
 
22
38
  ## Resource Subscriptions
23
39
 
24
40
  ### Module: `resources/subscriptions.ts`
25
41
 
26
- - Tracks subscribers per URI: `Map<uri, Set<sessionId>>`.
27
- - Installs handlers via `setSubscriptionHandlers(server)` to process subscribe/unsubscribe requests and keep the map updated.
28
- - Updates are started/stopped on demand by the `toggle-subscriber-updates` tool, which calls `beginSimulatedResourceUpdates(server, sessionId)` and `stopSimulatedResourceUpdates(sessionId)`.
29
- - `cleanup(sessionId?)` calls `stopSimulatedResourceUpdates(sessionId)` to clear intervals and remove session‑scoped state.
42
+ - **2025 era**: `setSubscriptionHandlers(server, subscribed)` processes subscribe/unsubscribe requests, keeping the instance's set of subscribed URIs.
43
+ - Updates are started/stopped on demand by the `toggle-subscriber-updates` tool, which calls `beginSimulatedResourceUpdates(server, subscribed)` and keeps the stop function it returns; the instance's `cleanup()` stops it too.
44
+ - **2026-07-28**: the serving entry handles `subscriptions/listen` itself. The context's publisher (`server/context.ts`) sends changes from the instance on stdio, where `serveStdio` routes them onto the open streams, and through the handler's bus over Streamable HTTP.
30
45
 
31
- ## Session‑scoped Resources
46
+ ## Session‑scoped and Minted Resources
32
47
 
33
- ### Module: `resources/session.ts`
48
+ ### Modules: `resources/session.ts`, `resources/minted.ts`
34
49
 
35
50
  - `getSessionResourceURI(name: string)`: Builds a session resource URI: `demo://resource/session/<name>`.
36
51
  - `registerSessionResource(server, resource, type, payload)`: Registers a resource with the given `uri`, `name`, and `mimeType`, returning a `resource_link`. The content is served from memory for the life of the session only. Supports `type: "text" | "blob"` and returns data in the corresponding field.
37
- - Intended usage: tools can create and expose per-session artifacts without persisting them. For example, `tools/gzip-file-as-resource.ts` compresses fetched content, registers it as a session resource with `mimeType: application/gzip`, and returns either a `resource_link` or an inline `resource` based on `outputType`.
52
+ - `mintBlobResource(name, mimeType, blob)`: on 2026-07-28, where an instance may not outlive the request, stores the resource process-wide under `demo://resource/minted/<uuid>/<name>` for ten minutes and returns a `resource_link`; `registerMintedResources(server)` serves the store through one template.
53
+ - Intended usage: tools can create and expose artifacts without persisting them. For example, `tools/gzip-file-as-resource.ts` compresses fetched content and returns either a `resource_link` to a session or minted resource, by era, or an inline `resource`, based on `outputType`.
38
54
 
39
- ## Simulated Logging
55
+ ## Logging
40
56
 
41
- ### Module: `server/logging.ts`
57
+ ### Modules: `server/logging.ts`, `tools/trigger-log-messages.ts`
42
58
 
43
- - Periodically sends randomized log messages at different levels. Messages can include the session ID for clarity during demos.
44
- - Started/stopped on demand via the `toggle-simulated-logging` tool, which calls `beginSimulatedLogging(server, sessionId?)` and `stopSimulatedLogging(sessionId?)`. Note that transport disconnect triggers `cleanup()` which also stops any active intervals.
45
- - Uses `server.sendLoggingMessage({ level, data }, sessionId?)` so that the client’s configured minimum logging level is respected by the SDK.
59
+ - **2025 era**: `beginSimulatedLogging(server)` periodically sends randomized log messages at different levels, and returns the function that stops it. `toggle-simulated-logging` starts and stops it; the instance's `cleanup()` stops it too. It uses `server.sendLoggingMessage(params, sessionId)` so that the level the client set with `logging/setLevel` is respected by the SDK.
60
+ - **Both eras**: `trigger-log-messages` sends one message per level with `ctx.mcpReq.log(...)`, which the SDK filters by the request's `_meta` log level on 2026-07-28 and by the session level on the 2025 era.
@@ -3,28 +3,35 @@
3
3
  Audience: These instructions are written for an LLM or autonomous agent integrating with the Everything MCP Server.
4
4
  Follow them to use, extend, and troubleshoot the server safely and effectively.
5
5
 
6
+ ## Protocol Versions
7
+
8
+ The server serves two protocol eras. A client on protocol version 2026-07-28 connects with `server/discover` and sends its capabilities with each request; a 2025-era client connects with `initialize`. Some tools exist on one era only, so trust your `tools/list`:
9
+
10
+ - 2026-07-28 only: `simulate-research-query`, `trigger-sampling-request-async` and `trigger-elicitation-request-async`, which run as tasks on the `io.modelcontextprotocol/tasks` extension and need a client that declares it; `trigger-sampling-request-async` also needs `sampling`, and `trigger-elicitation-request-async` form-mode `elicitation`. A call without them fails with `-32021`
11
+ - 2025-era only (deprecated): `toggle-simulated-logging` and `toggle-subscriber-updates`
12
+
6
13
  ## Cross-Feature Relationships
7
14
 
8
15
  - If `get-roots-list` is in your tool list, use it to see client workspace roots before file operations
9
- - `gzip-file-as-resource` creates session-scoped resources accessible only during the current session
10
- - Enable `toggle-simulated-logging` before debugging to see server log messages
11
- - Enable `toggle-subscriber-updates` to receive periodic resource update notifications
16
+ - `gzip-file-as-resource` creates resources you can read later: for the current session on a 2025-era connection, or for ten minutes at the returned URI on 2026-07-28
17
+ - Use `trigger-log-messages` to see which log levels reach you; on 2026-07-28 the level is set per request in `_meta`
18
+ - Use `trigger-resource-update` and `trigger-list-changed` to see change notifications; on 2026-07-28 they arrive only on a `subscriptions/listen` stream that asked for them
12
19
 
13
20
  ## Constraints & Limitations
14
21
 
15
22
  - `gzip-file-as-resource`: Max fetch size controlled by `GZIP_MAX_FETCH_SIZE` (default 10MB), timeout by `GZIP_MAX_FETCH_TIME_MILLIS` (default 30s), allowed domains by `GZIP_ALLOWED_DOMAINS`
16
- - Session resources are ephemeral and lost when the session ends
23
+ - Session resources are ephemeral and lost when the session ends; minted resources expire after ten minutes
24
+ - Roots, sampling and logging are deprecated as of protocol version 2026-07-28, as is the HTTP+SSE transport
17
25
 
18
26
  ## Capability-Gated Tools
19
27
 
20
- Registered only if your client declared the capability shown. Otherwise they are absent from `tools/list`, so do not call them:
28
+ On a 2025-era connection these are registered only if your client declared the capability shown. Otherwise they are absent from `tools/list`, so do not call them. On 2026-07-28 they are always listed, and a call fails if your request did not declare the capability:
21
29
 
22
30
  - `get-roots-list`: `roots`
23
31
  - `trigger-sampling-request`: `sampling`
24
32
  - `trigger-elicitation-request`: `elicitation.form`, or `elicitation` with no mode
33
+ - `trigger-multi-step-elicitation`: `elicitation.form`, or `elicitation` with no mode
25
34
  - `trigger-url-elicitation`: `elicitation.url`
26
- - `trigger-sampling-request-async`: `sampling` and `tasks.requests.sampling.createMessage`
27
- - `trigger-elicitation-request-async`: form-mode `elicitation` and `tasks.requests.elicitation.create`
28
35
 
29
36
  ## Operational Patterns
30
37
 
@@ -13,64 +13,59 @@
13
13
  - Runs the specified **transport manager** to handle client connections.
14
14
  - Specify transport type on command line (default `stdio`)
15
15
  - `stdio` → `transports/stdio.js`
16
- - `sse` → `transports/sse.js`
16
+ - `sse` → `transports/sse.js` (deprecated, 2025-era clients only; prints a warning)
17
17
  - `streamableHttp` → `transports/streamableHttp.js`
18
18
 
19
19
  ## 2. The Transport Manager
20
20
 
21
- - Creates a server instance using `createServer()` from `server/index.ts`
22
- - Connects it to the chosen transport type from the MCP SDK.
21
+ - Serves server instances built by `createServer()` from `server/index.ts`, one per connection (or per request), each for the protocol era the client speaks.
23
22
  - Handles communication according to the MCP specs for the chosen transport.
24
23
  - **STDIO**:
25
- - One simple, process‑bound connection.
26
- - Calls`clientConnect()` upon connection.
27
- - Closes and calls `cleanup()` on `SIGINT`.
28
- - **SSE**:
29
- - Supports multiple client connections.
30
- - Client transports are mapped to `sessionId`;
31
- - Calls `clientConnect(sessionId)` upon connection.
24
+ - One process‑bound connection, served by the SDK's `serveStdio` entry.
25
+ - The client's first message picks the era: `server/discover` (or any request with the 2026-07-28 `_meta` envelope) for 2026-07-28, `initialize` for the 2025 era. `serveStdio` then builds the server for that era with `createServer({ era })` and pins it to the connection (it may build and discard one more first, to answer a discover probe).
26
+ - Runs an instance's `cleanup()` when it closes, and on `SIGINT` closes the connection, cleans up and exits.
27
+ - **SSE** (deprecated; 2025-era clients only):
28
+ - Supports multiple client connections, one server per `GET /sse` stream.
29
+ - Client transports are mapped to `sessionId`.
32
30
  - Hooks server’s `onclose` to clean and remove session.
33
31
  - Exposes
34
32
  - `/sse` **GET** (SSE stream)
35
33
  - `/message` **POST** (JSON‑RPC messages)
36
- - **Streamable HTTP**:
37
- - Supports multiple client connections.
38
- - Client transports are mapped to `sessionId`;
39
- - Calls `clientConnect(sessionId)` upon connection.
40
- - Exposes `/mcp` for
41
- - **POST** (JSON‑RPC messages)
42
- - **GET** (SSE stream)
43
- - **DELETE** (termination)
44
- - Uses an event store for resumability and stores transports by `sessionId`.
45
- - Calls `cleanup(sessionId)` on **DELETE**.
34
+ - **Streamable HTTP**: one `/mcp` endpoint for both eras.
35
+ - **2026-07-28**: a session-less **POST** carrying the per-request `_meta` envelope is served by the SDK's `createMcpHandler`, which builds a fresh server per request with `createServer({ era: "modern", publish })`. There are no sessions. Change notifications are published on the handler's subscription bus (`publish`), which reaches every open `subscriptions/listen` stream.
36
+ - **2025 era**: everything else, classified by the SDK's `isLegacyRequest`, keeps the sessionful wiring: a server per session, created on the `initialize` **POST**, with **GET** for the standalone SSE stream and **DELETE** to end the session. Transports are stored by `sessionId`, an event store makes streams resumable, and the session's `cleanup()` runs when it closes. Sessionful serving keeps the server-to-client channel the legacy shim needs for elicitation, sampling and roots.
37
+ - A session-less POST's body is parsed once (up to 4 MiB) to classify it and serve it.
46
38
  - **SSE** and **Streamable HTTP** bind their port (`PORT`, default `3001`) through `listenOrExit()` in `transports/listen.ts`.
47
39
  - The listening line is printed only once the port is bound.
48
40
  - A bind failure, such as a port already in use, is reported on stderr and the process exits non-zero.
49
41
 
50
42
  ## 3. The Server Factory
51
43
 
52
- - Invoke `createServer()` from `server/index.ts`
44
+ - Invoke `createServer({ era, publish })` from `server/index.ts`
53
45
  - Creates a new `McpServer` instance with
54
46
  - **Capabilities**:
55
- - `tools: {}`
47
+ - `tools: { listChanged: true }`
56
48
  - `logging: {}`
57
- - `prompts: {}`
58
- - `resources: { subscribe: true }`
49
+ - `prompts: { listChanged: true }`
50
+ - `resources: { subscribe: true, listChanged: true }`
51
+ - `extensions: { "io.modelcontextprotocol/tasks": {} }` (2026-07-28 only)
59
52
  - **Server Instructions**
60
53
  - Loaded from the docs folder (`instructions.md`).
54
+ - **Options**
55
+ - Cache hints for the 2026-07-28 cacheable results (`cacheHints`).
56
+ - The `requestState` verifier for multi-round tools (`roundStateCodec`).
61
57
  - **Registrations**
62
- - Registers **tools** via `registerTools(server)`.
63
- - Registers **resources** via `registerResources(server)`.
58
+ - Builds a per-instance **context** (`server/context.ts`): the era, where change notifications go, the 2025-era resource subscriptions, and a cleanup registry.
59
+ - Registers **tools** via `registerTools(server, context)`, and then by era: `registerModernTools` and the tasks extension (`server/tasks.ts`) for 2026-07-28; `registerLegacyTools` now and `registerConditionalTools` once the client has initialized, for the 2025 era.
60
+ - Registers **resources** via `registerResources(server, context)`.
64
61
  - Registers **prompts** via `registerPrompts(server)`.
65
- - **Other Request Handlers**
66
- - Sets up resource subscription handlers via `setSubscriptionHandlers(server)`.
67
- - Roots list change handler is added post-connection via
62
+ - **Other Request Handlers** (2025 era)
63
+ - Sets up resource subscription handlers via `setSubscriptionHandlers(server, subscribed)`.
64
+ - Syncs the client's roots after `initialize` via `syncRoots(server)`, which also installs the `roots/list_changed` handler.
68
65
  - **Returns**
69
66
  - The `McpServer` instance
70
- - A `clientConnect(sessionId)` callback that enables post-connection setup
71
- - A `cleanup(sessionId?)` callback that stops any active intervals and removes any session‑scoped state
67
+ - A `cleanup()` callback that stops the instance's intervals and clears its state
72
68
 
73
69
  ## Enabling Multiple Clients
74
70
 
75
- Some of the transport managers defined in the `transports` folder can support multiple clients.
76
- In order to do so, they must map certain data to a session identifier.
71
+ Every piece of per-connection state lives on the server instance that serves the connection: there are no maps keyed by session id. On stdio and on a 2025-era session one instance serves the whole connection; on the 2026-07-28 HTTP path each request gets its own instance, so what must outlive a request (a task, a minted resource) is stored process-wide under a handle the server mints.