mcp: register Claude over HTTP by default, keep stdio as fallback - #29
Open
shakhin85 wants to merge 1 commit into
Open
mcp: register Claude over HTTP by default, keep stdio as fallback#29shakhin85 wants to merge 1 commit into
shakhin85 wants to merge 1 commit into
Conversation
The HTTP server is already started unconditionally for prime.sh hooks and non-Claude assistants, so for Claude we can connect to that same endpoint instead of spawning a parallel stdio process. Stdio remains as a compatibility fallback for older claude CLI builds without --transport support. Replaces the binary _CLAUDE_NEEDS_HTTP flag with _CLAUDE_TRANSPORT (http|sse|stdio) for clearer logs.
|
GrapeRoot Review — No issues found. This PR looks clean. Powered by GrapeRoot — graph-aware AI review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bin/dual_graph_launch.shfrom stdio-first to HTTP-first.127.0.0.1:$MCP_PORT/mcpis already started unconditionally (line ~1298+) forprime.shhooks and non-Claude assistants, so Claude can connect to the same endpoint instead of spawning a parallel stdio process.claudeCLI builds that lack--transport httpsupport._CLAUDE_NEEDS_HTTPflag with_CLAUDE_TRANSPORT(http|sse|stdio) so the final log line tells the user exactly which transport was registered.Why
In some environments the stdio transport never establishes a session with Claude Code (no errors surfaced, MCP just sits disconnected) even though the HTTP server is healthy. Since HTTP is the canonical transport every other consumer of the dual-graph already uses, treating it as the Claude default removes a class of "MCP disconnected" reports without losing compatibility — stdio falls through automatically if the HTTP registration step fails.
Behavior
claude mcp add --transport http→ tried first--transport sse→ second-- mcp-graph-server --stdio) → last resort, kept inside the auto-fix retry block tooFinal user-facing log:
(or
(SSE)/stdio (HTTP unavailable, fallback)depending on which branch won).Test plan
bash -n bin/dual_graph_launch.sh— syntax OKdgcon Ubuntu — Claude connects via HTTP, MCP tools availableclaudeCLI (without--transport) still works via stdio fallback