Skip to content

Serve rails-hyperdrive over stdio so it connects without bin/dev - #58

Merged
6temes merged 1 commit into
mainfrom
hyperdrive-mcp-stdio
Oct 28, 2026
Merged

6temes merged 1 commit into
mainfrom
hyperdrive-mcp-stdio

Conversation

@6temes

@6temes 6temes commented Oct 28, 2026

Copy link
Copy Markdown
Owner

The rails-hyperdrive MCP server now connects in every agent session, whether or not bin/dev is running. Before this, .mcp.json pointed at the HTTP endpoint on port 3000, so most sessions started with the server failed (ECONNREFUSED). Now each session spawns bin/hyperdrive-mcp, which boots the app and serves the same tools over stdio. The HTTP engine mount in development stays as it was.

Two things in the script look arbitrary but aren't:

  • It boots with $stdout pointed at stderr and gives stdout back only to the transport. SemanticLogger binds an appender to whatever $stdout is at boot, and one log line on stdout breaks the protocol.
  • rails/hyperdrive/mcp_server has to be required before mcp/server/transports/stdio_transport. In the other order, loading fails with a NameError on MCP::Server::Transports::StreamableHTTPTransport::Methods.

Validation: I piped initialize, notifications/initialized, tools/list and a run_sql call into the script. Every stdout line was valid JSON-RPC, and all eight hyperdrive tools were listed. claude mcp get rails-hyperdrive reports it as Connected over stdio.

@6temes
6temes merged commit 270d8d8 into main Oct 28, 2026
5 checks passed
@6temes
6temes deleted the hyperdrive-mcp-stdio branch October 28, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant