Accept GET requests for SSE streams with an empty, immediately-completed stream. This used to be a 405 "Method Not Allowed", but that caused the dev server to close the connection, introducing intermittent Claude connectivity timeouts.
()
| 168 | return _json_response(response_data) |
| 169 | |
| 170 | def _handle_get(): |
| 171 | """ |
| 172 | Accept GET requests for SSE streams with an empty, immediately-completed |
| 173 | stream. This used to be a 405 "Method Not Allowed", but that caused the |
| 174 | dev server to close the connection, introducing intermittent Claude |
| 175 | connectivity timeouts. |
| 176 | """ |
| 177 | resp = app.backend.make_response( |
| 178 | ": mcp stream open\n\n", |
| 179 | content_type="text/event-stream", |
| 180 | status=200, |
| 181 | ) |
| 182 | resp.headers["Cache-Control"] = "no-cache, no-transform" |
| 183 | if _session_id is not None: |
| 184 | resp.headers["Mcp-Session-Id"] = _session_id |
| 185 | return resp |
| 186 | |
| 187 | def _handle_delete(): |
| 188 | """Return 405 for DELETE; the spec allows refusing session teardown.""" |
nothing calls this directly
no test coverage detected
searching dependent graphs…