feat(api): project source registry provenance onto contracts.Server (MCP-901)#577
Merged
Merged
Conversation
The REST contracts.Server projection omitted source_registry_id and source_registry_provenance, so the server approval/quarantine view could not show where a server originated even though config.ServerConfig records both at add-time (MCP-866). Add both fields to contracts.Server and populate them at every ServerConfig -> contracts.Server projection site: - Runtime.GetAllServers (StateView path + legacy storage fallback) emits the fields into the server map from serverStatus.Config. - management.ListServers extracts them onto contracts.Server. The SSE servers.changed embed shares this projection (buildServersChangedPayload -> ListServers), so it stays in parity automatically. - contracts.ConvertGenericServersToTyped (legacy fallback) and contracts.ConvertServerConfig also carry them. Both fields are json-omitempty and optional; clients that pre-date this treat them as absent. Regenerated the OpenAPI spec to document them. A frontend follow-up renders an "added from <registry> · unverified" badge on ServerCard/ServerDetail. Related #575
Deploying mcpproxy-docs with
|
| Latest commit: |
741af67
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a5bf1abe.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://feat-mcp-901-server-source-r.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 26842505720 --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
The REST
contracts.Serverprojection (served byGET /api/v1/serversand embedded in the SSEservers.changedevent) omittedsource_registry_idandsource_registry_provenance, so the server approval/quarantine view could not show where a server came from — even thoughconfig.ServerConfigalready records both at add-time (MCP-866).This adds both fields to
contracts.Serverand populates them at everyServerConfig → contracts.Serverprojection site:Runtime.GetAllServers— emits the fields into the server map fromserverStatus.Config, on both the StateView happy path and the legacy storage fallback.management.ListServers— extracts them ontocontracts.Server. The SSEservers.changedembed shares this exact projection (buildServersChangedPayload → ListServers), so it stays in parity automatically (no second site to keep in sync).contracts.ConvertGenericServersToTyped(legacy httpapi fallback) andcontracts.ConvertServerConfigalso carry them.Both fields are
json:",omitempty"and optional — clients that pre-date this treat them as absent. The OpenAPI spec is regenerated to document them.A frontend follow-up will render an "added from · unverified" badge on
ServerCard/ServerDetail(the FE already treats these as optional, forward-compatible).Test plan
internal/contracts:TestConvertGenericServersToTyped_SourceRegistry,TestConvertServerConfig_SourceRegistry(set + absent cases).internal/management:TestListServers→source registry provenance projectedsubtest (set + manual-server-empty cases).go build ./...— clean.go test ./internal/contracts/... ./internal/management/... ./internal/runtime/... -race— all green (full runtime suite passes under-race)../scripts/run-linter.sh— 0 issues.make swaggerregenerated; diff confined to the two newcontracts.Serverfields (+12 lines, no stale churn).Related #575