You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 11f9aac
Browse filesBrowse the repository at this point in the historyBrowse files
The MCP endpoint is available at `http://localhost:9292/mcp`. See [`rails/README.md`](rails/README.md) for a full curl-based walkthrough.
157
158
159
+
### 8. Modern Lifecycle HTTP Server / Client (`modern_http_server.rb`, `modern_http_client.rb`)
160
+
161
+
A server and client pair demonstrating the 2026-07-28 modern lifecycle (SEP-2575), which replaces the `initialize` handshake and per-session state with sessionless, self-contained requests.
162
+
163
+
**Features:**
164
+
165
+
-`server/discover` capability discovery before (or instead of) a handshake
166
+
- The per-request `_meta` envelope and `Mcp-Method` / `Mcp-Name` headers, stamped by the SDK automatically
167
+
-`resultType` stamping and SEP-2549 cache hints (`ttlMs`, `cacheScope`) on results
168
+
- A multi round-trip `deploy` tool (SEP-2322), resumed automatically by the client's elicitation handler
169
+
- The removal of legacy-only methods such as `ping`
170
+
171
+
**Usage:**
172
+
173
+
1. Start the server in one terminal:
174
+
175
+
```console
176
+
$ ruby examples/modern_http_server.rb
177
+
```
178
+
179
+
2. Run the client in another terminal:
180
+
181
+
```console
182
+
$ ruby examples/modern_http_client.rb
183
+
```
184
+
185
+
The same server still accepts the legacy `initialize` flow: the transport routes each request to the legacy or modern lifecycle by its `MCP-Protocol-Version` header.
186
+
158
187
### Testing with MCP Inspector
159
188
160
189
[MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) is a browser-based tool for testing and debugging MCP servers.
@@ -188,24 +217,78 @@ You can also test SSE functionality manually using cURL:
3.Call the notification tool. The `notifications/progress` events (requested via the `progressToken` in `_meta`) and the final response arrive as SSE events on the POST response itself:
--json '{"jsonrpc":"2.0","method":"tools/call","id":2,"params":{"name":"notification_tool","arguments":{"message":"Hello from cURL!"}}}'
236
+
--json '{"jsonrpc":"2.0","method":"tools/call","id":2,"params":{"name":"notification_tool","arguments":{"message":"Hello from cURL!","delay":0.5},"_meta":{"progressToken":"curl-progress"}}}'
237
+
```
238
+
239
+
### Testing the modern lifecycle with cURL
240
+
241
+
The modern lifecycle (2026-07-28, SEP-2575) is sessionless: there is no `initialize` handshake and no `Mcp-Session-Id`. Start `examples/modern_http_server.rb` and walk it manually:
4. Observe a multi round-trip result (SEP-2322), then resume it by echoing the `requestState` back together with the answer. Declaring the `elicitation` capability in the envelope is required before the server may embed elicitation requests:
0 commit comments