feat(cli): add 'tools approve|reject' for pending tool quarantine (MCP-2919)#722
Merged
Merged
Conversation
Add CLI commands to clear tools pending tool-level quarantine (Spec 032) without the Web UI or MCP: mcpproxy tools approve <server:tool>... # approve specific tools mcpproxy tools approve --server <name> --all # approve all pending/changed mcpproxy tools reject <server:tool>... # block = approve+disable mcpproxy tools reject --server <name> --all Targets accept the <server>:<tool> format used elsewhere, or bare tool names scoped via --server. reject maps to the atomic block endpoint (approve+disable), mirroring the Web UI "Block" action. - Add cliclient.BlockTools sibling to ApproveTools (POST /tools/block). - Group targets per server; process independently; -o json|yaml emits a structured per-server result array. - Docs: document both subcommands in cli-management-commands.md. Related #MCP-2919
Deploying mcpproxy-docs with
|
| Latest commit: |
3b92de4
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://44febbe0.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://feat-mcp-2919-tools-approve.mcpproxy-docs.pages.dev |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 27810813887 --repo smart-mcp-proxy/mcpproxy-go
|
There was a problem hiding this comment.
Approved via Claude Code review (MCP-2919). CLI tools approve|reject: per-server arg grouping, --all requires --server, reject=block endpoint; cliclient BlockTools mirrors ApproveTools with correct payloads. go build OK; go test -race ./cmd/mcpproxy ./internal/cliclient pass; golangci-lint v2 0 issues; CI 34/34 green.
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 CLI commands to approve / reject tools pending tool-level quarantine (Spec 032), so operators can clear pending/changed tools without the Web UI or MCP. Previously only server-level
mcpproxy security approve|rejectexisted; there was no per-tool approve/reject.<server>:<tool>format used elsewhere; bare tool names can be scoped with--server.rejectmaps to the block endpoint (atomic approve+disable), mirroring the Web UI "Block".-o json|yaml/--json/MCPPROXY_OUTPUTsupported viaResolveOutputFormat()+clioutput; default table output prints a concise per-server confirmation.Wiring
POST /api/v1/servers/{id}/tools/approveand.../tools/block.cliclientalready hadApproveTools; this adds a siblingBlockTools(POST/tools/block, readsdata.blocked).runSecurityApprove(socket detection + API-key fallback vianewSecurityCLIClient); multi-target grouping mirrorsrunToolsSetEnabled.Tests (TDD)
internal/cliclient/client_block_tools_test.go—BlockToolsrequest shape (specific tools,block_all, API error).cmd/mcpproxy/tools_approval_test.go— arg parsing:server:toolsplit, bare-tool--serverscoping,--allrequires--server,--allrejects positional, mixed colon/flag grouping, no-target guidance.Verification
go test ./cmd/mcpproxy/... ./internal/cliclient/... -race— green.go build -o mcpproxy ./cmd/mcpproxy— green.golangci-lint run --config .github/.golangci.yml(v2) on changed packages — 0 issues.tools approve gcore-mcp-server:cdn_client_config_get→ flippedpending→approved.tools approve --server gcore-mcp-server cdn_cdn_resources_ls -o json→ structured result.tools reject hugginface:hf_doc_search→ tool nowapprovedanddisabled:true(block semantics).tools approve --server hugginface --all→ safe no-op (0 pending).--allwithout--server, bare tool without--server, no targets) exit non-zero with guidance.Docs
docs/cli-management-commands.mddocuments both subcommands, flags, examples, and behavior (ENG-9).Related #MCP-2919