Skip to content

Gasoline v5.5.0: Rock-Solid MCP Protocol Compliance

Gasoline v5.5.0 is a stability release focused on MCP protocol compliance. If you experienced “Unexpected end of JSON input” errors or connection issues with Claude Desktop or Cursor, this release fixes them all.

The Problem: Intermittent Connection Failures

Section titled “The Problem: Intermittent Connection Failures”

Users reported sporadic errors when connecting to Gasoline via Claude Desktop:

[error] Unexpected end of JSON input

The MCP server appeared to be working — valid JSON responses were logged — but immediately after each response, a parse error occurred.

Our investigation uncovered three distinct MCP protocol violations:

Go’s json.Encoder.Encode() adds a trailing newline to JSON output. Our stdio bridge then called fmt.Println(), adding a second newline. The empty line between messages was parsed as an empty JSON message, causing the parse error.

Fix: Changed fmt.Println(string(body)) to fmt.Print(string(body)) in the bridge — the HTTP response already includes the trailing newline.

JSON-RPC 2.0 notifications (requests without an id field) must not receive responses. We were responding to notifications/initialized with an empty response, violating the spec.

Fix: Notifications now return nil from the handler and receive no response. HTTP transport returns 204 No Content.

The stdio bridge could exit before the final response was written to stdout, truncating the last message.

Fix: Implemented an exit gate pattern — the process waits for any pending responses to flush before exiting.

v5.5.0 adds 10 new Go tests that verify MCP protocol compliance:

  • TestMCPProtocol_ResponseNewlines — exactly one trailing newline per response
  • TestMCPProtocol_NotificationNoResponse — notifications receive no response
  • TestMCPProtocol_JSONRPCStructure — valid JSON-RPC 2.0 structure
  • TestMCPProtocol_IDNeverNull — response ID is never null (Cursor requirement)
  • TestMCPProtocol_ErrorCodes — standard JSON-RPC error codes
  • TestMCPProtocol_InitializeResponse — MCP initialize handshake
  • TestMCPProtocol_ToolsListStructure — tools/list response format
  • TestMCPProtocol_HandlerUnit — handler method dispatch
  • TestMCPProtocol_HTTPHandler — HTTP transport compliance
  • TestMCPProtocol_BridgeCodeVerification — static analysis of bridge code

These tests are designed to be unalterable — they verify the MCP spec, not implementation details. Any future change that breaks MCP compliance will fail these tests.

The GitHub API version check now fails silently. Previously, rate limit errors (403) would log warnings even though version checking is non-critical.

All npm packages prior to v5.5.0 have been deprecated. Users installing old versions will see a warning directing them to upgrade.

Terminal window
npx gasoline-mcp@5.5.0

Or update your MCP configuration:

{
"mcpServers": {
"gasoline": {
"type": "stdio",
"command": "npx",
"args": ["-y", "gasoline-mcp@5.5.0", "--port", "7890", "--persist"]
}
}
}

GitHub Release