Skip to content

Commit 6d613ec

Browse files
authored
Merge pull request #5131 from modelcontextprotocol/v2/feat/4852-modern-era-ts-servers
feat: modern-era TypeScript servers (2026-07-28 + 2025) and the new features in everything
2 parents 8d40eb2 + 7bb70f6 commit 6d613ec

69 files changed

Lines changed: 6018 additions & 2032 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-everything": minor
3+
---
4+
5+
Serve the 2026-07-28 protocol revision alongside the 2025 era (#4852), over stdio (`serveStdio`) and Streamable HTTP (one `/mcp` endpoint: `createMcpHandler` for 2026-07-28 requests, the existing sessionful transport for 2025-era clients). New for 2026-07-28 clients: `server/discover`, multi-round-trip requests (`input_required`) for the elicitation, sampling and roots tools, `subscriptions/listen` change notifications, cache hints (`ttlMs` / `cacheScope`), and the tasks extension (`io.modelcontextprotocol/tasks`, advertised under `capabilities.extensions`), on which `simulate-research-query`, `trigger-sampling-request-async` and `trigger-elicitation-request-async` return. New tools on both eras: `trigger-multi-step-elicitation` (`requestState` across rounds), `trigger-log-messages` (per-request log levels), `trigger-list-changed`, `trigger-resource-update`, and `get-header-params` (`x-mcp-header` and JSON Schema 2020-12 schemas). `toggle-simulated-logging` and `toggle-subscriber-updates` are offered to 2025-era clients only, labelled deprecated with the roots, sampling and logging tools. For 2025-era clients: `get-roots-list` asks the client for its roots on every call; a failed sampling, elicitation or roots request is reported as `Fulfilling input required by 'tools/call' failed: <message>`; a read of a dynamic resource with an invalid id is answered `-32602` with the URI in `data`; and the toggle tools' messages and the subscription acknowledgements no longer name a session id. `gzip-file-as-resource` limits its `name` argument to 255 characters. The HTTP+SSE transport prints a deprecation warning on start.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-filesystem": minor
3+
---
4+
5+
Serve the 2026-07-28 protocol revision alongside the 2025 era on stdio, through the SDK's `serveStdio` entry (#4852). A 2026-07-28 connection has no `initialize` and no server-to-client `roots/list`, and Roots is deprecated as of that revision, so the command-line directories are its whole allow-list; a server started with none answers each tool call on such a connection with an error saying so. 2025-era clients keep the Roots behavior they had. The README now recommends command-line directories over Roots (#4844).

‎.changeset/memory-modern-era.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-memory": minor
3+
---
4+
5+
Serve the 2026-07-28 protocol revision alongside the 2025 era on stdio, through the SDK's `serveStdio` entry (#4852). A 2026-07-28 client gets `notifications/resources/updated` for `memory://knowledge-graph` on a `subscriptions/listen` stream whose `resourceSubscriptions` name it; 2025-era clients still subscribe with `resources/subscribe`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-sequential-thinking": minor
3+
---
4+
5+
Serve the 2026-07-28 protocol revision alongside the 2025 era on stdio, through the SDK's `serveStdio` entry (#4852). The thought history lasts as long as the client's connection, on either era.

‎.claude/skills/client-smoke/SKILL.md‎

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -172,28 +172,27 @@ CLI) or **Server Settings → Protocol Era** (the web UI):
172172
| `modern` | Pins 2026-07-28 through `server/discover`, with no fallback |
173173
| `auto` | Probes `server/discover`, and falls back to `initialize` |
174174

175-
**The Python servers serve both eras** (#4853): run every command twice, with
176-
`--protocol-era legacy` and `--protocol-era modern`, and expect both to
177-
succeed. A 2026-07-28 result carries `io.modelcontextprotocol/serverInfo` in
178-
its `_meta`, which is the quick way to see which era answered.
179-
180-
⚠️ **The TypeScript servers serve only the legacy era today.** They are on the
181-
TS SDK v2 packages (#4856) but still serve only the `initialize` handshake,
182-
with no `server/discover`. Against them:
183-
184-
- `--protocol-era modern` fails, by design, with `Version negotiation failed:
185-
the server did not offer pinned protocol version 2026-07-28 via
186-
server/discover (no fallback in pin mode)` and exit 1. That is the expected
187-
result for an unmigrated server, not a regression in your change.
188-
- `--protocol-era auto` succeeds, but through the fallback, so it is a legacy
189-
connection and proves nothing about 2026-07-28.
190-
191-
The both-eras check that `/pr-flow` asks for (#4857) therefore has one half
192-
that can pass for a TypeScript server today. Record the legacy run, and say in
193-
the PR that the server does not yet speak 2026-07-28 rather than leaving the
194-
modern era unmentioned. Modern-era support for them arrives with #4852; from
195-
then on, run both eras as for the Python servers. Do not use `auto` for
196-
evidence in either case: it does not say which era answered.
175+
**Every server serves both eras**: the Python servers since #4853, the
176+
TypeScript servers since #4852 (stdio through the SDK's `serveStdio`, and
177+
`everything`'s Streamable HTTP endpoint through `createMcpHandler` for
178+
2026-07-28 requests). Run every command twice, with `--protocol-era legacy`
179+
and `--protocol-era modern`, and expect both to succeed. A 2026-07-28 result
180+
carries `io.modelcontextprotocol/serverInfo` in its `_meta`, which is the
181+
quick way to see which era answered. Do not use `auto` for evidence: it does
182+
not say which era answered.
183+
184+
`everything` lists some tools on one era only (the task tools on 2026-07-28,
185+
the two `toggle-*` tools on the 2025 era), so a `tools/list` that differs
186+
between the two runs is expected.
187+
188+
The CLI declares no client capabilities, so a tool that asks the client for
189+
input (elicitation, sampling, roots) cannot run from it: on the 2025 era
190+
`everything` does not list it (`tool_not_found`, exit 5), and on 2026-07-28
191+
the SDK refuses the call because the request did not declare the capability
192+
(`Cannot request input 'form' (elicitation/create): the request's client
193+
capabilities do not declare the required capability`, exit 1). Drive those
194+
from the web UI. On 2026-07-28 the CLI does follow a task handle: a call to
195+
`simulate-research-query` polls the task and prints its final result.
197196

198197
## The Inspector web UI
199198

@@ -260,8 +259,10 @@ Claude Code, run this way, has no era switch and does not print the protocol
260259
version it negotiated. `/pr-flow` asks for the LLM client in both eras as well;
261260
where the client gives no way to choose, record the client and its version and
262261
say that the era could not be selected, rather than labelling the run with an
263-
era it was not shown to use. Against a server without modern-era support the connection is legacy
264-
whatever the client prefers, for the reason given under Protocol eras.
262+
era it was not shown to use. `everything` shows which era a client
263+
negotiated through its tool list: a 2026-07-28 client sees
264+
`simulate-research-query` and no `toggle-*` tools, a 2025-era client the
265+
reverse. Claude Code 2.1.296 negotiates 2026-07-28 against these servers.
265266

266267
## What to write down
267268

‎AGENTS.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,14 @@ would not, burns turns, and buries the result under no-op turns.
594594
`https://modelcontextprotocol.io/mcp`). For schema details use the versioned
595595
schemas (JSON and TypeScript) in
596596
[modelcontextprotocol/schema](https://github.com/modelcontextprotocol/modelcontextprotocol/tree/main/schema).
597+
- **Protocol eras**: every TypeScript server serves both 2026-07-28 clients
598+
and 2025-era clients from one factory: stdio through the SDK's
599+
`serveStdio`, Streamable HTTP through `createMcpHandler`. Keep no state in
600+
a map keyed by session id, since 2026-07-28 has no sessions: per-connection
601+
state lives on the server instance, and state that must outlive a
602+
2026-07-28 request lives under a handle the server mints. Ask a client for
603+
input (elicitation, sampling, roots) by returning `inputRequired(...)`,
604+
which the SDK's legacy shim also serves to 2025-era clients.
597605
- **Transports**: stdio is the default and every server supports it.
598606
`everything` also serves Streamable HTTP and HTTP+SSE. **HTTP+SSE is
599607
deprecated**: keep what exists working, and never make it the default or the

‎src/everything/AGENTS.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ The server factory is `src/everything/server/index.ts` and registers all feature
2929

3030
### High-level
3131

32-
- Tools live under `src/everything/tools/` and are registered via `registerTools(server)`.
33-
- Resources live under `src/everything/resources/` and are registered via `registerResources(server)`.
32+
- The server serves both protocol eras (2026-07-28 and 2025-era); the factory is `createServer({ era })`, and what each era gets is wired in `server/index.ts` and `tools/index.ts`.
33+
- Tools live under `src/everything/tools/` and are registered via `registerTools(server, context)` (both eras), `registerModernTools` (2026-07-28) or `registerLegacyTools` / `registerConditionalTools` (2025 era).
34+
- Resources live under `src/everything/resources/` and are registered via `registerResources(server, context)`.
3435
- Prompts live under `src/everything/prompts/` and are registered via `registerPrompts(server)`.
3536
- Subscriptions and simulated update routines are under `src/everything/resources/subscriptions.ts`.
3637
- Logging helpers are under `src/everything/server/logging.ts`.
@@ -39,7 +40,8 @@ The server factory is `src/everything/server/index.ts` and registers all feature
3940
### When adding a new feature
4041

4142
- Follow the existing file/module pattern in its folder (naming, exports, and registration function).
42-
- Export a `registerX(server)` function that registers new items with the MCP SDK in the same style as existing ones.
43+
- Export a `registerX(server)` function that registers new items with the MCP SDK in the same style as existing ones (taking the per-instance `context` too when it needs the era, the change publisher or per-connection state).
44+
- Keep no state in module-level maps keyed by session id; see [Extension Points](docs/extension.md).
4345
- Wire your new module into the central index (e.g., update `tools/index.ts`, `resources/index.ts`, or `prompts/index.ts`).
4446
- Ensure schemas (for tools) are accurate JSON Schema and include helpful descriptions and examples.
4547
- Keep the docs in `src/everything/docs/` up to date if you add or modify noteworthy features.

‎src/everything/README.md‎

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
# Everything MCP Server
2+
23
**[Architecture](docs/architecture.md)
34
| [Project Structure](docs/structure.md)
45
| [Startup Process](docs/startup.md)
56
| [Server Features](docs/features.md)
67
| [Extension Points](docs/extension.md)
78
| [How It Works](docs/how-it-works.md)**
89

9-
1010
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.
1111

1212
## Tools, Resources, Prompts, and Other Features
1313

1414
A complete list of the registered MCP primitives and other protocol features demonstrated can be found in the [Server Features](docs/features.md) document.
1515

16-
The task tools (`simulate-research-query`, `trigger-sampling-request-async` and `trigger-elicitation-request-async`) are not available for now: they were built on the TypeScript SDK's experimental tasks layer, which SDK v2 removed. They return on the MCP tasks extension in [#4852](https://github.com/modelcontextprotocol/servers/issues/4852).
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.
1724

1825
## Requirements
1926

@@ -28,10 +35,7 @@ Add to your `claude_desktop_config.json`:
2835
"mcpServers": {
2936
"everything": {
3037
"command": "npx",
31-
"args": [
32-
"-y",
33-
"@modelcontextprotocol/server-everything"
34-
]
38+
"args": ["-y", "@modelcontextprotocol/server-everything"]
3539
}
3640
}
3741
}
@@ -44,12 +48,7 @@ On Windows, use `cmd /c` to launch `npx`:
4448
"mcpServers": {
4549
"everything": {
4650
"command": "cmd",
47-
"args": [
48-
"/c",
49-
"npx",
50-
"-y",
51-
"@modelcontextprotocol/server-everything"
52-
]
51+
"args": ["/c", "npx", "-y", "@modelcontextprotocol/server-everything"]
5352
}
5453
}
5554
}
@@ -99,46 +98,56 @@ On Windows, use:
9998
}
10099
```
101100

102-
## 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)
103102

104103
```shell
105104
cd src/everything
106105
npm install
107-
npm run start:sse
106+
npm run start:streamableHttp
108107
```
109108

110-
## 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))
111112

112113
```shell
113114
cd src/everything
114115
npm install
115-
npm run start:streamableHttp
116+
npm run start:sse
116117
```
117118

119+
The HTTP+SSE transport serves 2025-era clients only, and the server prints a deprecation warning when it starts. Prefer Streamable HTTP.
120+
118121
## Running as an installed package
119-
### Install
122+
123+
### Install
124+
120125
```shell
121126
npm install -g @modelcontextprotocol/server-everything@latest
122127
```
123128

124129
### Run the default (stdio) server
130+
125131
```shell
126132
npx @modelcontextprotocol/server-everything
127133
```
128134

129135
### Or specify stdio explicitly
136+
130137
```shell
131138
npx @modelcontextprotocol/server-everything stdio
132139
```
133140

134-
### Run the SSE server
141+
### Run the streamable HTTP server
142+
135143
```shell
136-
npx @modelcontextprotocol/server-everything sse
144+
npx @modelcontextprotocol/server-everything streamableHttp
137145
```
138146

139-
### Run the streamable HTTP server
147+
### Run the SSE server (deprecated, 2025-era clients only)
148+
140149
```shell
141-
npx @modelcontextprotocol/server-everything streamableHttp
150+
npx @modelcontextprotocol/server-everything sse
142151
```
143152

144153
## License

0 commit comments

Comments
 (0)