Commit 3c14529
Implement MCP spec-compliant stdio shutdown sequence
Following the MCP spec recommendations, the shutdown sequence now:
1. Closes stdin first to allow graceful server exit
2. Waits 2 seconds for the server to exit on its own
3. Only escalates to SIGTERM if the server doesn't exit
4. Finally uses SIGKILL as a last resort
This unified approach works consistently across all platforms and gives
well-behaved servers a chance to exit cleanly without signals.
Co-Authored-By: davenpi <noreply@github.com>1 parent 1d495ca commit 3c14529
1 file changed
+25
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
181 | 191 | | |
182 | | - | |
| 192 | + | |
183 | 193 | | |
184 | 194 | | |
185 | 195 | | |
186 | | - | |
187 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
188 | 208 | | |
189 | 209 | | |
190 | 210 | | |
| 211 | + | |
191 | 212 | | |
192 | 213 | | |
193 | 214 | | |
| |||
0 commit comments