Repository navigation
fix: make server add create-only across REST, MCP and Web UI (UX-01) - #1570
Merged
Merged
Conversation
Deploying mcpproxy-docs with
|
| Latest commit: |
2030ffe
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7a603a89.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-qa070-ux01-create-only-a-t9b7.mcpproxy-docs.pages.dev |
Contributor
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 38116021230 --repo smart-mcp-proxy/mcpproxy-go
|
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
…re-add works (UX-01)
This was referenced Oct 11, 2026
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.
Impact
Adding a server whose name already exists silently replaced it: args/env/quarantine reset,
createdtimestamp reset, tool approvals dropped (Web UI Manual add and MCPupstream_servers add; REST/CLI had a racy check-then-write).Cause
Server.AddServerand MCP add checked existence, then upserted viaSaveUpstreamServer; MCP add did not check at all.configWithAppendedServerappended a second same-name entry.Minimal scope (UX-01 only)
BoltDB.CreateUpstream/Manager.CreateUpstreamServerdo the existence check and put in one bbolt tx, returningstorage.ErrUpstreamExists.SaveUpstreamServerupsert is untouched.Server.createServer: runtime-config + storage check, create and copy-on-write config publish under one mutex. Used byServer.AddServer(REST, CLI via REST, registry, import) and MCP add. Error text staysserver '%s' already exists.isErrorresult namingupdate/patch, with no side effects before the check.configWithAppendedServerreplaces a same-name entry.already_exists; post-add failures are reported infailed/skippedinstead of swallowed.Compatibility
REST 409 text,
upstream add --if-not-exists(exit 0), registryErrDuplicateNameall keep matchingalready exists. No schema changes to built-in tools, no new dependencies.Verification
go test -race ./internal/storage -run CreateUpstream;go test -race ./internal/server -run 'HandleAddUpstream|ConfigWithAppendedServer|ServerAddServer_CreateOnly';go test -race ./internal/httpapi -run RunImport-skipregex: okgolangci-lint run --config .github/.golangci.yml [--build-tags server] --new-from-rev=origin/main ./...: 0 issues--if-not-existsexit 0), import all leave args/created/quarantine/tools/connection unchanged; 40 parallel REST creates x3, 12 parallel MCP, mixed REST+MCP each yield exactly one success; restart persists with no duplicates.Supersedes #1553.
Known follow-ups (out of scope)
#1558 #1559 #1560 #1561 #1562 #1563 #1564 #1565 #1566 #1567 #1568 #1569
🤖 Generated with Claude Code