Skip to content

feat(api): project source registry provenance onto contracts.Server (MCP-901)#577

Merged
Dumbris merged 1 commit into
mainfrom
feat/mcp-901-server-source-registry
Jun 3, 2026
Merged

feat(api): project source registry provenance onto contracts.Server (MCP-901)#577
Dumbris merged 1 commit into
mainfrom
feat/mcp-901-server-source-registry

Conversation

@Dumbris
Copy link
Copy Markdown
Member

@Dumbris Dumbris commented Jun 2, 2026

Summary

The REST contracts.Server projection (served by GET /api/v1/servers and embedded in the SSE servers.changed event) omitted source_registry_id and source_registry_provenance, so the server approval/quarantine view could not show where a server came from — even though config.ServerConfig already records both at add-time (MCP-866).

This adds both fields to contracts.Server and populates them at every ServerConfig → contracts.Server projection site:

  • Runtime.GetAllServers — emits the fields into the server map from serverStatus.Config, on both the StateView happy path and the legacy storage fallback.
  • management.ListServers — extracts them onto contracts.Server. The SSE servers.changed embed shares this exact projection (buildServersChangedPayload → ListServers), so it stays in parity automatically (no second site to keep in sync).
  • contracts.ConvertGenericServersToTyped (legacy httpapi fallback) and contracts.ConvertServerConfig also 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

  • TDD: added failing tests first, then implemented.
    • internal/contracts: TestConvertGenericServersToTyped_SourceRegistry, TestConvertServerConfig_SourceRegistry (set + absent cases).
    • internal/management: TestListServerssource registry provenance projected subtest (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 swagger regenerated; diff confined to the two new contracts.Server fields (+12 lines, no stale churn).

Related #575

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
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

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

View logs

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 52.63158% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/runtime/runtime.go 0.00% 9 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

📦 Build Artifacts

Workflow Run: View Run
Branch: feat/mcp-901-server-source-registry

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (25 MB)
  • archive-linux-amd64 (16 MB)
  • archive-linux-arm64 (14 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (24 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (21 MB)
  • installer-dmg-darwin-arm64 (19 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 26842505720 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris Dumbris merged commit cdf1a0a into main Jun 3, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants