fix(gstack-gbrain-detect): include 'url' in Tier 1 $mtype case for Streamable HTTP MCP#1373
Closed
marko-durasic wants to merge 1 commit intogarrytan:mainfrom
Closed
Conversation
…treamable HTTP MCP
`bin/gstack-gbrain-detect` runs a 3-tier fallback to determine
`gbrain_mcp_mode`. Tier 1 calls `claude mcp get gbrain --json` and
matches `\$mtype` against `http|sse`. Tier 3 (`~/.claude.json` jq
fallback) and every `SKILL.md` preamble in this repo correctly match
`url|http|sse`.
Anthropic's "Streamable HTTP" MCP transport reports `type: "url"`. So
when `claude mcp get gbrain --json` returns `{"type": "url", ...}`
without a top-level `url` field, Tier 1 falls through to the `*`
wildcard, finds `\$murl` empty, and returns `none` while Tier 3 (and
the SKILL.md preambles consumers rely on) would correctly return
`remote-http`. Result: `/setup-gbrain` and downstream skills can
misread the current MCP mode for users on the `url` transport.
This is a one-line fix bringing Tier 1 in line with Tier 3 — the
`stdio` arm is also re-aligned in the same case block to keep the
visual columns intact.
Verified with `bash -n bin/gstack-gbrain-detect` (clean parse).
Discovery context: surfaced while comparing DuReef's vendored gstack
mirror at db9447c (which predates the 3-tier detect block) against
upstream HEAD 443bde0; the inconsistency showed up immediately
because Tier 3 in the same file was already correct.
Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
Sibling PR: #1372 (restore |
4 tasks
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.
Problem
bin/gstack-gbrain-detectruns a 3-tier fallback to determinegbrain_mcp_mode. Tier 1 callsclaude mcp get gbrain --jsonand matches$mtype:Tier 3 (
~/.claude.jsonjq fallback) — and everySKILL.mdpreamble that documents the same logic — correctly matchurl|http|sse:Anthropic's "Streamable HTTP" MCP transport reports
type: "url". Whenclaude mcp get gbrain --jsonreturns{"type": "url", ...}without a top-levelurlfield (some claude CLI versions omit it when the URL is implicit in the config), Tier 1 falls through to*, sees$murlis empty, and returnsnone. Tier 3 — looking at the same~/.claude.json— would correctly sayremote-http.So the detect script's output can disagree with what the SKILL.md preambles tell skills to expect, and
/setup-gbrain(and any downstream skill that branches ongbrain_mcp_mode) can misread the current mode.Fix
Add
urlto the Tier 1 case branch, matching Tier 3 and the SKILL.md preambles. Thestdioarm is re-aligned in the same case block to keep the visual columns intact (cosmetic only):Diff is +2/-2 lines, fully scoped to
bin/gstack-gbrain-detect.Test plan
bash -n bin/gstack-gbrain-detect— clean parse.SKILL.mdpreambles already matchurl|http|sse, so this PR brings Tier 1 in line with established convention rather than introducing a new behavior.gstack-gbrain-detect | jq .gbrain_mcp_modeagainst an Anthropic CLI configured with theurltransport — best verified by maintainer with a real claude install.Discovery context
Found while reconciling DuReef's vendored
gstackmirror atdb9447c3(which predates the 3-tier detect block) against upstream HEAD443bde05. The Tier 1 / Tier 3 mismatch was visible immediately because Tier 3 was already correct in the same file.Companion DuReef-side bookkeeping: DuReef/workspace#49 — read-only watch entry in our
PORT-CANDIDATES.mdso reviewers know to refuse this regression on the nextchore(inspiration)sync if this upstream PR isn't merged first.Out of scope
VERSION/CHANGELOG.mdbump (left to maintainer's release cadence).gstack-gbrain-sync.ts's lock keepalive (filed separately as a sibling PR).Made with Cursor
Need help on this PR? Tag
@codesmithwith what you need.