Add confirmed repository deletion tool - #3076
Open
SamMorrowDrums wants to merge 1 commit into
Open
Conversation
Add a destructive delete_repository tool that requires an exact owner/repo confirmation through multi-round-trip elicitation. Gate the tool to MCP protocol 2026-07-28 and newer across local and remote transports. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4b04480c-c2e9-483e-9b0f-34830b76a2f8
Contributor
There was a problem hiding this comment.
Pull request overview
Adds protocol-gated, elicitation-confirmed repository deletion.
Changes:
- Adds
delete_repositorywithdelete_reposcope and destructive annotations. - Filters tools by minimum MCP protocol version.
- Adds schema, unit, transport, and documentation updates.
Show a summary per file
| File | Description |
|---|---|
README.md |
Documents the new tool. |
pkg/scopes/scopes.go |
Defines delete_repo. |
pkg/scopes/scopes_test.go |
Tests scope expansion. |
pkg/inventory/server_tool.go |
Adds minimum protocol metadata. |
pkg/inventory/registry.go |
Installs protocol filtering. |
pkg/inventory/protocol_version.go |
Implements listing/call filtering. |
pkg/inventory/protocol_version_test.go |
Tests protocol gating. |
pkg/http/handler_test.go |
Tests HTTP tool visibility. |
pkg/github/tools.go |
Registers the deletion tool. |
pkg/github/repositories.go |
Implements confirmation and deletion. |
pkg/github/repositories_test.go |
Tests deletion and elicitation. |
pkg/github/helper_test.go |
Adds the mock endpoint constant. |
pkg/github/__toolsnaps__/delete_repository.snap |
Captures the tool schema. |
internal/ghmcp/oauth.go |
Reuses the protocol constant. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 14/14 changed files
- Comments generated: 1
- Review effort level: Balanced
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
Adds a destructive
delete_repositoryMCP tool that deletes a repository only after the user enters the exactowner/reponame through elicitation. The tool is exposed only for MCP protocol2026-07-28and newer.Why
Repository deletion needs a stronger confirmation boundary than ordinary write operations, and the remote server supports the required multi-round-trip elicitation only on the current MCP protocol.
N/A - no linked issue.
What changed
delete_repositorywith thedelete_repoOAuth scope, destructive annotations, and exact repository-name confirmation.tools/listand directtools/callrequests across stdio and remote HTTP transports.MCP impact
The new schema accepts
ownerandrepo; execution then requestsrepository_namethrough multi-round-trip form elicitation before calling GitHub's delete repository API.Prompts tested (tool changes only)
owner/reporepository" - automated in-memory MCP coverage verifies elicitation, exact matching, refusal paths, and successful deletion.Security / limits
The tool requires the dedicated
delete_repoOAuth scope, refuses declined or mismatched confirmation, and is filtered out for protocol versions before2026-07-28in both local and remote deployments.Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testDocs