fix(gsd): auto-prepare workflow MCP across providers - #731
Draft
jeremymcs wants to merge 3 commits into
Draft
Conversation
Contributor
🟢 PR Risk Report — LOW
|
jeremymcs
marked this pull request as draft
June 16, 2026 12:02
jeremymcs
force-pushed
the
fix/mcp-auto-init-paths-v2
branch
from
July 7, 2026 21:02
988a21d to
3c49122
Compare
Member
Author
|
Started an automated PR update. Accepted review feedback is being applied. |
jeremymcs
added a commit
that referenced
this pull request
Jul 7, 2026
jeremymcs
added a commit
that referenced
this pull request
Jul 7, 2026
jeremymcs
force-pushed
the
fix/mcp-auto-init-paths-v2
branch
from
July 7, 2026 21:38
32de603 to
75aac57
Compare
- Add missing cwd to PATH lookup fallback in detectWorkflowMcpLaunchConfig - Remove provider=claude-code gate from shouldAutoPrepareWorkflowMcp - Gate auto-prep on .gsd directory existence to avoid dirtying non-GSD repos - Simplify prepareWorkflowMcpForProject by removing dead model-override plumbing
jeremymcs
force-pushed
the
fix/mcp-auto-init-paths-v2
branch
from
July 9, 2026 03:19
75aac57 to
6d9924d
Compare
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.
Intent
Ensure the GSD MCP Server auto-initializes on correct paths for all providers. Three fixes: (1) Added missing cwd to PATH lookup fallback. (2) Removed provider gate — always returns true. (3) Added .gsd directory gate to avoid dirtying non-GSD repos. User chose fix per review finding.
What Changed
.gsddirectory.gsd-mcp-serverlaunches use the resolved workflow project root ascwd.Risk Assessment
✅ Low: The branch is narrowly scoped to MCP auto-prep gating/path wiring and the changed behavior is covered by nearby callers without a substantiated blocking regression in the reviewed diff.
Testing
After confirming the target commit was not already merged, I restored minimal local setup, ran focused MCP auto-prep and launch-config regression selectors, and generated reviewer-visible evidence showing an OpenAI-provider GSD project auto-created project-scoped
.mcp.json/Claude settings while a non-GSD project created no files; broad hook-level test attempts were blocked by missing broader workspace dist setup rather than behavior assertions, and transientnode_modules/dist artifacts were removed before finish.Evidence: MCP auto-init transcript
Evidence: Generated .mcp.json
Evidence: Generated Claude local settings
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
git status --short --branch && git rev-parse HEAD && git branch --show-current && git merge-base --is-ancestor HEAD origin/main; echo $?sed -n '1,220p' CONTRIBUTING.mdgit diff --stat 4eeef20030eeadeb444e0f0faac7dca10d439fd1..4a4fce7907a63c565e2329b50f2d004386766841 && git diff --name-only 4eeef20030eeadeb444e0f0faac7dca10d439fd1..4a4fce7907a63c565e2329b50f2d004386766841pnpm install --frozen-lockfile(setup attempt; stopped after postinstall hung in unrelated optional setup)PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 GSD_SKIP_RTK_INSTALL=1 pnpm install --frozen-lockfile(setup retry; stopped after postinstall stayed in unrelated repair path)pnpm --filter @opengsd/contracts run buildnode --import ./src/resources/extensions/gsd/tests/resolve-ts.mjs --experimental-strip-types --test src/resources/extensions/gsd/tests/workflow-mcp-auto-prep.test.ts(broad attempt exposed missing workspace dist for hook-only cases)node --import ./src/resources/extensions/gsd/tests/resolve-ts.mjs --experimental-strip-types --test --test-name-pattern 'shouldAutoPrepareWorkflowMcp enables prep for any provider|prepareWorkflowMcpForProject skips non-GSD projects|prepareWorkflowMcpForProject uses the selected unit model' src/resources/extensions/gsd/tests/workflow-mcp-auto-prep.test.tsnode --import ./src/resources/extensions/gsd/tests/resolve-ts.mjs --experimental-strip-types --test --test-name-pattern 'detectWorkflowMcpLaunchConfig prefers explicit env override|detectWorkflowMcpLaunchConfig resolves the bundled server relative to the package without env hints' src/resources/extensions/gsd/tests/workflow-mcp.test.tsnode --import ./src/resources/extensions/gsd/tests/resolve-ts.mjs --experimental-strip-types --input-type=moduleevidence script creating an OpenAI-provider GSD project and a non-GSD project under the evidence directorysed -n '1,220p' /var/folders/ts/yrrr1_453qz_str8lsryw04m0000gn/T/no-mistakes-evidence/01KV39RZV8E1TXXZH40KY6WV6X/mcp-auto-init-transcript.mdrm -rf node_modules packages/contracts/dist packages/gsd-agent-core/dist && git status --short --ignored=matching node_modules packages/contracts/dist packages/gsd-agent-core/dist | head -80 && git status --short⏭️ **Document** - skipped
Step was skipped.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Note
Low Risk
Narrow MCP config gating and launch
cwdwiring with updated unit tests; no auth or core workflow execution changes.Overview
Workflow MCP auto-prep no longer depends on the active model provider or Claude-specific transport checks:
shouldAutoPrepareWorkflowMcpalways allows prep so project.mcp.jsoncan be written for directclaudeCLI use even when the session runs on another provider.Writes are gated to repos that already have a
.gsddirectory, so auto-prep does not add.mcp.json/.claude/settings.local.jsonto unrelated projects. Model-override merging inprepareWorkflowMcpForProjectis removed in favor of that simpler gate.Launch config sets
cwdto the resolved workflow project root whengsd-mcp-serveris discovered on PATH, matching other discovery paths.Tests cover provider-independent prep, skipping non-GSD roots, and initialized GSD project setup.
Reviewed by Cursor Bugbot for commit 4a4fce7. Bugbot is set up for automated code reviews on this repo. Configure here.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is enabled.