Repository navigation
Avoid a second console prompt after MCP deletion approval - #316
Open
Mike Krüger (mkrueger) wants to merge 1 commit into
Open
Mike Krüger (mkrueger) wants to merge 1 commit into
Mike Krüger (mkrueger) wants to merge 1 commit into
Conversation
Mike Krüger (mkrueger)
requested review from
a team
and
a balanced review from Copilot
November 30, 2026 12:35
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change that removes redundant terminal prompts from MCP-approved deletions.
No open issues 🎉
What changed in this PR
Addresses #311 by allowing MCP-approved database and container deletions to proceed without a second terminal prompt, including on headless servers.
Changes:
- Bind MCP approval to the exact command instance and clear it after execution.
- Skip the terminal prompt for approved
rmconandrmdbcalls while preserving direct-shell confirmation and the MCP approval gate. - Add mocked HTTP regression tests for accepted, declined, and missing approval, and document the behavior.
| File | Description |
|---|---|
docs/mcp.md |
Document single-prompt MCP deletion behavior. |
CosmosDBShell/Azure.Data.Cosmos.Shell.Mcp/ToolOperations.cs |
Set invocation-scoped approval and clear it in finally. |
CosmosDBShell/Azure.Data.Cosmos.Shell.Core/CommandState.cs |
Store the exact command instance approved through MCP. |
CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/RmDbCommand.cs |
Honor MCP approval without another database deletion prompt. |
CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/RmContainerCommand.cs |
Honor MCP approval without another container deletion prompt. |
CosmosDBShell.Tests/McpConfirmationTests.cs |
Cover HTTP deletion approval and refusal paths with a mocked Cosmos backend. |
Review effort: Balanced
Code coverage overviewLanguages: C# C# / code-coverage/dotnet
View coverage of the 8 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
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.
Fixes #311.
Summary
rmconandrmdbwithout a second terminal prompt after MCP approval and shell-context revalidation. Approval is scoped to the exact invocation.forceis set.Validation