MCP HTTP transport returns 200 for notifications/initialized, causing Codex handshake failure. Should return `202 Accepted` with no response body
What is your setup?
Hosted Leantime instance with the MCP Server plugin, authenticated using a Leantime API key in the x-api-key header.
Client:
- Codex CLI/Desktop MCP client
codex-cli 0.154.0-alpha.6.2- macOS 15.5
The MCP server identifies itself as Leantime MCP Server 1.0.0 and negotiates protocol version 2025-06-18.
Describe the issue
Codex successfully sends initialize and receives a valid response, but the MCP connection closes when Codex sends the required notifications/initialized notification.
Codex reports:
MCP startup failed: handshaking with MCP server failed:
Transport channel closed, when send initialized notificationDirect authenticated JSON-RPC calls to initialize, tools/list, and tools/call work correctly, so authentication and tool discovery are not the problem.
Reproduction
- Send an authenticated
initializerequest to/mcp. - Send the initialized notification:
curl -i -X POST 'https://itodos.com/mcp' \
-H 'x-api-key: <API_KEY>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
--data '{"jsonrpc":"2.0","method":"notifications/initialized"}'Actual behavior
The server returns:
HTTP/2 200
content-type: application/json
content-length: 0Codex then closes the transport and native MCP tool loading fails.
Expected behavior
Under the MCP Streamable HTTP transport specification, a successfully accepted client notification should receive 202 Accepted with no response body. The server should return that status for JSON-RPC notifications without an id, including notifications/initialized.
Specification: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#sending-messages-to-the-server
Suggested fix
Return HTTP 202 Accepted with an empty body for accepted JSON-RPC notifications. It would also be useful to add an acceptance test covering the complete handshake:
initialize -> notifications/initialized -> tools/list
Related issues
- #3084 reports a more general MCP connection problem through the proxy.
- #3219 concerns session persistence and tool-cache failures.
Neither appears to cover this notification acknowledgement/status-code mismatch.
Source: Leantime/leantime