-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Summary
When Blitz 1.0.29 is configured as an MCP server in Codex (codex-cli 0.116.0) via ~/.blitz/blitz-mcp-bridge.sh, Codex reports MCP startup failed: Transport closed.
After tracing it, the failure happens because Blitz's /mcp endpoint returns a JSON-RPC response body to the notifications/initialized notification:
{"jsonrpc":"2.0","id":null,"result":{}}That response is invalid for a notification, and Codex closes the connection after parsing it.
Environment
- Blitz.app 1.0.29
- macOS 15.5 (24F74), arm64
- codex-cli 0.116.0
Repro
- Start Blitz.
- Read the port from
~/.blitz/mcp-port. - POST
initialize:
PORT=$(cat ~/.blitz/mcp-port)
curl -sS -D - -o /tmp/blitz-init.out -X POST "http://127.0.0.1:${PORT}/mcp" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl-test","version":"0"}}}'
cat /tmp/blitz-init.outThis returns a valid initialize response.
- POST
notifications/initialized:
PORT=$(cat ~/.blitz/mcp-port)
curl -sS -D - -o /tmp/blitz-initialized.out -X POST "http://127.0.0.1:${PORT}/mcp" \
-H 'Content-Type: application/json' \
--data '{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}'
cat /tmp/blitz-initialized.outActual body:
{"jsonrpc":"2.0","id":null,"result":{}}Codex-side symptom
Blitz MCP log:
Connection established with capabilities: {"hasTools":true,"hasPrompts":false,"hasResources":false,"serverVersion":{"name":"blitz-mcp","version":"1.0.0"}}
STDIO connection dropped after 0s uptime
Connection error: ... id expected string/number received null ... method expected string received undefined ... unrecognized key "result"
Codex then reports:
MCP startup failed: Transport closed
Additional findings
tools/listandapp_get_statework if I send valid requests directly, so the breakage appears specific to thenotifications/initializedpath rather than general connectivity.- Current
masterappears to have a newerscripts/blitz-mcp-bridge.shthat suppresses notification responses before they reach stdout. - The installed
~/.blitz/blitz-mcp-bridge.shon my 1.0.29 machine still echoes every HTTP response, so the invalid server response is forwarded directly into Codex. - The HTTP server itself still appears to be non-compliant on
masterinsrc/services/MCPServerService.swift: thenotifications/initializedcase sets an empty result, and the shared response wrapper emits a JSON-RPC object withidset toNSNull().
Expected
notifications/initializedshould not produce a JSON-RPC response body at all.- The installed bridge script should match the current repo behavior and discard notification responses if the server still emits them.
- Codex and other MCP clients should complete startup successfully.
Actual
/mcpreturns{"jsonrpc":"2.0","id":null,"result":{}}fornotifications/initialized- the installed bridge forwards that to stdout
- Codex parses it as invalid and tears down the MCP connection
(Bug report and findings discovered and reported by Codex)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels