Repository navigation
Commit 85bd7b9
feat(everything): serve both protocol eras on SDK v2 (2026-07-28 + legacy)
Migrates the everything server to the v2 scoped SDK packages
(@modelcontextprotocol/server, /node, /core, /server-legacy at 2.0.0-beta.5)
and adds support for protocol revision 2026-07-28 alongside the existing
legacy revisions (2024-10-07 through 2025-11-25).
Transports now hand the server factory to an SDK serving entry rather than
constructing an instance and connecting a transport:
- stdio: serveStdio(factory) serves both eras; the opening exchange selects
one (server/discover probe vs. initialize handshake).
- streamableHttp: createMcpHandler(factory) + toNodeHandler serves both eras
from one endpoint. The session map, mcp-session-id plumbing,
InMemoryEventStore/Last-Event-ID replay, and hand-written GET/DELETE routes
are all removed - 2026-07-28 has no protocol-level sessions and no SSE
resumability, and subscriptions/listen replaces the standalone GET stream.
- sse: unchanged in behaviour, now explicitly legacy-only via server-legacy.
Tools are written once and served to both eras. Those needing client input
return inputRequired(...) instead of pushing a server->client request; the
SDK's legacy shim converts the same return into real server->client requests
for legacy clients, so no tool branches on ctx.era.
Notable behaviour changes:
- registerConditionalTools is gone. 2026-07-28 has no handshake to learn
capabilities from, capabilities are per-request, and tools/list may not vary
per connection. Tools register unconditionally and the SDK refuses a caller
lacking a capability at dispatch with -32021, as the spec requires.
- trigger-{sampling,elicitation}-request-async removed: they polled the
client's task endpoints, and 2026-07-28 removed the server->client channel
with no successor.
- trigger-url-elicitation drops the -32042 error path and its session-keyed
dedupe, both legacy-only by construction.
- simulate-research-query is no longer task-based. SDK v2 removed the
experimental tasks layer and the redesigned extension cannot be served
through the SDK; the tool keeps its staged progress and mid-flight
elicitation as a multi-round-trip flow, threading state through an
HMAC-sealed requestState.
- toggle-simulated-logging is legacy-only and documented as such: it models a
connection-scoped log stream, which 2026-07-28 removed.
Also adds cache hints for the cacheable list surfaces and requestState
verification, and updates all seven docs plus the README.
Requires Node.js >= 20 and is ESM-only, inherited from SDK v2.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent d31124c commit 85bd7b9
53 files changed
Lines changed: 1945 additions & 2476 deletions
File tree
- src/everything
- __tests__
- docs
- prompts
- resources
- server
- tools
- transports
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
12 | 30 | | |
13 | 31 | | |
14 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
46 | 61 | | |
47 | 62 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 63 | + | |
| 64 | + | |
86 | 65 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
| 66 | + | |
106 | 67 | | |
107 | 68 | | |
108 | 69 | | |
109 | | - | |
110 | | - | |
111 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
112 | 73 | | |
113 | 74 | | |
114 | 75 | | |
115 | 76 | | |
116 | 77 | | |
117 | 78 | | |
118 | 79 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
126 | 87 | | |
127 | 88 | | |
128 | 89 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
132 | 93 | | |
133 | 94 | | |
134 | 95 | | |
135 | 96 | | |
136 | 97 | | |
137 | 98 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
143 | 104 | | |
144 | 105 | | |
145 | | - | |
146 | | - | |
| 106 | + | |
| 107 | + | |
147 | 108 | | |
148 | 109 | | |
149 | 110 | | |
150 | 111 | | |
151 | | - | |
| 112 | + | |
152 | 113 | | |
153 | 114 | | |
154 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
0 commit comments