Commit 9da43bc
Fix SSE server crash by starting notification timers only after client connects
- Move setInterval calls from server creation to startNotificationIntervals function
- Only start notification timers when a client actually connects to the SSE server
- Prevents 'Not connected' error when server tries to send notifications before client connection
- Fixes issue where server crashes after 5 seconds when running 'npx @modelcontextprotocol/server-everything sse'
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Ola Hungerford <olaservo@users.noreply.github.com>1 parent fcb550e commit 9da43bc
2 files changed
+29
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | 172 | | |
183 | 173 | | |
184 | 174 | | |
| |||
198 | 188 | | |
199 | 189 | | |
200 | 190 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
210 | 215 | | |
211 | 216 | | |
212 | 217 | | |
| |||
874 | 879 | | |
875 | 880 | | |
876 | 881 | | |
877 | | - | |
| 882 | + | |
878 | 883 | | |
879 | 884 | | |
880 | 885 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
0 commit comments