feat(registry): add remove path for user-added custom registries (MCP-1057)#592
Merged
Conversation
Custom registry sources added via `registry add-source` could not be
removed through any supported surface — the only recourse was hand-editing
config.db and restarting the daemon. Add the inverse remove operation:
- DELETE /api/v1/registries/{id} — removes a custom/unverified source,
refusing built-ins via the same registry_shadows_builtin guard and
returning registry_not_found (404) for unknown ids. Persisted
copy-on-write like add-source.
- `mcpproxy registry remove <id>` CLI (aliases: rm, remove-source),
daemon-required, with remove-specific error guidance.
- cliclient.RemoveRegistrySource wrapping the DELETE endpoint.
- Shared server-side derivation (removeRegistrySourceFromConfig) so CLI
and REST produce identical persisted config.
Docs (registries.md, rest-api.md) and OpenAPI spec updated in the same PR.
The Web UI affordance is tracked as a separate frontend follow-up.
Related #MCP-1057
Deploying mcpproxy-docs with
|
| Latest commit: |
f63bc00
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://53f7d2ee.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://feat-registry-remove-source.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 26941081762 --repo smart-mcp-proxy/mcpproxy-go
|
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 the missing remove path for user-added custom registries (gap found during QA in MCP-1053). A custom registry added via
registry add-sourcepreviously could not be removed through any supported surface — the only recourse was hand-editingconfig.dband restarting the daemon. This is the inverse operation, mirroring add-source exactly.What's included (backend lane:
internal/+cmd/+ docs)DELETE /api/v1/registries/{id}— removes acustom/unverifiedsource. Refuses built-ins via the sameregistry_shadows_builtinguard add-source uses (409), returnsregistry_not_found(404) for unknown ids,registries_locked(403) when the enterprise stub policy is set. Persisted copy-on-write viaUpdateConfig(runtime-config-snapshot-COW rule), thenSetRegistriesFromConfigso the source disappears immediately.mcpproxy registry remove <id>(aliasesrm,remove-source), daemon-required like add-source, with remove-specific error guidance.RemoveRegistrySource(ctx, id)wrapping the DELETE endpoint.removeRegistrySourceFromConfigso CLI and REST produce an identical persisted config.docs/registries.md,docs/api/rest-api.md, and regeneratedoas/swagger.yaml/docs.goin the same PR (ENG-9).Removing a source does not touch any upstream servers already added from it.
Tests (TDD)
internal/server: pure removal-logic unit tests — removes custom, case-insensitive, refuses built-in, not-found, empty-id, refuses-locked, error-code mapping.internal/httpapi: handler tests for 200 (removes custom,trusted=false), 409 (built-in), 404 (unknown).Verification evidence
go test ./internal/server ./internal/httpapi ./internal/cliclient ./cmd/mcpproxy(new tests) — PASS./scripts/run-linter.sh— 0 issuesgofmt/go vet— cleanTestBinaryStartupAndShutdown,TestMCPProtocolToolCalling) — PASS after building the binaryOut of scope (follow-up)
frontend/src/), tracked as a separate follow-up issue for the Frontend engineer.Related #MCP-1057