feat: expand MCP command surface#89
Merged
dubscode merged 2 commits intoMay 25, 2026
Merged
Conversation
Adds read-only stack inspection tools and AI proposal helpers. Wires landed Tier 3 mutating commands into MCP. Documents return shapes and hashed audit history. Completes DUB-50
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Completes DUB-50
|
🎉 This PR is included in version 1.10.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
TL;DR
Expands the MCP surface with branch/diff/ready/merge_check read tools, propose_branch_name/propose_commit_message/propose_pr_description helpers, and the landed Tier 3 mutating command surface, including freeze/unfreeze and reorder after merging current main. Mutating MCP history now includes redacted args plus a deterministic args_sha256 hash, including no-arg calls.
Why
External coding agents need a broader, inspectable Dubstack MCP surface to manage stacks without shelling out for every command.
AI suggestions should stay read-only so agents can propose branch names, commit messages, and PR descriptions before making an explicit mutating call.
Mutating agent calls need auditability: reviewers should see redacted arguments plus a stable hash for the complete payload.
Before
After
File-by-file
packages/cli/src/commands/mcp.ts
mod +697 / -22
Registers branch/diff/ready/merge_check, AI proposal tools, and landed Tier 3 mutating tools, including freeze/unfreeze and reorder from current main. Adds AI provider plumbing for proposal-only tools, safer split MCP handling, merge-check structured errors, reorder payload validation, and hashed audit-history logging for all mutating tools.
packages/cli/src/commands/mcp.test.ts
mod +141 / -2
Extends tools/list coverage, validates new read tools, exercises AI proposal behavior in read-only mode, and adds a regression for mutating no-arg history entries retaining {} plus args_sha256.
apps/docs/content/docs/guides/mcp.mdx
mod +67 / -1
Updates the MCP guide with expanded tool tables, AI proposal tools, return-shape examples, hashed audit-history notes, and an explicit pending note for dubstack.back, whose CLI implementation has not landed in this checkout.
Where to focus review
packages/cli/src/commands/mcp.ts: The merge from current main brought freeze/unfreeze and reorder into the MCP surface. dubstack.back remains intentionally pending because its underlying CLI command is not present.packages/cli/src/commands/mcp.ts: Mutating calls should always record redacted args and args_sha256, including {} payloads, without leaking secrets.packages/cli/src/commands/mcp.ts: propose_* tools use AI metadata generators but do not route through mutating confirmation and should work in read-only MCP mode.packages/cli/src/commands/mcp.ts: by-hunk is defensively rejected because it requires an interactive patch TTY; AI split requires explicit yes unless dry-run is true.Test plan
Quality gates
pnpm checks- passed (Passed before PR creation and again after merging origin/main; final pre-commit Biome hook also passed.)pnpm typecheck- passed (Passed before PR creation and again after merging origin/main; turbo reported 3 successful tasks.)pnpm test- passed (Passed before PR creation and again after merging origin/main; latest run: 118 test files and 1176 tests passed.)git diff --check- passed (No whitespace errors reported before commit.)Self-QA
See QA fallback evidence.
Deterministic CLI/test QA for MCP server expansion.
Acceptance criteria
Adversarial review
Iterations: 2
Remaining critical/major: 0/0
Remaining minor/nitpick: 0/0
Dependencies
Rollout
Additive MCP surface expansion. No state migration. Existing MCP clients continue to work; new tools appear in tools/list and mutating tools remain governed by mcp-mode.
Commit