diff --git a/.env.example b/.env.example index 6deabd0..786fc1b 100644 --- a/.env.example +++ b/.env.example @@ -11,11 +11,6 @@ MCP_REGISTRY_DATABASE_URL=postgres://username:password@localhost:5432/mcp-regist # For offline development, use: data/seed.json MCP_REGISTRY_SEED_FROM=https://registry.modelcontextprotocol.io/v0/servers -# Validate seed data against the registry rules on import (default: true) -# Set to false for offline development when seeding from a local file, since -# data/seed.json is not guaranteed to pass validation -MCP_REGISTRY_ENABLE_REGISTRY_VALIDATION=true - # GitHub OAuth configuration # These creds are for local development with the 'MCP Registry Login (Local)' GitHub App # They don't provide any real privileged access, hence why it's okay that they're here diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index e373661..b37dd38 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -9,5 +9,5 @@ To publish an MCP server to the registry, use the `mcp-publisher` CLI tool. See ## Development - Use `make` targets where possible (run `make help` to see available targets) -- Run `make check` to run lint, schema validation, and all tests (this also stops any running dev-compose environment) +- Run `make check` to run lint, unit tests, and integration tests - Run `make dev-compose` to start the local development environment \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ee01027..775df1b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,28 +3,28 @@ updates: - package-ecosystem: gomod directory: / groups: - go-dependencies: + opentelemetry: patterns: - - "*" + - "go.opentelemetry.io/*" schedule: interval: weekly - package-ecosystem: gomod directory: /deploy groups: - deploy-go-dependencies: + opentelemetry: patterns: - - "*" + - "go.opentelemetry.io/*" schedule: interval: weekly - package-ecosystem: github-actions directory: / groups: - github-actions: + actions: patterns: - "*" schedule: interval: weekly - - package-ecosystem: docker - directory: / + - package-ecosystem: "docker" + directory: "/" schedule: - interval: weekly + interval: "weekly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e42207..87a36bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: - name: Run lint uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a with: - version: v2.13.1 + version: v2.11.4 - name: Validate schemas and examples run: make validate diff --git a/.github/workflows/close-invalid-publish-prs.yml b/.github/workflows/close-invalid-publish-prs.yml index 53ce498..934421b 100644 --- a/.github/workflows/close-invalid-publish-prs.yml +++ b/.github/workflows/close-invalid-publish-prs.yml @@ -34,7 +34,7 @@ jobs: COMMENT_BODY: | Hi @__AUTHOR__ ๐Ÿ‘‹ โ€” thanks for your interest in the MCP Registry! - It looks like this PR is trying to publish an MCP server by adding or editing server files in this repository (under `servers/`, `data/servers/`, or in `data/seed.json`). That isn't how servers get published, so I'm closing this PR automatically. + It looks like this PR is trying to publish an MCP server by adding or editing files in this repository (under `servers/` or in `data/seed.json`). That isn't how servers get published, so I'm closing this PR automatically. **Servers are published with the [`mcp-publisher`](https://github.com/modelcontextprotocol/registry/blob/main/docs/modelcontextprotocol-io/quickstart.mdx) CLI**, not by opening a pull request against this repo. The CLI verifies that you own your namespace and submits your `server.json` directly to the live registry API. @@ -121,17 +121,10 @@ jobs: echo "No files for PR #$PR_NUMBER; skipping." exit 0 fi - # Keep this list in sync with the copy in stage 1. publish_attempt=0 other=0 for f in "${FILES[@]}"; do - if [[ "$f" == servers/* \ - || "$f" == data/servers/* \ - || "$f" == data/data/servers/* \ - || "$f" =~ ^data/[^/]*server\.json$ \ - || "$f" == "data/seed.json" \ - || "$f" == "server.json" \ - || "$f" == "servers.json" ]]; then + if [[ "$f" == servers/* || "$f" == "data/seed.json" ]]; then publish_attempt=1 else other=1 diff --git a/.github/workflows/detect-invalid-publish-prs.yml b/.github/workflows/detect-invalid-publish-prs.yml index 816e169..355521b 100644 --- a/.github/workflows/detect-invalid-publish-prs.yml +++ b/.github/workflows/detect-invalid-publish-prs.yml @@ -48,26 +48,12 @@ jobs: mapfile -t FILES < <(gh api --paginate "repos/$GH_REPO/pulls/$PR_NUMBER/files" --jq '.[].filename') if [ "${#FILES[@]}" -gt 0 ]; then # Flag only if the PR touches *exclusively* publish-attempt files - # and nothing else, so that legit PRs touching seed data - # alongside real code are left alone. - # - # Keep this list in sync with the copy in stage 2. It stays an - # explicit list rather than a broad `**/server.json` glob: - # because we require *every* file to match, an over-broad - # pattern would auto-close a legitimate single-file PR. - # data/servers/** is here because #1524 put its server.json - # there - a natural guess next to data/seed.json - and slipped - # through the original servers/**-only list. + # (servers/** and/or data/seed.json) and nothing else, so that + # legit PRs touching seed data alongside real code are left alone. publish_attempt=0 other=0 for f in "${FILES[@]}"; do - if [[ "$f" == servers/* \ - || "$f" == data/servers/* \ - || "$f" == data/data/servers/* \ - || "$f" =~ ^data/[^/]*server\.json$ \ - || "$f" == "data/seed.json" \ - || "$f" == "server.json" \ - || "$f" == "servers.json" ]]; then + if [[ "$f" == servers/* || "$f" == "data/seed.json" ]]; then publish_attempt=1 else echo "Non-publish file changed: $f" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8285c08..4405b31 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 - name: Install Syft - uses: anchore/sbom-action/download-syft@v0.24.2 + uses: anchore/sbom-action/download-syft@v0.24.0 - name: Run GoReleaser uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 diff --git a/.golangci.yml b/.golangci.yml index 571ead5..5f3ad3c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -22,7 +22,7 @@ linters: - gocyclo - godox - gomoddirectives - - gomodguard_v2 + - gomodguard - goprintffuncname - gosec - grouper @@ -55,10 +55,6 @@ linters: max-complexity: 20 dupl: threshold: 300 - goconst: - # Repeated literals in tests are fixture data ("1.0.0", "Test server", ...); - # hoisting them into constants hurts readability more than it helps. - ignore-tests: true gocognit: min-complexity: 51 nestif: diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..e69de29 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a1e1b5..a5a42cb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,8 +32,7 @@ See the [README](README.md#quick-start) for prerequisites and instructions on ru ### Running checks ```bash -# Run lint, schema validation, and all tests -# Note: this also runs `make dev-down`, stopping any running dev-compose environment +# Run lint, unit tests and integration tests make check ``` diff --git a/README.md b/README.md index 8178365..5424e0d 100644 --- a/README.md +++ b/README.md @@ -32,9 +32,9 @@ Often (but not always) ideas flow through this pipeline: #### Pre-requisites - **Docker** -- **Go** - version per the `go` directive in [go.mod](./go.mod); the Go toolchain fetches it for you +- **Go 1.24.x** - **ko** - Container image builder for Go ([installation instructions](https://ko.build/install/)) -- **golangci-lint** - version per the `golangci-lint-action` pin in [ci.yml](./.github/workflows/ci.yml), so local lint matches CI +- **golangci-lint v2.4.0** #### Running the server @@ -94,8 +94,7 @@ See [the publisher guide](./docs/modelcontextprotocol-io/quickstart.mdx) for mor #### Other commands ```bash -# Run lint, schema validation, and all tests -# Note: this also runs `make dev-down`, stopping any running dev-compose environment +# Run lint, unit tests and integration tests make check ``` @@ -111,8 +110,7 @@ For Claude and other AI tools: Always prefer make targets over custom commands w ``` โ”œโ”€โ”€ cmd/ # Application entry points -โ”‚ โ”œโ”€โ”€ publisher/ # Server publishing tool -โ”‚ โ””โ”€โ”€ registry/ # Registry API server +โ”‚ โ””โ”€โ”€ publisher/ # Server publishing tool โ”œโ”€โ”€ data/ # Seed data โ”œโ”€โ”€ deploy/ # Deployment configuration (Pulumi) โ”œโ”€โ”€ docs/ # Documentation @@ -121,7 +119,6 @@ For Claude and other AI tools: Always prefer make targets over custom commands w โ”‚ โ”œโ”€โ”€ auth/ # Authentication (GitHub OAuth, JWT, namespace blocking) โ”‚ โ”œโ”€โ”€ config/ # Configuration management โ”‚ โ”œโ”€โ”€ database/ # Data persistence (PostgreSQL) -โ”‚ โ”œโ”€โ”€ importer/ # Seed data import โ”‚ โ”œโ”€โ”€ service/ # Business logic โ”‚ โ”œโ”€โ”€ telemetry/ # Metrics and monitoring โ”‚ โ””โ”€โ”€ validators/ # Input validation diff --git a/cmd/publisher/README.md b/cmd/publisher/README.md index 3a5a792..235d189 100644 --- a/cmd/publisher/README.md +++ b/cmd/publisher/README.md @@ -14,12 +14,9 @@ make publisher make dev-compose # Start local registry ./bin/mcp-publisher init ./bin/mcp-publisher login none --registry=http://localhost:8080 -./bin/mcp-publisher publish +./bin/mcp-publisher publish --registry=http://localhost:8080 ``` -`publish` takes the registry URL from the token saved by `login`, so it accepts no `--registry` -flag โ€” passing one would be read as the `server.json` path. - ## Architecture ### Commands @@ -27,7 +24,6 @@ flag โ€” passing one would be read as the `server.json` path. - **`login`** - Handle authentication (github, dns, http, none) - **`publish`** - Validate and upload servers to registry - **`status`** - Update server lifecycle status (active, deprecated, deleted) -- **`validate`** - Validate server.json without publishing - **`logout`** - Clear stored credentials ### Authentication Providers diff --git a/cmd/publisher/auth/azurekeyvault/common.go b/cmd/publisher/auth/azurekeyvault/common.go index 776ed14..d1e9501 100644 --- a/cmd/publisher/auth/azurekeyvault/common.go +++ b/cmd/publisher/auth/azurekeyvault/common.go @@ -64,8 +64,8 @@ func (d Signer) GetSignedTimestamp(ctx context.Context) (*string, []byte, error) fmt.Fprintln(os.Stdout, "Successfully read the public key from Key Vault.") auth.PrintEcdsaP384KeyInfo(ecdsa.PublicKey{ Curve: elliptic.P384(), - X: new(big.Int).SetBytes(keyResp.Key.X), //nolint:staticcheck // SA1019: needs crypto/ecdh refactor - Y: new(big.Int).SetBytes(keyResp.Key.Y), //nolint:staticcheck // SA1019: needs crypto/ecdh refactor + X: new(big.Int).SetBytes(keyResp.Key.X), + Y: new(big.Int).SetBytes(keyResp.Key.Y), }) timestamp := auth.GetTimestamp() diff --git a/cmd/publisher/auth/common.go b/cmd/publisher/auth/common.go index c12386a..053b543 100644 --- a/cmd/publisher/auth/common.go +++ b/cmd/publisher/auth/common.go @@ -164,10 +164,10 @@ func parseRawPrivateKey(curve elliptic.Curve, privateKeyBytes []byte) (*ecdsa.Pr return &ecdsa.PrivateKey{ PublicKey: ecdsa.PublicKey{ Curve: curve, - X: x, //nolint:staticcheck // SA1019: needs crypto/ecdh refactor - Y: y, //nolint:staticcheck // SA1019: needs crypto/ecdh refactor + X: x, + Y: y, }, - D: d, //nolint:staticcheck // SA1019: needs crypto/ecdh refactor + D: d, }, nil } diff --git a/cmd/publisher/auth/github-at.go b/cmd/publisher/auth/github-at.go index fef3774..3e53529 100644 --- a/cmd/publisher/auth/github-at.go +++ b/cmd/publisher/auth/github-at.go @@ -17,31 +17,6 @@ const ( GitHubAccessTokenURL = "https://github.com/login/oauth/access_token" // #nosec:G101 ) -const ( - // defaultPollInterval is the initial device-flow polling interval in - // seconds, per RFC 8628 ยง3.5. - defaultPollInterval = 5 - // maxPollInterval caps how large the polling interval may grow. RFC 8628 - // ยง3.5 mandates a 5-second increase on each slow_down but leaves the - // maximum to the implementation; this prevents a misbehaving auth server - // from growing the interval unboundedly. - maxPollInterval = 60 - // defaultExpiresIn is the device-code lifetime in seconds used when the - // device-code response omits expires_in. - defaultExpiresIn = 900 - // maxExpiresIn caps the device-code lifetime a response may claim. It sits - // well past GitHub's documented 15 minutes; the cap stops a misbehaving or - // hostile response from pushing the deadline (and the polling loop) far - // into the future. - maxExpiresIn = 3600 - // incorrectDeviceCodeGraceRetries is the total number of extra polls a - // single login may spend on incorrect_device_code before giving up โ€” a - // budget for the whole login, not per occurrence. cli/cli#9302 reports the - // same error for a code that had just been issued; a genuinely invalid code - // still fails, only a few seconds later. - incorrectDeviceCodeGraceRetries = 2 -) - // DeviceCodeResponse represents the response from GitHub's device code endpoint type DeviceCodeResponse struct { DeviceCode string `json:"device_code"` @@ -57,38 +32,6 @@ type AccessTokenResponse struct { TokenType string `json:"token_type"` Scope string `json:"scope"` Error string `json:"error,omitempty"` - // ErrorDescription and ErrorURI accompany Error in GitHub's responses; - // surfacing them turns opaque failures like "incorrect_device_code" into - // diagnosable reports. - ErrorDescription string `json:"error_description,omitempty"` - ErrorURI string `json:"error_uri,omitempty"` -} - -// errorDetail renders Error together with any error_description and error_uri -// GitHub returned, so failures reach the user diagnosable rather than opaque. -func (r AccessTokenResponse) errorDetail() string { - detail := r.Error - if r.ErrorDescription != "" { - detail += ": " + r.ErrorDescription - } - if r.ErrorURI != "" { - detail += " (" + r.ErrorURI + ")" - } - return detail -} - -func decodeAccessTokenResponse(statusCode int, body []byte) (AccessTokenResponse, error) { - var tokenResp AccessTokenResponse - // OAuth errors may use HTTP 400 (RFC 6749 ยง5.2), not just HTTP 200. - if statusCode != http.StatusOK && statusCode != http.StatusBadRequest { - return tokenResp, fmt.Errorf("token endpoint returned %d: %s", statusCode, body) - } - - err := json.Unmarshal(body, &tokenResp) - if statusCode == http.StatusBadRequest && (err != nil || tokenResp.Error == "") { - return tokenResp, fmt.Errorf("token endpoint returned %d: %s", statusCode, body) - } - return tokenResp, err } // RegistryTokenResponse represents the response from registry's token exchange endpoint @@ -103,24 +46,6 @@ type GitHubATProvider struct { registryURL string providedToken string // Token provided via --token flag or MCP_GITHUB_TOKEN env var githubToken string // In-memory GitHub token set by Login() - - // accessTokenURL is the GitHub access-token polling endpoint. It is a field - // (rather than the package constant) so tests can point it at a mock server. - accessTokenURL string - // deviceCodeURL is the GitHub device-code endpoint, a field for the same - // reason as accessTokenURL. - deviceCodeURL string - // pollInterval is the initial polling interval in seconds. Defaults to - // defaultPollInterval; overridable in tests to avoid real delays. Updated - // from the device-code response's interval when GitHub returns one. - pollInterval int - // expiresIn is the device-code lifetime in seconds. Defaults to - // defaultExpiresIn; updated from the device-code response's expires_in - // when GitHub returns one. - expiresIn int - // sleep abstracts time.Sleep so tests can run without real delays and - // assert the back-off sequence. Defaults to time.Sleep. - sleep func(time.Duration) } // ServerHealthResponse represents the response from the health endpoint @@ -137,13 +62,8 @@ func NewGitHubATProvider(registryURL, token string) Provider { } return &GitHubATProvider{ - registryURL: registryURL, - providedToken: token, - accessTokenURL: GitHubAccessTokenURL, - deviceCodeURL: GitHubDeviceCodeURL, - pollInterval: defaultPollInterval, - expiresIn: defaultExpiresIn, - sleep: time.Sleep, + registryURL: registryURL, + providedToken: token, } } @@ -229,7 +149,7 @@ func (g *GitHubATProvider) requestDeviceCode(ctx context.Context) (string, strin return "", "", "", err } - req, err := http.NewRequestWithContext(ctx, http.MethodPost, g.deviceCodeURL, bytes.NewBuffer(jsonData)) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, GitHubDeviceCodeURL, bytes.NewBuffer(jsonData)) if err != nil { return "", "", "", err } @@ -258,21 +178,6 @@ func (g *GitHubATProvider) requestDeviceCode(ctx context.Context) (string, strin return "", "", "", err } - // Per RFC 8628 ยง3.2 interval and expires_in are bound to this device code, - // so reset any pacing left over from a previous code before adopting them. - // Clamp both: a hostile or buggy response must not grow the interval past - // maxPollInterval (the invariant maxPollInterval exists for) nor push the - // deadline unboundedly into the future, and clamping also keeps the - // derived time.Duration well clear of int64 overflow. - g.pollInterval = defaultPollInterval - g.expiresIn = defaultExpiresIn - if deviceCodeResp.Interval > 0 { - g.pollInterval = min(deviceCodeResp.Interval, maxPollInterval) - } - if deviceCodeResp.ExpiresIn > 0 { - g.expiresIn = min(deviceCodeResp.ExpiresIn, maxExpiresIn) - } - return deviceCodeResp.DeviceCode, deviceCodeResp.UserCode, deviceCodeResp.VerificationURI, nil } @@ -293,28 +198,13 @@ func (g *GitHubATProvider) pollForToken(ctx context.Context, deviceCode string) return "", err } - // Pacing comes from the device-code response (via requestDeviceCode), - // falling back to GitHub's documented defaults. - interval := g.pollInterval - expiresIn := g.expiresIn - // Zero-value fallback: providers built directly rather than through - // requestDeviceCode (the test seam) carry no lifetime. Keep this guard. - if expiresIn <= 0 { - expiresIn = defaultExpiresIn - } + // Default polling interval and expiration time + interval := 5 // seconds + expiresIn := 900 // 15 minutes deadline := time.Now().Add(time.Duration(expiresIn) * time.Second) - graceRetries := 0 - // serverErrorInterval grows the wait between consecutive 5xx retries and is - // reset by any other response. - serverErrorInterval := interval - // lastErr holds the most recent retryable failure so a deadline reached - // mid-retry reports that diagnostic instead of a bare "timed out". It is - // cleared whenever polling recovers, so a genuine user timeout after a - // recovered blip still reports plainly. - var lastErr error for time.Now().Before(deadline) { - req, err := http.NewRequestWithContext(ctx, http.MethodPost, g.accessTokenURL, bytes.NewBuffer(jsonData)) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, GitHubAccessTokenURL, bytes.NewBuffer(jsonData)) if err != nil { return "", err } @@ -333,54 +223,20 @@ func (g *GitHubATProvider) pollForToken(ctx context.Context, deviceCode string) return "", err } - // A transient 5xx must not abandon a login the user may already have - // approved in the browser. Each consecutive 5xx grows the wait by 5s up - // to maxPollInterval, so a sustained outage costs a couple of dozen - // requests rather than hundreds; the deadline bounds the number of - // these retries. - if resp.StatusCode >= http.StatusInternalServerError { - lastErr = fmt.Errorf("token endpoint returned %d", resp.StatusCode) - serverErrorInterval = min(serverErrorInterval+5, maxPollInterval) - g.sleep(time.Duration(serverErrorInterval) * time.Second) - continue - } - serverErrorInterval = interval - - tokenResp, err := decodeAccessTokenResponse(resp.StatusCode, body) + var tokenResp AccessTokenResponse + err = json.Unmarshal(body, &tokenResp) if err != nil { return "", err } - // Per RFC 8628 ยง3.5, both authorization_pending and slow_down indicate - // the client should keep polling. slow_down additionally requires that - // the polling interval be increased by 5 seconds. - if tokenResp.Error == "authorization_pending" || tokenResp.Error == "slow_down" { - if tokenResp.Error == "slow_down" { - interval += 5 - if interval > maxPollInterval { - interval = maxPollInterval - } - } - lastErr = nil - g.sleep(time.Duration(interval) * time.Second) + if tokenResp.Error == "authorization_pending" { + // User hasn't authorized yet, wait and retry + time.Sleep(time.Duration(interval) * time.Second) continue } if tokenResp.Error != "" { - failure := fmt.Errorf("token request failed: %s", tokenResp.errorDetail()) - - // incorrect_device_code has been reported for codes that were in - // fact valid (cli/cli#9302; cause never confirmed), so spend a - // couple of grace polls before abandoning a login the user may - // have approved. - if tokenResp.Error == "incorrect_device_code" && graceRetries < incorrectDeviceCodeGraceRetries { - graceRetries++ - lastErr = failure - g.sleep(time.Duration(interval) * time.Second) - continue - } - - return "", failure + return "", fmt.Errorf("token request failed: %s", tokenResp.Error) } if tokenResp.AccessToken != "" { @@ -391,9 +247,6 @@ func (g *GitHubATProvider) pollForToken(ctx context.Context, deviceCode string) return "", fmt.Errorf("failed to obtain access token") } - if lastErr != nil { - return "", fmt.Errorf("device code authorization timed out; last response: %w", lastErr) - } return "", fmt.Errorf("device code authorization timed out") } diff --git a/cmd/publisher/auth/github_at_device_flow_internal_test.go b/cmd/publisher/auth/github_at_device_flow_internal_test.go deleted file mode 100644 index b1e13ac..0000000 --- a/cmd/publisher/auth/github_at_device_flow_internal_test.go +++ /dev/null @@ -1,532 +0,0 @@ -package auth - -import ( - "context" - "encoding/json" - "fmt" - "net/http" - "net/http/httptest" - "sync" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -// seqTokenServer serves a fixed sequence of (status, body) responses, one per -// request, reusing the last one once the sequence is exhausted. Unlike -// newMockTokenServer it can serve non-200 statuses and non-JSON bodies, which -// the transient-5xx path needs. -type seqTokenServer struct { - srv *httptest.Server - mu sync.Mutex - seen int - items []seqResp -} - -type seqResp struct { - status int - body string -} - -func newSeqTokenServer(t *testing.T, items ...seqResp) *seqTokenServer { - t.Helper() - s := &seqTokenServer{items: items} - s.srv = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - s.mu.Lock() - item := s.items[len(s.items)-1] - if s.seen < len(s.items) { - item = s.items[s.seen] - } - s.seen++ - s.mu.Unlock() - w.Header().Set("Content-Type", "application/json") - w.WriteHeader(item.status) - _, _ = w.Write([]byte(item.body)) - })) - t.Cleanup(s.srv.Close) - return s -} - -func (s *seqTokenServer) requests() int { - s.mu.Lock() - defer s.mu.Unlock() - return s.seen -} - -func okResp(body string) seqResp { return seqResp{status: http.StatusOK, body: body} } - -// serverErrorResp is a 502 carrying an HTML body rather than JSON, the shape a -// transient edge failure takes. -func serverErrorResp() seqResp { - return seqResp{status: http.StatusBadGateway, body: `Server Error`} -} - -const ( - testClientID = "test-client-id" - - pendingBody = `{"error":"authorization_pending"}` - incorrectBody = `{"error":"incorrect_device_code"}` - // The full shape GitHub sends for this error, description and URI included. - incorrectVerboseBody = `{"error":"incorrect_device_code","error_description":"The device_code provided is not valid.","error_uri":"https://docs.github.com/developers/apps/authorizing-oauth-apps#error-codes-for-the-device-flow"}` - tokenBody = `{"access_token":"gho_test_token","token_type":"bearer","scope":"read:org,read:user"}` // #nosec G101 -- test fixture, not a real secret -) - -// TestPollForToken_IncorrectDeviceCodeIsTerminalAfterGrace confirms a code that -// stays invalid past the grace polls still fails, and fails with the error -// GitHub reported rather than a rewritten one. -func TestPollForToken_IncorrectDeviceCodeIsTerminalAfterGrace(t *testing.T) { - gh := newSeqTokenServer(t, okResp(pendingBody), okResp(pendingBody), okResp(incorrectBody)) - p, _ := newPollTestProvider(gh.srv.URL) - - _, err := p.pollForToken(context.Background(), "issued-device-code") - require.Error(t, err) - assert.Equal(t, "token request failed: incorrect_device_code", err.Error()) - // 2 pending + 1 incorrect + 2 grace polls that also answer incorrect. - assert.Equal(t, 5, gh.requests()) -} - -// TestPollForToken_TransientIncorrectDeviceCodeRecovered covers the case the -// grace retries exist for: one incorrect_device_code between a pending poll and -// a successful one must not discard a token the user already authorised. -func TestPollForToken_TransientIncorrectDeviceCodeRecovered(t *testing.T) { - gh := newSeqTokenServer(t, okResp(pendingBody), okResp(incorrectBody), okResp(tokenBody)) - p, _ := newPollTestProvider(gh.srv.URL) - - token, err := p.pollForToken(context.Background(), "issued-device-code") - require.NoError(t, err, "one transient incorrect_device_code must not be fatal") - assert.Equal(t, "gho_test_token", token) - assert.Equal(t, 3, gh.requests()) -} - -func TestPollForToken_OAuthErrorsRetryOnBadRequest(t *testing.T) { - for _, status := range []int{http.StatusOK, http.StatusBadRequest} { - for _, code := range []string{"authorization_pending", "slow_down", "incorrect_device_code"} { - t.Run(fmt.Sprintf("%d/%s", status, code), func(t *testing.T) { - gh := newSeqTokenServer(t, - seqResp{status: status, body: fmt.Sprintf(`{"error":%q}`, code)}, - okResp(tokenBody), - ) - p, slept := newPollTestProvider(gh.srv.URL) - p.pollInterval = defaultPollInterval - - token, err := p.pollForToken(context.Background(), "issued-device-code") - require.NoError(t, err) - assert.Equal(t, "gho_test_token", token) - assert.Equal(t, 2, gh.requests()) - wait := time.Duration(defaultPollInterval) * time.Second - if code == "slow_down" { - wait += 5 * time.Second - } - assert.Equal(t, []time.Duration{wait}, *slept) - }) - } - } -} - -func TestPollForToken_BadRequestOAuthErrorsRemainTerminal(t *testing.T) { - for _, code := range []string{"access_denied", "expired_token", "unknown_error", "incorrect_device_code"} { - t.Run(code, func(t *testing.T) { - gh := newSeqTokenServer(t, seqResp{ - status: http.StatusBadRequest, - body: fmt.Sprintf(`{"error":%q,"error_description":"Request rejected","error_uri":"https://github.com/error"}`, code), - }) - p, slept := newPollTestProvider(gh.srv.URL) - - token, err := p.pollForToken(context.Background(), "issued-device-code") - require.EqualError(t, err, "token request failed: "+code+": Request rejected (https://github.com/error)") - assert.Empty(t, token) - retries := 0 - if code == "incorrect_device_code" { - retries = incorrectDeviceCodeGraceRetries - } - assert.Equal(t, 1+retries, gh.requests()) - assert.Len(t, *slept, retries) - }) - } -} - -// TestPollForToken_ErrorDescriptionAndURISurfaced confirms the grace budget is -// spent in full against a persistently invalid code, and that GitHub's -// error_description and error_uri reach the user instead of being discarded. -func TestPollForToken_ErrorDescriptionAndURISurfaced(t *testing.T) { - gh := newSeqTokenServer(t, okResp(incorrectVerboseBody)) - p, _ := newPollTestProvider(gh.srv.URL) - - _, err := p.pollForToken(context.Background(), "issued-device-code") - require.Error(t, err) - assert.Contains(t, err.Error(), "incorrect_device_code") - assert.Contains(t, err.Error(), "The device_code provided is not valid.") - assert.Contains(t, err.Error(), "error-codes-for-the-device-flow") - assert.Equal(t, 1+incorrectDeviceCodeGraceRetries, gh.requests()) -} - -// TestPollForToken_TransientServerErrorRetried confirms a 5xx (which carries an -// HTML body, not JSON) is retried rather than ending the login. -func TestPollForToken_TransientServerErrorRetried(t *testing.T) { - gh := newSeqTokenServer(t, - serverErrorResp(), - okResp(tokenBody), - ) - p, slept := newPollTestProvider(gh.srv.URL) - - token, err := p.pollForToken(context.Background(), "issued-device-code") - require.NoError(t, err) - assert.Equal(t, "gho_test_token", token) - assert.Equal(t, 2, gh.requests()) - assert.Len(t, *slept, 1, "the 5xx must be followed by one back-off") -} - -// TestPollForToken_FirstPollIsImmediate pins the polling schedule: the first -// request goes out without a preceding sleep, so a user who authorises quickly -// is not made to wait an interval for nothing. -func TestPollForToken_FirstPollIsImmediate(t *testing.T) { - gh := newSeqTokenServer(t, okResp(tokenBody)) - p, slept := newPollTestProvider(gh.srv.URL) - - _, err := p.pollForToken(context.Background(), "issued-device-code") - require.NoError(t, err) - assert.Equal(t, 1, gh.requests()) - assert.Empty(t, *slept, "an immediately successful poll must not sleep") -} - -// TestRequestDeviceCode_HonoursServerIntervalAndExpiry confirms the interval and -// expires_in in the device-code response are adopted rather than dropped. -func TestRequestDeviceCode_HonoursServerIntervalAndExpiry(t *testing.T) { - device := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "application/json") - _, _ = w.Write([]byte(`{"device_code":"dc-1","user_code":"AAAA-BBBB","verification_uri":"https://github.com/login/device","expires_in":60,"interval":7}`)) - })) - t.Cleanup(device.Close) - - p := &GitHubATProvider{ - clientID: testClientID, - deviceCodeURL: device.URL, - pollInterval: defaultPollInterval, - expiresIn: defaultExpiresIn, - } - - deviceCode, userCode, uri, err := p.requestDeviceCode(context.Background()) - require.NoError(t, err) - assert.Equal(t, "dc-1", deviceCode) - assert.Equal(t, "AAAA-BBBB", userCode) - assert.Equal(t, "https://github.com/login/device", uri) - assert.Equal(t, 7, p.pollInterval, "interval from the response must be adopted") - assert.Equal(t, 60, p.expiresIn, "expires_in from the response must be adopted") -} - -// TestRequestDeviceCode_KeepsDefaultsWhenOmitted confirms a response without -// interval or expires_in leaves the documented defaults in place. -func TestRequestDeviceCode_KeepsDefaultsWhenOmitted(t *testing.T) { - device := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "application/json") - _, _ = w.Write([]byte(`{"device_code":"dc-2","user_code":"EEEE-FFFF","verification_uri":"https://github.com/login/device"}`)) - })) - t.Cleanup(device.Close) - - p := &GitHubATProvider{ - clientID: testClientID, - deviceCodeURL: device.URL, - pollInterval: defaultPollInterval, - expiresIn: defaultExpiresIn, - } - - _, _, _, err := p.requestDeviceCode(context.Background()) - require.NoError(t, err) - assert.Equal(t, defaultPollInterval, p.pollInterval) - assert.Equal(t, defaultExpiresIn, p.expiresIn) -} - -// deviceCodeServerReturning serves a single device-code response with the given -// raw JSON body, for exercising interval/expires_in handling. -func deviceCodeServerReturning(t *testing.T, body string) string { - t.Helper() - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "application/json") - _, _ = w.Write([]byte(body)) - })) - t.Cleanup(srv.Close) - return srv.URL -} - -// TestRequestDeviceCode_ClampsExcessiveInterval confirms an interval far above -// maxPollInterval is clamped, protecting the same invariant maxPollInterval -// enforces on the slow_down path. -func TestRequestDeviceCode_ClampsExcessiveInterval(t *testing.T) { - url := deviceCodeServerReturning(t, - `{"device_code":"dc","user_code":"AAAA-BBBB","verification_uri":"https://github.com/login/device","expires_in":900,"interval":86400}`) - - p := &GitHubATProvider{clientID: testClientID, deviceCodeURL: url, pollInterval: defaultPollInterval, expiresIn: defaultExpiresIn} - _, _, _, err := p.requestDeviceCode(context.Background()) - require.NoError(t, err) - assert.Equal(t, maxPollInterval, p.pollInterval, "interval above the cap must be clamped") -} - -// TestRequestDeviceCode_ClampsOverflowValues covers the overflow pair: values -// large enough that time.Duration(n)*time.Second wraps negative would make -// sleep return instantly (spinning the loop) and put the deadline in the past -// (yielding zero polls). Clamping keeps both within safe bounds. -func TestRequestDeviceCode_ClampsOverflowValues(t *testing.T) { - url := deviceCodeServerReturning(t, - `{"device_code":"dc","user_code":"AAAA-BBBB","verification_uri":"https://github.com/login/device","expires_in":10000000000,"interval":10000000000}`) - - p := &GitHubATProvider{clientID: testClientID, deviceCodeURL: url, pollInterval: defaultPollInterval, expiresIn: defaultExpiresIn} - _, _, _, err := p.requestDeviceCode(context.Background()) - require.NoError(t, err) - - assert.Equal(t, maxPollInterval, p.pollInterval) - assert.Equal(t, maxExpiresIn, p.expiresIn) -} - -// TestRequestDeviceCode_IgnoresNegativeValues confirms negative interval and -// expires_in are rejected in favour of the defaults, so neither can produce a -// negative sleep or a deadline already in the past. -func TestRequestDeviceCode_IgnoresNegativeValues(t *testing.T) { - url := deviceCodeServerReturning(t, - `{"device_code":"dc","user_code":"AAAA-BBBB","verification_uri":"https://github.com/login/device","expires_in":-1,"interval":-1}`) - - p := &GitHubATProvider{clientID: testClientID, deviceCodeURL: url, pollInterval: defaultPollInterval, expiresIn: defaultExpiresIn} - _, _, _, err := p.requestDeviceCode(context.Background()) - require.NoError(t, err) - - assert.Equal(t, defaultPollInterval, p.pollInterval, "negative interval must fall back to the default") - assert.Equal(t, defaultExpiresIn, p.expiresIn, "negative expires_in must fall back to the default") -} - -// TestPollForToken_TimeoutSurfacesLastError covers F2: when the deadline lands -// mid-retry, the timeout must carry the last retryable diagnostic instead of a -// bare "timed out". The grace poll records the full-shape incorrect_device_code -// and its following sleep crosses the (1-second) deadline. -func TestPollForToken_TimeoutSurfacesLastError(t *testing.T) { - gh := newSeqTokenServer(t, okResp(incorrectVerboseBody)) - p := &GitHubATProvider{ - clientID: testClientID, - accessTokenURL: gh.srv.URL, - pollInterval: 1, - expiresIn: 1, // deadline ~1s out - sleep: func(time.Duration) { time.Sleep(1100 * time.Millisecond) }, - } - - _, err := p.pollForToken(context.Background(), "issued-device-code") - require.Error(t, err) - assert.Contains(t, err.Error(), "timed out") - assert.Contains(t, err.Error(), "The device_code provided is not valid.", - "the last retryable diagnostic must survive the timeout") -} - -// TestPollForToken_TimeoutAfterRecoveryIsBare confirms lastErr is cleared when -// polling recovers: one transient 502 followed by healthy pending polls and -// then a genuine user timeout must report plainly, not blame the stale 502. -func TestPollForToken_TimeoutAfterRecoveryIsBare(t *testing.T) { - gh := newSeqTokenServer(t, - serverErrorResp(), - okResp(pendingBody), - ) - p := &GitHubATProvider{ - clientID: testClientID, - accessTokenURL: gh.srv.URL, - pollInterval: 1, - expiresIn: 1, // deadline ~1s out - sleep: func(time.Duration) { time.Sleep(400 * time.Millisecond) }, - } - - _, err := p.pollForToken(context.Background(), "issued-device-code") - require.Error(t, err) - assert.Equal(t, "device code authorization timed out", err.Error(), - "a recovered 502 must not be reported as the cause of a user timeout") -} - -// Non-OAuth failures retain HTTP diagnostics rather than JSON parsing errors. -func TestPollForToken_NonOKStatusSurfacesStatusAndBody(t *testing.T) { - for _, tt := range []struct { - name string - resp seqResp - }{ - {"rate_limited", seqResp{status: http.StatusTooManyRequests, body: "rate limited"}}, - {"bad_request_html", seqResp{status: http.StatusBadRequest, body: "bad request"}}, - {"bad_request_invalid_json", seqResp{status: http.StatusBadRequest, body: `{"error":`}}, - {"bad_request_empty_error", seqResp{status: http.StatusBadRequest, body: `{"error":""}`}}, - {"bad_request_token", seqResp{status: http.StatusBadRequest, body: tokenBody}}, - {"pending_on_other_status", seqResp{status: http.StatusForbidden, body: pendingBody}}, - } { - t.Run(tt.name, func(t *testing.T) { - gh := newSeqTokenServer(t, tt.resp) - p, slept := newPollTestProvider(gh.srv.URL) - - token, err := p.pollForToken(context.Background(), "issued-device-code") - require.EqualError(t, err, fmt.Sprintf("token endpoint returned %d: %s", tt.resp.status, tt.resp.body)) - assert.Empty(t, token) - assert.Equal(t, 1, gh.requests(), "a non-retryable status must stop polling") - assert.Empty(t, *slept) - }) - } -} - -// TestPollForToken_ConsecutiveServerErrorsBackOff confirms the 5xx wait grows by -// 5s per consecutive failure and is capped, so a sustained outage costs a -// bounded number of requests rather than hammering the endpoint. -func TestPollForToken_ConsecutiveServerErrorsBackOff(t *testing.T) { - responses := make([]seqResp, 0, 4) - for range [3]struct{}{} { - responses = append(responses, serverErrorResp()) - } - responses = append(responses, okResp(tokenBody)) - - gh := newSeqTokenServer(t, responses...) - p, slept := newPollTestProvider(gh.srv.URL) - - token, err := p.pollForToken(context.Background(), "issued-device-code") - require.NoError(t, err) - assert.Equal(t, "gho_test_token", token) - - // Base interval is 0 in the test provider, so the waits are 5, 10, 15. - require.Len(t, *slept, 3) - assert.Equal(t, 5*time.Second, (*slept)[0]) - assert.Equal(t, 10*time.Second, (*slept)[1]) - assert.Equal(t, 15*time.Second, (*slept)[2]) -} - -// TestPollForToken_ServerErrorBackOffResetsOnRecovery confirms the 5xx growth is -// reset by any non-5xx response, so an intermittent endpoint does not -// accumulate an ever-longer wait across separate blips. -func TestPollForToken_ServerErrorBackOffResetsOnRecovery(t *testing.T) { - serverError := serverErrorResp() - gh := newSeqTokenServer(t, - serverError, - okResp(pendingBody), - serverError, - okResp(tokenBody), - ) - p, slept := newPollTestProvider(gh.srv.URL) - - token, err := p.pollForToken(context.Background(), "issued-device-code") - require.NoError(t, err) - assert.Equal(t, "gho_test_token", token) - - // 5s for the first 5xx, 0s for the pending poll (base interval), then 5s - // again โ€” not 10s โ€” because the pending response reset the growth. - require.Len(t, *slept, 3) - assert.Equal(t, 5*time.Second, (*slept)[0]) - assert.Equal(t, 0*time.Second, (*slept)[1]) - assert.Equal(t, 5*time.Second, (*slept)[2]) -} - -// TestRequestDeviceCode_PacingDoesNotLeakAcrossCodes covers F4: interval and -// expires_in are bound to the code they were issued with, so a second request -// that omits them must fall back to defaults rather than inherit the first. -func TestRequestDeviceCode_PacingDoesNotLeakAcrossCodes(t *testing.T) { - var call int - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - w.Header().Set("Content-Type", "application/json") - if call == 0 { - _, _ = w.Write([]byte(`{"device_code":"dc1","user_code":"AAAA-BBBB","verification_uri":"https://github.com/login/device","expires_in":120,"interval":55}`)) - } else { - _, _ = w.Write([]byte(`{"device_code":"dc2","user_code":"CCCC-DDDD","verification_uri":"https://github.com/login/device"}`)) - } - call++ - })) - t.Cleanup(srv.Close) - - p := &GitHubATProvider{clientID: testClientID, deviceCodeURL: srv.URL, pollInterval: defaultPollInterval, expiresIn: defaultExpiresIn} - - _, _, _, err := p.requestDeviceCode(context.Background()) - require.NoError(t, err) - assert.Equal(t, 55, p.pollInterval) - assert.Equal(t, 120, p.expiresIn) - - _, _, _, err = p.requestDeviceCode(context.Background()) - require.NoError(t, err) - assert.Equal(t, defaultPollInterval, p.pollInterval, "second code must not inherit the first's interval") - assert.Equal(t, defaultExpiresIn, p.expiresIn, "second code must not inherit the first's expires_in") -} - -// TestLogin_ClientIDStableAcrossDeviceCodeAndPolls covers the whole device flow -// end to end and pins the one invariant that makes incorrect_device_code -// meaningful: the health endpoint is read once, and the client_id the device -// code was issued under is the one every poll carries. The mock token endpoint -// answers incorrect_device_code for any other pairing. -func TestLogin_ClientIDStableAcrossDeviceCodeAndPolls(t *testing.T) { - var mu sync.Mutex - healthCalls := 0 - deviceClientID := "" - pollClientIDs := []string{} - pollCount := 0 - const issued = "dc-login" - - registry := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - if r.URL.Path != "/v0/health" { - http.NotFound(w, r) - return - } - mu.Lock() - healthCalls++ - id := fmt.Sprintf("Iv23liCLIENT%04d", healthCalls) - mu.Unlock() - w.Header().Set("Content-Type", "application/json") - _, _ = fmt.Fprintf(w, `{"status":"ok","github_client_id":"%s"}`, id) - })) - t.Cleanup(registry.Close) - - device := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - var req map[string]string - // assert, not require: t.FailNow from a handler goroutine is unsupported. - if !assert.NoError(t, json.NewDecoder(r.Body).Decode(&req)) { - http.Error(w, "bad request body", http.StatusBadRequest) - return - } - mu.Lock() - deviceClientID = req["client_id"] - mu.Unlock() - w.Header().Set("Content-Type", "application/json") - _, _ = fmt.Fprintf(w, `{"device_code":"%s","user_code":"CCCC-DDDD","verification_uri":"https://github.com/login/device","expires_in":900,"interval":5}`, issued) - })) - t.Cleanup(device.Close) - - tokenSrv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - var req map[string]string - // assert, not require: t.FailNow from a handler goroutine is unsupported. - if !assert.NoError(t, json.NewDecoder(r.Body).Decode(&req)) { - http.Error(w, "bad request body", http.StatusBadRequest) - return - } - mu.Lock() - pollClientIDs = append(pollClientIDs, req["client_id"]) - bound := req["client_id"] == deviceClientID && req["device_code"] == issued - pollCount++ - first := pollCount == 1 - mu.Unlock() - - w.Header().Set("Content-Type", "application/json") - switch { - case !bound: - _, _ = w.Write([]byte(incorrectBody)) - case first: - _, _ = w.Write([]byte(pendingBody)) - default: - _, _ = w.Write([]byte(tokenBody)) - } - })) - t.Cleanup(tokenSrv.Close) - - p := &GitHubATProvider{ - registryURL: registry.URL, - deviceCodeURL: device.URL, - accessTokenURL: tokenSrv.URL, - pollInterval: defaultPollInterval, - expiresIn: defaultExpiresIn, - sleep: func(time.Duration) {}, - } - - require.NoError(t, p.Login(context.Background())) - assert.Equal(t, "gho_test_token", p.githubToken) - - mu.Lock() - defer mu.Unlock() - assert.Equal(t, 1, healthCalls, "Login must read the health endpoint exactly once") - assert.Equal(t, "Iv23liCLIENT0001", deviceClientID) - for _, id := range pollClientIDs { - assert.Equal(t, deviceClientID, id, - "every poll must carry the client_id the device code was issued under") - } -} diff --git a/cmd/publisher/auth/github_at_poll_internal_test.go b/cmd/publisher/auth/github_at_poll_internal_test.go deleted file mode 100644 index 41de749..0000000 --- a/cmd/publisher/auth/github_at_poll_internal_test.go +++ /dev/null @@ -1,131 +0,0 @@ -package auth - -import ( - "context" - "encoding/json" - "net/http" - "net/http/httptest" - "testing" - "time" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -// newMockTokenServer returns an httptest.Server that serves the given sequence -// of AccessTokenResponse values, one per request. Once the sequence is -// exhausted the final response is reused for any extra requests. -func newMockTokenServer(t *testing.T, responses []AccessTokenResponse) *httptest.Server { - t.Helper() - var i int - srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { - resp := responses[len(responses)-1] - if i < len(responses) { - resp = responses[i] - } - i++ - w.Header().Set("Content-Type", "application/json") - _ = json.NewEncoder(w).Encode(resp) // #nosec G117 -- test fixture token, not a real secret - })) - t.Cleanup(srv.Close) - return srv -} - -// newPollTestProvider builds a provider wired to a mock token endpoint. The -// initial poll interval is 0 (so the back-off starts from a known base) and -// sleeps are captured rather than performed, making the tests deterministic and -// instant. The returned slice records every interval passed to sleep. -func newPollTestProvider(tokenURL string) (*GitHubATProvider, *[]time.Duration) { - slept := &[]time.Duration{} - p := &GitHubATProvider{ - clientID: "test-client-id", - accessTokenURL: tokenURL, - pollInterval: 0, - sleep: func(d time.Duration) { *slept = append(*slept, d) }, - } - return p, slept -} - -// TestPollForToken_SlowDownThenSuccess confirms that a slow_down response is -// treated as retriable: polling continues and the success path is reached. -func TestPollForToken_SlowDownThenSuccess(t *testing.T) { - srv := newMockTokenServer(t, []AccessTokenResponse{ - {Error: "slow_down"}, - {AccessToken: "gh-token"}, - }) - p, slept := newPollTestProvider(srv.URL) - - token, err := p.pollForToken(context.Background(), "device-code") - require.NoError(t, err) - assert.Equal(t, "gh-token", token) - - // One slow_down => one back-off, interval bumped 0 -> 5. - require.Len(t, *slept, 1) - assert.Equal(t, 5*time.Second, (*slept)[0]) -} - -// TestPollForToken_MixedRetryableErrorsCompoundInterval confirms the interval -// increment compounds correctly across mixed retryable errors. Per RFC 8628 -// ยง3.5 the interval is increased by 5 seconds on each slow_down and is NOT -// reset between slow_down instances, while authorization_pending leaves it -// unchanged. -func TestPollForToken_MixedRetryableErrorsCompoundInterval(t *testing.T) { - srv := newMockTokenServer(t, []AccessTokenResponse{ - {Error: "slow_down"}, // 0 -> 5 - {Error: "authorization_pending"}, // stays 5 - {Error: "slow_down"}, // 5 -> 10 - {AccessToken: "gh-token"}, - }) - p, slept := newPollTestProvider(srv.URL) - - token, err := p.pollForToken(context.Background(), "device-code") - require.NoError(t, err) - assert.Equal(t, "gh-token", token) - - require.Len(t, *slept, 3) - assert.Equal(t, 5*time.Second, (*slept)[0]) // after first slow_down - assert.Equal(t, 5*time.Second, (*slept)[1]) // authorization_pending: unchanged - assert.Equal(t, 10*time.Second, (*slept)[2]) // second slow_down: compounded -} - -// TestPollForToken_IntervalCappedAtMax confirms the polling interval is capped -// so a misbehaving auth server returning slow_down repeatedly cannot grow it -// without bound. -func TestPollForToken_IntervalCappedAtMax(t *testing.T) { - // 13 slow_downs starting from interval 0 would otherwise reach 65s - // (5, 10, ..., 60, 65); the cap holds it at 60. - responses := make([]AccessTokenResponse, 0, 14) - for range [13]struct{}{} { - responses = append(responses, AccessTokenResponse{Error: "slow_down"}) - } - responses = append(responses, AccessTokenResponse{AccessToken: "gh-token"}) - - srv := newMockTokenServer(t, responses) - p, slept := newPollTestProvider(srv.URL) - - token, err := p.pollForToken(context.Background(), "device-code") - require.NoError(t, err) - assert.Equal(t, "gh-token", token) - - require.Len(t, *slept, 13) - for _, d := range *slept { - assert.LessOrEqual(t, d, time.Duration(maxPollInterval)*time.Second) - } - // The last two back-offs are both pinned at the cap. - assert.Equal(t, time.Duration(maxPollInterval)*time.Second, (*slept)[11]) - assert.Equal(t, time.Duration(maxPollInterval)*time.Second, (*slept)[12]) -} - -// TestPollForToken_FatalErrorStopsPolling confirms a non-retryable error ends -// polling immediately with an error. -func TestPollForToken_FatalErrorStopsPolling(t *testing.T) { - srv := newMockTokenServer(t, []AccessTokenResponse{ - {Error: "access_denied"}, - }) - p, slept := newPollTestProvider(srv.URL) - - _, err := p.pollForToken(context.Background(), "device-code") - require.Error(t, err) - assert.Contains(t, err.Error(), "access_denied") - assert.Empty(t, *slept, "fatal error should not trigger a back-off sleep") -} diff --git a/cmd/publisher/commands/publish.go b/cmd/publisher/commands/publish.go index cccf2c8..902c421 100644 --- a/cmd/publisher/commands/publish.go +++ b/cmd/publisher/commands/publish.go @@ -64,7 +64,7 @@ func PublishCommand(args []string) error { } // Publish to registry - _, _ = fmt.Fprintf(os.Stdout, "Publishing %s@%s to %s...\n", serverJSON.Name, serverJSON.Version, registryURL) + _, _ = fmt.Fprintf(os.Stdout, "Publishing to %s...\n", registryURL) response, statusCode, err := publishToRegistry(registryURL, serverData, token) if err != nil { // If publish failed with 422, call validate endpoint to show detailed errors diff --git a/cmd/publisher/commands/publish_test.go b/cmd/publisher/commands/publish_test.go index 745198d..98c19a3 100644 --- a/cmd/publisher/commands/publish_test.go +++ b/cmd/publisher/commands/publish_test.go @@ -39,36 +39,6 @@ func TestPublishCommand_Success(t *testing.T) { assert.NoError(t, err) } -func TestPublishCommand_PrintsSubmittedIdentityOnFailure(t *testing.T) { - server := SetupMockRegistryServer(t, func(w http.ResponseWriter, _ *http.Request) { - http.Error(w, "duplicate version", http.StatusBadRequest) - }, nil) - SetupTestToken(t, server.URL, "test-token") - CreateTestServerJSON(t, apiv0.ServerJSON{ - Schema: model.CurrentSchemaURL, - Name: "io.github.BargLabs/cejel", - Description: "A test server", - Version: "0.4.5", - }) - - output, err := os.CreateTemp(t.TempDir(), "stdout") - require.NoError(t, err) - originalStdout := os.Stdout - os.Stdout = output - t.Cleanup(func() { - os.Stdout = originalStdout - _ = output.Close() - }) - - err = commands.PublishCommand(nil) - require.ErrorContains(t, err, "duplicate version") - _, err = output.Seek(0, io.SeekStart) - require.NoError(t, err) - data, err := io.ReadAll(output) - require.NoError(t, err) - assert.Equal(t, "Publishing io.github.BargLabs/cejel@0.4.5 to "+server.URL+"...\n", string(data)) -} - func TestPublishCommand_PreservesNonASCIIDescription(t *testing.T) { server := SetupMockRegistryServer(t, func(w http.ResponseWriter, r *http.Request) { diff --git a/cmd/publisher/commands/testutil_test.go b/cmd/publisher/commands/testutil_test.go index c103f82..416b192 100644 --- a/cmd/publisher/commands/testutil_test.go +++ b/cmd/publisher/commands/testutil_test.go @@ -95,7 +95,9 @@ func SetupTestToken(t *testing.T, registryURL, token string) string { func CreateTestServerJSON(t *testing.T, serverJSON apiv0.ServerJSON) (string, string) { t.Helper() - tempDir := t.TempDir() + tempDir, err := os.MkdirTemp("", "mcp-publisher-test") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(tempDir) }) jsonData, err := json.MarshalIndent(serverJSON, "", " ") require.NoError(t, err) diff --git a/cmd/publisher/commands/validate_test.go b/cmd/publisher/commands/validate_test.go index 1827ffe..b56b22d 100644 --- a/cmd/publisher/commands/validate_test.go +++ b/cmd/publisher/commands/validate_test.go @@ -140,13 +140,16 @@ func TestValidateCommand_NoServerFile(t *testing.T) { server := SetupMockRegistryServer(t, nil, nil) SetupTestToken(t, server.URL, "test-token") - tempDir := t.TempDir() + // Don't create server.json + tempDir, err := os.MkdirTemp("", "mcp-publisher-test") + require.NoError(t, err) + defer os.RemoveAll(tempDir) originalDir, err := os.Getwd() require.NoError(t, err) defer func() { _ = os.Chdir(originalDir) }() - require.NoError(t, os.Chdir(tempDir)) + _ = os.Chdir(tempDir) err = commands.ValidateCommand([]string{}) @@ -158,13 +161,15 @@ func TestValidateCommand_InvalidJSON(t *testing.T) { server := SetupMockRegistryServer(t, nil, nil) SetupTestToken(t, server.URL, "test-token") - tempDir := t.TempDir() + tempDir, err := os.MkdirTemp("", "mcp-publisher-test") + require.NoError(t, err) + defer os.RemoveAll(tempDir) originalDir, err := os.Getwd() require.NoError(t, err) defer func() { _ = os.Chdir(originalDir) }() - require.NoError(t, os.Chdir(tempDir)) + _ = os.Chdir(tempDir) // Create invalid JSON file err = os.WriteFile("server.json", []byte("{ invalid json }"), 0600) diff --git a/cmd/publisher/main.go b/cmd/publisher/main.go index 8f7de09..20cea2b 100644 --- a/cmd/publisher/main.go +++ b/cmd/publisher/main.go @@ -27,12 +27,10 @@ func main() { os.Exit(1) } - // Check for help flag for subcommands. Commands without an entry in - // printCommandHelp handle --help themselves, so fall through to dispatch. + // Check for help flag for subcommands if len(os.Args) >= 3 && (os.Args[2] == "--help" || os.Args[2] == "-h") { - if printCommandHelp(os.Args[1]) { - return - } + printCommandHelp(os.Args[1]) + return } var err error @@ -83,10 +81,7 @@ func printUsage() { _, _ = fmt.Fprintln(os.Stdout, "Use 'mcp-publisher --help' for more information about a command.") } -// printCommandHelp prints help for a specific command and reports whether it had -// an entry here. Commands without one parse --help themselves, so the caller -// should fall through to normal dispatch when this returns false. -func printCommandHelp(command string) bool { +func printCommandHelp(command string) { switch command { case "init": _, _ = fmt.Fprintln(os.Stdout, "Create a server.json file template") @@ -170,8 +165,7 @@ func printCommandHelp(command string) bool { _, _ = fmt.Fprintln(os.Stdout, "You must be logged in before updating status. Run 'mcp-publisher login' first.") default: - return false + fmt.Fprintf(os.Stderr, "Unknown command: %s\n", command) + printUsage() } - - return true } diff --git a/complete.md b/complete.md new file mode 100644 index 0000000..e9040fa --- /dev/null +++ b/complete.md @@ -0,0 +1,2945 @@ +# Complete Documentation + +This file contains all documentation from the docs/ directory compiled into a single markdown file. + +--- + +## File: docs/README.md + +# MCP Registry Documentation + +The MCP registry provides MCP clients with a list of MCP servers, like an app store for MCP servers. + +## I want to... + +- **๐Ÿ“ค Publish my MCP server** โ†’ [Publishing Guide](guides/publishing/publish-server.md) +- **๐Ÿ“ฅ Consume registry data** โ†’ [API Usage Guide](guides/consuming/use-rest-api.md) +- **๐Ÿ”Œ Understand the registry's purpose** โ†’ [Ecosystem vision](explanations/ecosystem-vision.md) +- **๐Ÿ“‹ Look up specific information** โ†’ [server.json spec](reference/server-json/generic-server-json.md) | [API spec](reference/api/generic-registry-api.md) | [CLI reference](reference/cli/commands.md) + +## Documentation Index + +- ๐Ÿ› ๏ธ [How-To Guides: Task-focused instructions](./guides/) +- ๐Ÿ’ก [Explanations: Understanding-oriented content](./explanations/) +- ๐Ÿ“– [Reference: Technical specifications and lookup material](./reference/) + +--- + +## File: docs/explanations/README.md + +# Explanations + +Understanding-oriented documentation that clarifies and illuminates the MCP Registry. + +- [Design principles](design-principles.md) +- [Ecosystem vision](ecosystem-vision.md) +- [Roadmap](roadmap.md) +- [Tech architecture](tech-architecture.md) +- [Namespacing](namespacing.md) +- [Versioning](versioning.md) + +--- + +## File: docs/explanations/design-principles.md + +# MCP Registry Design Principles + +These are the core constraints that guide the design of the MCP Registry. They are not exhaustive, but they are the most important principles that we will use to evaluate design decisions. + +## 1. Single Source of Truth + +The registry serves as the authoritative metadata repository for publicly-available MCP servers, both locally-run and remote, open source and closed source. Server creators publish once, and all consumers (MCP clients, aggregators, etc.) reference the same canonical data. + +## 2. Minimal Operational Burden + +- Design for low maintenance and operational overhead +- Delegate complexity to existing services where possible (GitHub for auth, npm/PyPI/NuGet for packages) +- Avoid features that require constant human intervention or moderation +- Build for reasonable downtime tolerance (24h acceptable) by having consumers cache data for their end-users + +## 3. Vendor Neutrality + +- No preferential treatment for specific servers or organizations +- No built-in ranking, curation, or quality judgments +- Let consumers (MCP clients, aggregators) make their own curation decisions + +## 4. Meets Industry Security Standards + +- Leverage existing package registries (npm, PyPI, NuGet, Docker Hub, etc.) for source code distribution, obviating the need to reinvent source code security +- Use mechanisms like DNS verification, OAuth to provide base layer of authentication and trust +- Implement rate limiting, field validation, and blacklisting to prevent abuse + +## 6. Reusable, Extensible Shapes; Not Infrastructure + +- API shapes (OpenAPI, server.json) designed for reuse +- Enable private/internal registries using same formats +- Don't mandate infrastructure reuse - focus on interface compatibility + +## 7. Progressive Enhancement + +- Start with MVP that provides immediate value +- Build foundation that supports future features +- Don't over-engineer for hypothetical needs +- Each milestone should be independently valuable + +--- + +## File: docs/explanations/ecosystem-vision.md + +# Ecosystem Vision + +How the MCP Registry fits into the broader ecosystem and our vision for the future. + +## The Registry Ecosystem + +The MCP registry provides MCP clients with a list of MCP servers, like an app store for MCP servers. (In the future it might do more, like also hosting a list of clients). + +There are two parts to the registry project: + +1. ๐ŸŸฆ **The MCP registry spec**: An [API specification](../reference/api/) that allows anyone to implement a registry. +2. ๐ŸŸฅ **The Official MCP registry**: A hosted registry following the MCP registry spec at [`registry.modelcontextprotocol.io`](https://registry.modelcontextprotocol.io). This serves as the **authoritative repository** for publicly-available MCP servers. Server creators publish once, and all consumers (MCP clients, aggregators, marketplaces) reference the same canonical data. This is owned by the MCP open-source community, backed by major trusted contributors to the MCP ecosystem such as Anthropic, GitHub, PulseMCP and Microsoft. + +The registry is built around the [`server.json`](../reference/server-json/) format - a standardized way to describe MCP servers that works across discovery, initialization, and packaging scenarios. + +In time, we expect the ecosystem to look a bit like this: + +![](./ecosystem-diagram.excalidraw.svg) + +Note that MCP registries are _metaregistries_. They host metadata about packages, but not the package code or binaries. Instead, they reference other package registries (like NPM, PyPi or Docker) for this. + +Additionally, we expect clients pull from _subregistries_. These subregistries add value to the registry ecosystem by providing curation, or extending it with additional metadata. The Official MCP registry expects a lot of API requests from ETL jobs from these subregistries. + +## Registry vs Package Registry + +Key distinction: MCP Registries are **metaregistries**. + +- **Package registries** (npm, PyPI, Docker Hub) host actual code/binaries +- **The MCP Registry** hosts metadata pointing to those packages + +``` +MCP Registry: "weather-server v1.2.0 is at npm:weather-mcp" +NPM Registry: [actual weather-mcp package code] +``` + +## Official vs Community Registries + +**Official MCP Registry** (`registry.modelcontextprotocol.io`): +- Canonical source for publicly-available servers +- Community-owned, backed by trusted contributors +- Focuses on discoverability and basic metadata + +**Subregistries** (Smithery, PulseMCP, etc.): +- Add value through curation, ratings, enhanced metadata +- ETL from official registry + additional annotations +- Serve specific communities or use cases + +## How Servers Are Represented + +Each server entry contains: +- **Identity**: Unique name (`io.github.user/server-name`) +- **Packages**: Where to download it (`npm`, `pypi`, `docker`, etc.) +- **Runtime**: How to execute it (args, env vars) +- **Metadata**: Description, capabilities, version + +This is stored in a standardized `server.json` format that works across discovery, installation, and execution. + +--- + +## File: docs/explanations/roadmap.md + +# MCP Registry Roadmap + +This is a high-level roadmap for the MCP Registry. It is subject to change and not exhaustive, but it outlines the general thinking of the sequencing and scope of our work in this repository. + +This roadmap may occasionally drift out of date. Please review [Issues](https://github.com/modelcontextprotocol/registry/issues) (and corresponding Labels) for the most current work in progress. + +## Current Status + +The initial version of the MCP Registry is actively being developed. The initial focus is on delivering a REST API to which server creators can publish, and aggregator/marketplace consumers can ETL. + +## Phase 1: MVP/Go-Live (Current Focus) + +See the [go-live blocker issues](https://github.com/modelcontextprotocol/registry/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22go-live%20blocker%22). + +## Backlog (Future Work, may be moved to out of scope) + +- [ ] UI implementation +- [ ] Store and surface other data besides servers (e.g. [clients](https://modelcontextprotocol.io/clients), resources) +- [ ] Download count tracking +- [ ] Internationalization (i18n) + +## Out of Scope (Not Planned) + +- **Source code hosting**: The registry will never host actual server code +- **Quality rankings**: No built-in server quality assessments or rankings +- **Curation**: No editorial decisions about which servers are "better" +- **Unified runtime**: Not solving how servers are executed +- **Server hosting**: The registry does not provide hosting for servers +- **Search engine**: The registry will not provide a commercial grade search engine for servers +- **Server tags or categories**: Not supported, to reduce moderation burden +- **Server rankings**: The registry will not rank servers by subjective measures of quality + +--- + +## File: docs/explanations/tech-architecture.md + +# MCP Registry Technical Architecture + +This document describes the technical architecture of the MCP Registry, including system components, deployment strategies, and data flows. + +## System Overview + +The MCP Registry is designed as a lightweight metadata service that bridges MCP server creators with consumers (MCP clients and aggregators). + +## Core Components + +### REST API (Go) + +The main application server implemented in Go, providing: +- Public read endpoints for server discovery +- Authenticated write endpoints for server publication +- GitHub OAuth integration (extensible to other providers) +- DNS verification system (optional for custom namespaces) + +### Database (PostgreSQL) + +Primary data store for: +- Versioned server metadata (server.json contents) +- User authentication state +- DNS verification records + +### CDN Layer + +Critical for scalability: +- Caches all public read endpoints +- Reduces load on origin servers +- Enables global distribution +- Designed for daily consumer polling patterns + +### CLI Tool + +Developer interface for: +- Server publication workflow +- GitHub OAuth flow +- DNS verification + +## Deployment Architecture + +### Kubernetes Deployment (Helm) + +The registry is designed to run on Kubernetes using Helm charts: + +```mermaid +graph TB + subgraph "Kubernetes Cluster" + subgraph "Namespace: mcp-registry" + subgraph "Registry Service" + LB[Load Balancer
:80] + RS[Registry Service
:8080] + RP1[Registry Pod 1] + RP2[Registry Pod 2] + RP3[Registry Pod N] + end + + subgraph "Database Service" + DBS[DB Service
:27017] + SS[StatefulSet] + PV[Persistent Volume] + end + + subgraph "Secrets" + GHS[GitHub OAuth Secret] + end + end + end + + LB --> RS + RS --> RP1 + RS --> RP2 + RS --> RP3 + RP1 --> DBS + RP2 --> DBS + RP3 --> DBS + DBS --> SS + SS --> PV + RP1 -.-> GHS + RP2 -.-> GHS + RP3 -.-> GHS +``` + +## Data Flow Patterns + +### 1. Server Publication Flow + +```mermaid +sequenceDiagram + participant Dev as Developer + participant CLI as CLI Tool + participant API as Registry API + participant DB as Database + participant GH as GitHub + participant DNS as DNS Provider + + Dev->>CLI: mcp publish server.json + CLI->>CLI: Validate server.json + CLI->>GH: OAuth flow + GH-->>CLI: Access token + CLI->>API: POST /servers + API->>GH: Verify token + API->>DNS: Verify domain (if applicable) + API->>DB: Store metadata + API-->>CLI: Success + CLI-->>Dev: Published! +``` + +### 2. Consumer Discovery Flow + +```mermaid +sequenceDiagram + participant Client as MCP Client Host App + participant INT as Intermediary
(Marketplace/Aggregator) + participant CDN as CDN Cache + participant API as Registry API + participant DB as Database + + Note over INT,CDN: Daily ETL Process + INT->>CDN: GET /servers + alt Cache Hit + CDN-->>INT: Cached response + else Cache Miss + CDN->>API: GET /servers + API->>DB: Query servers + DB-->>API: Server list + API-->>CDN: Response + cache headers + CDN-->>INT: Response + end + INT->>INT: Process & enhance data + INT->>INT: Store in local cache + + Note over Client,INT: Real-time Client Access + Client->>INT: Request server list + INT-->>Client: Curated/enhanced data +``` + +### 3. DNS Verification Flow + +```mermaid +sequenceDiagram + participant User as User + participant CLI as CLI Tool + participant API as Registry API + participant DNS as DNS Provider + participant DB as Database + + User->>CLI: mcp verify-domain example.com + CLI->>API: POST /verify-domain + API->>API: Generate verification token + API->>DB: Store pending verification + API-->>CLI: TXT record: mcp-verify=abc123 + CLI-->>User: Add TXT record to DNS + User->>DNS: Configure TXT record + User->>CLI: Confirm added + CLI->>API: POST /verify-domain/check + API->>DNS: Query TXT records + DNS-->>API: TXT records + API->>API: Validate token + API->>DB: Store verification + API-->>CLI: Domain verified + CLI-->>User: Success! +``` + +### 4. Admin OIDC Authentication Flow + +For registry administration, users with @modelcontextprotocol.io Google Cloud Identity accounts can authenticate using OIDC: + +```mermaid +sequenceDiagram + participant Admin as Admin User + participant CLI as Admin CLI + participant GCP as Google Cloud Identity + participant API as Registry API + + Admin->>CLI: Request admin token + CLI->>GCP: gcloud auth print-identity-token --audiences=mcp-registry + GCP-->>CLI: ID Token (with hd: "modelcontextprotocol.io") + CLI->>API: POST /v0/auth/oidc {"oidc_token": "eyJ..."} + API->>GCP: Verify token signature (JWKS) + API->>API: Validate claims (issuer, audience, hd) + API->>API: Grant admin permissions (edit: *, publish: *) + API-->>CLI: Registry JWT Token + CLI->>API: POST /admin/* (with Registry JWT) + API->>API: Validate JWT + permissions + API-->>CLI: Admin operation success +``` + +**Usage:** +```bash +# Get Google Cloud Identity token +ID_TOKEN=$(gcloud auth print-identity-token) + +# Exchange for Registry JWT token +REGISTRY_TOKEN=$(curl -X POST /v0/auth/oidc \ + -H "Content-Type: application/json" \ + -d '{"oidc_token": "'$ID_TOKEN'"}' | jq -r .registry_token) + +# Use for admin operations +curl -H "Authorization: Bearer $REGISTRY_TOKEN" /v0/... +``` + +--- + +## File: docs/guides/README.md + +# How-To Guides + +Problem-oriented guides for specific tasks with the MCP Registry. + +## Publishing Servers + +- [Publish a server](publishing/publish-server.md) +- [GitHub Actions](publishing/github-actions.md) + +## Consuming Registry Data + +- [Use the REST API](consuming/use-rest-api.md) + +## Contributing + +- [Add package registry](contributing/add-package-registry.md) + +## Administration + +- [Admin operations](administration/admin-operations.md) +- [Moderation guidelines](administration/moderation-guidelines.md) + +--- + +## File: docs/guides/administration/admin-operations.md + +# Admin Operations + +This is a brief guide for admins and moderators managing content on the registry. All actions should be taken in line with the [moderation guidelines](moderation-guidelines.md). + +## Prerequisites + +- Admin account with @modelcontextprotocol.io email + - If you are a maintainer and would like an account, ask in the Discord +- `gcloud` CLI installed and configured +- `curl` and `jq` installed + +## Authentication + +```bash +# Run this, then run the export command it outputs +./tools/admin/auth.sh +``` + +## Edit a Server + +Step 1: Download Server + +```bash +export SERVER_ID="" +curl -s "https://registry.modelcontextprotocol.io/v0/servers/${SERVER_ID}" > server.json +``` + +Step 2: Open `server.json` and make changes. You cannot change the server name. + +Step 3: Push Changes + +```bash +curl -X PUT "https://registry.modelcontextprotocol.io/v0/servers/${SERVER_ID}" \ + -H "Authorization: Bearer ${REGISTRY_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "{\"server\": $(cat server.json)}" +``` + +## Takedown a Server + +```bash +export SERVER_ID="" +./tools/admin/takedown.sh +``` + +This soft deletes the server. If you need to delete the content of a server (usually only where legally necessary), use the edit workflow above to scrub it all. + +--- + +## File: docs/guides/administration/moderation-guidelines.md + +# Moderation Guidelines + +Guidelines for server publishers on the Official MCP Registry. + +## TL;DR + +We're quite permissive! We only remove illegal content, malware, spam and completely broken servers. + +We don't make guarantees about our moderation, and subregistries should take our data "as is", assuming minimal to no moderation. + +## Scope + +These guidelines apply to the **Official MCP Registry** at `registry.modelcontextprotocol.io`. + +Subregistries may have their own moderation policies. If you have questions about content on a specific subregistry, please contact them directly. + +## Disclaimer + +We have limited active moderation capabilities, and this is a community supported projects. We largely rely on upstream package registries (like NPM, PyPi, and Docker) or downstream subregistries (like the GitHub MCP Registry) to do more in-depth moderation. + +This means there may be content in the registry that should be removed under these guidelines, which we haven't yet removed. You should treat registry data accordingly. + +## What We Remove + +We'll remove servers that contain: + +- Illegal content, which includes obscene content, copyright violations, and hacking tools +- Malware, regardless of intentions +- Spam, especially mass-created servers that disrupt the registry. Examples: + - The same server being submitted multiple times under different names. + - The server doesn't do anything but provide a fixed response with some marketing copy. + - The server description is stuffed with marketing copy, and its implementation is unrelated to its name or description. +- Non-functioning servers + +## What We Don't Remove + +Generally, we believe in keeping the registry open and pushing moderation to subregistries. We therefore **won't** remove servers that are: + +- Low quality or buggy servers +- Servers with security vulnerabilities +- Do the same thing as other servers +- Provide or contain adult content + +## How Removal Works + +When we remove a server: + +- It's set to "deleted" status but remains accessible via the API +- This allows subregistries to remove it from their indexes +- In extreme cases, we may overwrite or erase details of a server, e.g. where the metadata itself is unlawful + +## Appeals + +Think we made a mistake? Open an issue on our [GitHub repository](https://github.com/modelcontextprotocol/registry) with: +- The ID and name of your server +- Why you believe it doesn't meet the criteria for removal above + +## Changes to this policy + +We're still learning how to best run the MCP registry! As such, we might end up changing this policy in the future. + +--- + +## File: docs/guides/contributing/add-package-registry.md + +# Adding a new package registry + +The MCP Registry project is a **metaregistry**, meaning that it hosts metadata for MCP servers but does not host the code for the servers directly. + +For local MCP servers, the MCP Registry has pointers in the `packages` node of the [`server.json`](../../reference/server-json/generic-server-json.md) schema that refer to packages in supported package managers. + +The list of supported package managers for hosting MCP servers is defined by the `properties.packages[N].properties.registry_type` string enum in the [`server.json` schema](../../reference/server-json/draft/server.schema.json). For example, this could be "npm" (for npmjs.com packages) or "pypi" (for PyPI packages). + +For remote MCP servers, the package registry is not relevant. The MCP client consumes the server via a URL instead of by downloading and running a package. In other words, this document only applies to local MCP servers. + +For the sake of illustration, this document will use npm (the Node.js package manager) as an example at each step. + +## Prerequisites + +The package registry must meet the following requirements: + +1. The package registry supports packaging and executing CLI apps. Local MCP servers use the [stdio transport](https://modelcontextprotocol.io/docs/concepts/transports#standard-input%2Foutput-stdio). + - npm CLI tools typically express their CLI commands in the [`bin` property of the package.json](https://docs.npmjs.com/cli/v11/configuring-npm/package-json#bin) +1. The package registry (or associated client tooling) has a widely accepted **single-shot** CLI command. + - npm's `npx` tool executes CLI commands using a [documented execution heuristic](https://docs.npmjs.com/cli/v11/commands/npx#description) + - For example, the MCP client can map the `server.json` metadata to an `npx` CLI execution, with args and environment variables populated via user input. +1. The package registry supports anonymous package downloads. This allows the MCP client software to use the metadata found in the MCP registry to discover, download, and execute package-based local MCP servers with minimal user intervention. + - `npx` by default connects to the public npmjs.com registry, allowing simple consumption of public npm packages. +1. The package registry should support a validation mechanism to verify ownership of the server name. This prevents misattribution and ensures that only the actual package owner can reference their packages in server registrations. For example: + - npm requires an `mcpName` field in `package.json` that matches the server name being registered + - PyPI requires a `mcp-name:` line in the package README/description + - Each registry type must implement a validation mechanism accessible via public API + +## Steps + +These steps may evolve as additional validations or details are discovered and mandated. + +1. [Create a feature request issue](https://github.com/modelcontextprotocol/registry/issues/new?template=feature_request.md) on the MCP Registry repository to begin the discussion about adding the package registry. + - Example for NuGet: https://github.com/modelcontextprotocol/registry/issues/126 +1. Open a PR with the following changes: + - Update the [`server.json` schema](../../reference/server-json/draft/server.schema.json) + - Add your package registry name to the `registry_type` example array. + - Add your package registry base url to the `registry_base_url` example array. + - Add the single-shot CLI command name to the `runtime_hint` example value array. + - Update the [`openapi.yaml`](../../reference/api/openapi.yaml) + - Add your package registry name to the `registry_type` enum value array. + - Add your package registry base url to the `registry_base_url` enum value array. + - Add the single-shot CLI command name to the `runtime_hint` example value array. + - Add a sample, minimal `server.json` to the [`server.json` examples](../../reference/server-json/generic-server-json.md). + - Implement a registry validator: + - Create a new validator file: `internal/validators/registries/yourregistry.go`, following the pattern of existing validators. Examples: + - **npm**: Checks for an `mcpName` field in `package.json` that matches the server name + - **PyPI**: Searches for `mcp-name: server-name` format in the package README content + - **NuGet**: Looks for `mcp-name: server-name` format in the package README file + - **Docker/OCI**: Validates a Docker image label `io.modelcontextprotocol.server.name` in the image manifest + - Add corresponding unit tests: `internal/validators/registries/yourregistry_test.go` + - Register your validator in `internal/validators/validators.go` + - Update the publishing documentation: + - Add a new publishing guide: `docs/guides/publishing/publish-[yourregistry].md`, following the pattern of existing publishing guides (e.g., `publish-npm.md`, `publish-pypi.md`) + - Include instructions on how to prepare packages for your registry, including any specific validation requirements + - Update `docs/guides/publishing/README.md` to reference your new publishing guide + +--- + +## File: docs/reference/README.md + +# Reference Documentation + +Technical specifications and quick lookups for the MCP Registry. + +## API Reference + +- [Generic Registry API](./api/generic-registry-api.md) +- [Official Registry API](./api/official-registry-api.md) + +## server.json Reference + +- [Generic server.json Format](./server-json/generic-server-json.md) +- [Official Registry Requirements](./server-json/official-registry-requirements.md) + +## CLI Reference + +- [Commands](./cli/commands.md) + +## Quick Reference + +- [FAQ](./faq.md) + +--- + +## File: docs/reference/server-json/official-registry-requirements.md + +# Official Registry Server.json Requirements + +This document describes the additional requirements and validation rules that apply when publishing to the official MCP Registry at `registry.modelcontextprotocol.io`. + +For step-by-step publishing instructions, see the [publishing guide](../../guides/publishing/publish-server.md). + +## Overview + +While the [generic server.json format](./generic-server-json.md) defines the base specification, the official registry enforces additional validation to ensure: + +- **Namespace authentication** - Servers are published under appropriate namespaces +- **Package ownership verification** - Publishers actually control referenced packages +- **Remote server URL match** - Remote server base urls match namespaces +- **Restricted registry base urls** - Packages are from trusted public registries +- **`_meta` namespace restrictions** - Restricted to `publisher` key only + +## Namespace Authentication + +Publishers must prove ownership of their namespace. For example to publish to `com.example/server`, the publisher must prove they own the `example.com` domain. + +See the [publishing guide](../../guides/publishing/publish-server.md) for authentication details for GitHub and domain namespaces. + +## Package Ownership Verification + +All packages must include metadata proving the publisher owns them. This prevents impersonation and ensures authenticity (see more reasoning in [#96](https://github.com/modelcontextprotocol/registry/issues/96)). + +For detailed verification requirements for each registry type, see the [publishing guide](../../guides/publishing/publish-server.md). + +## Remote Server URL Match + +Remote servers must use URLs that match the publisher's domain from their namespace. For example, `com.example/server` can only use remote URLs on `example.com` or its subdomains. + +## Restricted Registry Base URLs + +Only trusted public registries are supported. Private registries and alternative mirrors are not allowed. + +**Supported registries:** +- **NPM**: `https://registry.npmjs.org` only +- **PyPI**: `https://pypi.org` only +- **NuGet**: `https://api.nuget.org/v3/index.json` +- **Docker/OCI**: `https://docker.io` only +- **MCPB**: `https://github.com` releases and `https://gitlab.com` releases only + +## `_meta` Namespace Restrictions + +The `_meta` field is restricted to the `publisher` key only during publishing. This `_meta.publisher` extension is currently limited to 4KB. + +Registry metadata is added automatically and cannot be overridden. + +--- + +## File: docs/terms.md + +# Official MCP Registry Terms + +Effective date: 2025-09-02 + +## Overview + +These terms ("Terms") govern your access to and use of the official MCP Registry (the service hosted at [https://registry.modelcontextprotocol.io/](https://registry.modelcontextprotocol.io/) or a successor location) ("Registry"), including submissions or publications of MCP servers, references to MCP servers or to data about such servers and/or their developers ("Registry Data"), and related conduct. The Registry is intended to be a centralized repository of MCP servers developed by community members to facilitate easy access by AI applications. + +These terms are governed by the laws of the State of California. + +## For All Users + +1. No Warranties. The Registry is provided "as is" with no warranties of any kind. That means we don't guarantee the accuracy, completeness, safety, durability, or availability of the Registry, servers included in the registry, or Registry Data. In short, we're also not responsible for any MCP servers or Registry Data, and we highly recommend that you evaluate each MCP server and its suitability for your intended use case(s) before deciding whether to use it. + +2. Access and Use Requirements. To access or use the Registry, you must: + 1. Be at least 18 years old. + 2. Use the Registry, MCP servers in the Registry, and Registry Data only in ways that are legal under the applicable laws of the United States or other countries including the country in which you are a resident or from which you access and use the Registry, and not be barred from accessing or using the Registry under such laws. You will comply with all applicable law, regulation, and third party rights (including, without limitation, laws regarding the import or export of data or software, privacy, intellectual property, and local laws). You will not use the Registry, MCP servers, or Registry Data to encourage or promote illegal activity or the violation of third party rights or terms of service. + 3. Log in via method(s) approved by the Registry maintainers, which may involve using applications or other software owned by third parties. + +3. Entity Use. If you are accessing or using the Registry on behalf of an entity, you represent and warrant that you have authority to bind that entity to these Terms. By accepting these Terms, you are doing so on behalf of that entity (and all references to "you" in these Terms refer to that entity). + +4. Account Information. In order to access or use the Registry, you may be required to provide certain information (such as identification or contact details) as part of a registration process or in connection with your access or use of the Registry or MCP servers therein. Any information you give must be accurate and up-to-date, and you agree to inform us promptly of any updates. You understand that your use of the Registry may be monitored to ensure quality and verify your compliance with these Terms. + +5. Feedback. You are under no obligation to provide feedback or suggestions. If you provide feedback or suggestions about the Registry or the Model Context Protocol, then we (and those we allow) may use such information without obligation to you. + +6. Branding. Only use the term "Official MCP Registry" where it is clear it refers to the Registry, and does not imply affiliation, endorsement, or sponsorship. For example, you can permissibly say "Acme Inc. keeps its data up to date by automatically pulling data from the Official MCP Registry" or "This data comes from the Official MCP Registry," but cannot say "This is the website for the Official MCP Registry," "We're the premier destination to view Official MCP Registry data," or "We've partnered with the Official MCP Registry to provide this data." + +7. Modification. We may modify the Terms or any portion to, for example, reflect changes to the law or changes to the Model Context Protocol. We'll post notice of modifications to the Terms to this website or a successor location. If you do not agree to the modified Terms, you should discontinue your access to and/or use of the Registry. Your continued access to and/or use of the Registry constitutes your acceptance of any modified Terms. + +8. Additional Terms. Depending on your intended use case(s), you must also abide by applicable terms below. + +## For MCP Developers + +9. Prohibitions. By accessing and using the Registry, including by submitting MCP servers and/or Registry Data, you agree not to: + 1. Share malicious or harmful content, such as malware, even in good faith or for research purposes, or perform any action with the intent of introducing any viruses, worms, defects, Trojan horses, malware, or any items of a destructive nature; + 2. Defame, abuse, harass, stalk, or threaten others; + 3. Interfere with or disrupt the Registry or any associated servers or networks; + 4. Submit data with the intent of confusing or misleading others, including but not limited to via spam, posting off-topic marketing content, posting MCP servers in a way that falsely implies affiliation with or endorsement by a third party, or repeatedly posting the same or similar MCP servers under different names; + 5. Promote or facilitate unlawful online gambling or disruptive commercial messages or advertisements; + 6. Use the Registry for any activities where the use or failure of the Registry could lead to death, personal injury, or environmental damage; + 7. Use the Registry to process or store any data that is subject to the International Traffic in Arms Regulations maintained by the U.S. Department of State. + +10. License. You agree that metadata about MCP servers you submit (e.g., schema name and description, URLs, identifiers) and other Registry Data is intended to be public, and will be dedicated to the public domain under [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/). By submitting such data, you agree that you have the legal right to make this dedication (i.e., you own the copyright to these submissions or have permission from the copyright owner(s) to do so) and intend to do so. You understand that this dedication is perpetual, irrevocable, and worldwide, and you waive any moral rights you may have in your contributions to the fullest extent permitted by law. This dedication applies only to Registry Data and not to packages in third party registries that you might point to. + +11. Privacy and Publicity. You understand that any MCP server metadata you publish may be made public. This includes personal data such as your GitHub username, domain name, or details from your server description. Moreover, you understand that others may process personal information included in your MCP server metadata. For example, subregistries might enrich this data by adding how many stars your GitHub repository has, or perform automated security scanning on your code. By publishing a server, you agree that others may engage in this sort of processing, and you waive rights you might have in some jurisdictions to access, rectify, erase, restrict, or object to such processing. + +--- + +## File: docs/guides/contributing/releasing.md + +# Release Guide + +## Creating a Release + +1. **Go to GitHub**: Navigate to https://github.com/modelcontextprotocol/registry/releases +2. **Click "Draft a new release"** +3. **Choose a tag**: Click "Choose a tag" and type a new semantic version that follows the last one available (e.g., `v1.0.0`) +5. **Generate notes**: Click "Generate release notes" to auto-populate the name and description +6. **Publish**: Click "Publish release" + +The release workflow will automatically: +- Build binaries for 6 platforms (Linux, macOS, Windows ร— amd64, arm64) +- Create and push Docker images with `:latest` and `:vX.Y.Z` tags +- Attach all artifacts to the GitHub release +- Generate checksums and signatures + +## After Release + +- Docker images will be available at: + - `ghcr.io/modelcontextprotocol/registry:latest` - Latest stable release + - `ghcr.io/modelcontextprotocol/registry:vX.Y.Z` - Specific release version +- Binaries can be downloaded from the GitHub release page + +## Docker Image Tags + +The registry publishes different Docker image tags for different use cases: + +- **`:latest`** - Latest stable release (updated only on releases) +- **`:vX.Y.Z`** - Specific release versions (e.g., `:v1.0.0`) +- **`:main`** - Rolling tag updated on every push to main branch (continuous deployment) +- **`:main-YYYYMMDD-sha`** - Specific development builds from main branch + +## Versioning + +We use semantic versioning (SemVer): +- `v1.0.0` - Major release with breaking changes +- `v1.1.0` - Minor release with new features +- `v1.0.1` - Patch release with bug fixes + +--- + +## File: docs/reference/api/official-registry-api.md + +# Official MCP Registry API + +This document describes the API for the official MCP Registry hosted at `registry.modelcontextprotocol.io`. + +This API is based on the [generic registry API](./generic-registry-api.md) with additional endpoints and authentication. For practical examples of consuming the API, see the [API usage guide](../../guides/consuming/use-rest-api.md). For publishing servers using the API, see the [publishing guide](../../guides/publishing/publish-server.md). + +## Base URLs + +- **Production**: `https://registry.modelcontextprotocol.io` +- **Staging**: `https://staging.registry.modelcontextprotocol.io` + +## Interactive Documentation + +- **[Live API Docs](https://registry.modelcontextprotocol.io/docs)** - Stoplight elements with try-it-now functionality +- **[OpenAPI Spec](https://registry.modelcontextprotocol.io/openapi.yaml)** - Complete machine-readable specification + +## Extensions + +The official registry implements the [Generic Registry API](./generic-registry-api.md) with the following specific configurations and extensions: + +### Authentication + +Publishing requires namespace-based authentication: + +- **GitHub OAuth** - For `io.github.*` namespaces +- **GitHub OIDC** - For publishing from GitHub Actions +- **DNS verification** - For domain-based namespaces (`com.example.*`) +- **HTTP verification** - For domain-based namespaces (`com.example.*`) + +See [Publisher Commands](../cli/commands.md) for authentication setup. + +### Package Validation + +The official registry enforces additional [package validation requirements](../server-json/official-registry-requirements.md) when publishing. + +### Server List Filtering + +The official registry extends the `GET /v0/servers` endpoint with additional query parameters for improved discovery and synchronization: + +- `updated_since` - Filter servers updated after RFC3339 timestamp (e.g., `2025-08-07T13:15:04.280Z`) +- `search` - Case-insensitive substring search on server names (e.g., `filesystem`) + - This is intentionally simple. For more advanced searching and filtering, use a subregistry. +- `version` - Filter by version (currently supports `latest` for latest versions only) + +These extensions enable efficient incremental synchronization for downstream registries and improved server discovery. Parameters can be combined and work with standard cursor-based pagination. + +Example: `GET /v0/servers?search=filesystem&updated_since=2025-08-01T00:00:00Z&version=latest` + +### Additional endpoints +- POST `/v0/auth/dns` - Exchange signed DNS challenge for auth token +- POST `/v0/auth/http` - Exchange signed HTTP challenge for auth token +- POST `/v0/auth/github-at` - Exchange GitHub access token for auth token +- POST `/v0/auth/github-oidc` - Exchange GitHub OIDC token for auth token +- POST `/v0/auth/oidc` - Exchange Google OIDC token for auth token (for admins) + +#### Admin endpoints +- GET `/metrics` - Prometheus metrics endpoint +- GET `/v0/health` - Basic health check endpoint +- PUT `/v0/servers/{id}` - Edit existing server + +--- + +## File: docs/explanations/namespacing.md + +# Namespacing and Security + +Namespacing prevents name squatting, makes impersonation and typo squatting much harder, and provides attribution through domain-based identity. + +For practical steps on how to authenticate for different namespaces, see the [publishing guide](../guides/publishing/publish-server.md#authenticate). + +## Namespace Format + +All server names follow reverse-DNS format. Examples: +- `io.github.alice/weather-server` - GitHub user `alice` +- `com.acme/internal-tool` - Company domain `acme.com` +- `org.nonprofit.research/data-analyzer` - Subdomain `research.nonprofit.org` + +## Security Model + +### Ownership Verification + +Publishing to a namespace requires proving you control the corresponding identity: + +**GitHub namespaces** (`io.github.*`): +- OAuth login to GitHub account/organization +- OIDC tokens in GitHub Actions workflows + +**Domain namespaces** (`com.company.*`): +- DNS verification: TXT record at `company.com` +- HTTP verification: File at `https://company.com/.well-known/mcp-registry-auth` + +## Namespace Scoping + +Different authentication methods grant different namespace access: + +**GitHub OAuth/OIDC**: +- `io.github.username/*` (for personal accounts) +- `io.github.orgname/*` (for organizations) + +**DNS verification**: +- `com.domain/*` and `com.domain.*/*` (domain + all subdomains) + +**HTTP verification**: +- `com.domain/*` only (exact domain, no subdomains) + +## Limitations + +**Domain ownership changes**: If someone loses/sells a domain, they lose publishing rights. Similarly if someone gains a domain, they gain publishing rights. +**Package validation**: Registry validates namespace ownership, but actual packages may still be malicious etc. + +--- + +## File: docs/explanations/versioning.md + +# Server Versioning Guide + +This document describes the versioning approach for MCP servers published to the registry. + +## Overview + +The MCP Registry supports flexible versioning while encouraging semantic versioning best practices. The registry attempts to parse versions as semantic versions for ordering and comparison, but falls back gracefully for non-semantic versions. + +## Version Requirements + +1. **Version String**: `version` MUST be a string up to 255 characters +2. **Uniqueness**: Each version for a given server name must be unique +3. **Immutability**: Once published, version metadata cannot be changed + +## Best Practices + +### 1. Use Semantic Versioning +Server authors SHOULD use [semantic versions](https://semver.org/) following the `MAJOR.MINOR.PATCH` format: + +```json +{ + "version": "1.2.3" +} +``` + +### 2. Align with Package Versions +Server authors SHOULD use versions aligned with their underlying packages to reduce confusion: + +```json +{ + "version": "1.2.3", + "packages": [{ + "registry_name": "npm", + "name": "@myorg/my-server", + "version": "1.2.3" + }] +} +``` + +### 3. Multiple Registry Versions +If server authors expect to have multiple registry versions for the same package version, they SHOULD follow the semantic version spec using the prerelease label: + +```json +{ + "version": "1.2.3-1", + "packages": [{ + "registry_name": "npm", + "name": "@myorg/my-server", + "version": "1.2.3" + }] +} +``` + +**Note**: According to semantic versioning, `1.2.3-1` is considered lower than `1.2.3`, so if you expect to need a `1.2.3-1`, you should publish that before `1.2.3`. + +## Version Ordering and "Latest" Determination + +### For Semantic Versions +The registry attempts to parse versions as semantic versions. If successful, it uses semantic version comparison rules to determine: +- Version ordering in lists +- Which version is marked as `is_latest` + +### For Non-Semantic Versions +If version parsing as semantic version fails: +- The registry will always mark the version as latest (overriding any previous version) +- Clients should fall back to using publish timestamp for ordering + +**Important Note**: This behavior means that for servers with mixed semantic and non-semantic versions, the `is_latest` flag may not align with the total ordering. A non-semantic version published after semantic versions will be marked as latest, even if semantic versions are considered "higher" in the ordering. + +## Implementation Details + +### Registry Behavior +1. **Validation**: Versions are validated for uniqueness within a server name +2. **Parsing**: The registry attempts to parse each version as semantic version +3. **Comparison**: Uses semantic version rules when possible, falls back to timestamp +4. **Latest Flag**: The `is_latest` field is set based on the comparison results + +### Client Recommendations +Registry clients SHOULD: +1. Attempt to interpret versions as semantic versions when possible +2. Use the following ordering rules: + - If one version is marked as is_latest: it is later + - If both versions are valid semver: use semver comparison + - If neither are valid semver: use publish timestamp + - If one is semver and one is not: semver version is considered higher + +## Examples + +### Valid Semantic Versions +```javascript +"1.0.0" // Basic semantic version +"2.1.3-alpha" // Prerelease version +"1.0.0-beta.1" // Prerelease with numeric suffix +"3.0.0-rc.2" // Release candidate +``` + +### Non-Semantic Versions (Allowed) +```javascript +"v1.0" // Version with prefix +"2021.03.15" // Date-based versioning +``` + +### Not Allowed: Version Ranges +The registry requires specific versions for both the top-level `version` and any `packages[].version`. Version ranges or wildcard versions are rejected during publish, including but not limited to: + +```javascript +"^1.2.3" +"~1.2.3" +">=1.2.3" +"<=1.2.3" +">1.2.3" +"<1.2.3" +"1.x" +"1.2.*" +"1 - 2" +"1.2 || 1.3" +``` + +### Alignment Examples +```json +{ + "version": "1.2.3-1", + "packages": [{ + "registry_name": "npm", + "name": "@myorg/k8s-server", + "version": "1.2.3" + }] +} +``` + +## Migration Path + +Existing servers with non-semantic versions will continue to work without changes. However, to benefit from proper version ordering, server maintainers are encouraged to: + +1. Adopt semantic versioning for new releases +2. Consider the ordering implications when transitioning from non-semantic to semantic versions +3. Use prerelease labels for registry-specific versioning needs + +## Common Scenarios + +### Standard Releases +**Package and server versions aligned**: +```json +{ + "version": "1.2.3", + "packages": [ + { + "registry_type": "npm", + "identifier": "@myorg/server", + "version": "1.2.3" + } + ] +} +``` + +### Registry-Only Updates +**Server metadata changes without package updates**: +```json +{ + "version": "1.2.3-1", + "packages": [ + { + "registry_type": "npm", + "identifier": "@myorg/server", + "version": "1.2.3" + } + ] +} +``` + +Note: `1.2.3-1` is considered lower than `1.2.3` in semver ordering. Publish prerelease versions first. + +### Remote Server Versioning +**Remote servers without package dependencies**: +```json +{ + "version": "2.1.0", + "remotes": [ + { + "transport_type": "sse", + "url": "https://api.myservice.com/mcp/v2.1" + } + ] +} +``` + +Version strategy options: +- **API versioning**: Match your service API version +- **Semantic versioning**: Standard semver for feature changes +- **Date-based**: `2024.03.15` for regular releases + +### Multi-Package Versioning +**Different package versions**: +```json +{ + "version": "1.3.0", + "packages": [ + { + "registry_type": "npm", + "identifier": "@myorg/server", + "version": "1.3.0" + }, + { + "registry_type": "oci", + "identifier": "myorg/server", + "version": "1.2.5" + } + ] +} +``` + +Use server version to indicate the overall release. + +## Decision Guide + +**Which version strategy should I use?** + +``` +Do you have underlying packages? +โ”œโ”€ Yes: Align with package version +โ”‚ โ”œโ”€ Same package version โ†’ Use package version +โ”‚ โ””โ”€ Different package versions โ†’ Use highest + indicate relationship +โ””โ”€ No (remote server): Choose versioning scheme + โ”œโ”€ API versioning โ†’ Match service API version + โ”œโ”€ Feature-based โ†’ Use semantic versioning + โ””โ”€ Regular releases โ†’ Consider date-based versioning +``` + +## Future Considerations + +This versioning approach is designed to be compatible with potential future changes to the MCP specification's `Implementation.version` field. Any SHOULD requirements introduced here may be proposed as updates to the specification through the SEP (Specification Enhancement Proposal) process. + +--- + +## File: docs/guides/consuming/use-rest-api.md + +# Consuming Registry Data via REST API + +Integration patterns and best practices for building applications that consume MCP registry data. + +## Key details + +**Base URL**: `https://registry.modelcontextprotocol.io` + +**Authentication**: Not required for read-only access + +- **`GET /v0/servers`** - List all servers with pagination +- **`GET /v0/servers/{id}`** - Get server details by UUID + +See the [interactive API documentation](https://registry.modelcontextprotocol.io/docs) for complete request/response schemas. + +**Disclaimer**: The official registry provides no uptime or data durability guarantees. You should design your applications to handle service downtime via caching. + +## Building a subregistry +**Create enhanced registries** - ETL official registry data and add your own metadata like ratings, security scans, or compatibility info. + +For now we recommend scraping the `GET /v0/servers` endpoint on some regular basis. In the future we might provide a filter for updated_at ([#291](https://github.com/modelcontextprotocol/registry/issues/291)) to get only recently changed servers. + +Servers are generally immutable, except for the `status` field which can be updated to `deleted` (among other states). For these packages, we recommend you also update the status field to `deleted` or remove the package from your registry quickly. This is because this status generally indicates it has violated our permissive [moderation guidelines](../administration/moderation-guidelines.md), suggesting it is illegal, malware or spam. + +### Filtering & Enhancement + +The official registry has a [permissive moderation policy](../administration/moderation-guidelines.md), so you may want to implement your own filtering on top of registry data. + +You can also add custom metadata to servers using the `_meta` field. For example, user ratings, download counts, or security scan results. If you do this, we recommend you put this under a key that is namespaced to your organization, for example: + +```json +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "io.github.yourname/weather-server", + "description": "MCP server for weather data access", + "status": "active", + "version": "1.0.0", + "packages": [ + { + "registry_type": "npm", + "identifier": "weather-mcp-server", + "version": "1.0.0" + } + ], + "_meta": { + "com.example.subregistry/custom": { + "user_rating": 4.5, + "download_count": 12345, + "security_scan": { + "last_scanned": "2024-06-01T12:00:00Z", + "vulnerabilities_found": 0 + } + } + } +} +``` + +### Providing an API + +We recommend that your subregistry provides an API meeting the registry API specification, so it's easy for clients to switch between registries. See the [registry API documentation](../../reference/api/) for details. + +## MCP Client Integration +**Convert registry data to client configuration** - Fetch servers and transform package information into your MCP client's config format. + +We highly recommend using a subregistry rather than fetching data from the official registry directly. You might want to make this configurable so that users of your client can choose their preferred registry, for example we expect that some enterprise users may have their own registry. + +Your client should gracefully handle registries that meet the minimum spec, i.e. avoid hard dependencies on `_meta` fields. + +### Filtering + +You likely should filter out servers that are not `active` in the `status` field. + +### Running servers + +You can use the `packages` or `remotes` field to determine how to run a server. More details of these fields are in the [server.json documentation](../../reference/server-json/generic-server-json.md). + +--- + +## File: docs/guides/publishing/github-actions.md + +# Automate Publishing with GitHub Actions + +Set up automated MCP server publishing using GitHub Actions. + +## What You'll Learn + +By the end of this tutorial, you'll have: + +- A GitHub Actions workflow that automatically publishes your server +- Understanding of GitHub OIDC authentication +- Knowledge of best practices for automated publishing +- Working examples for Node.js, Python, and Docker projects + +## Prerequisites + +- Understand general publishing requirements like package verification (see the [publishing guide](publish-server.md)) +- GitHub repository with your MCP server code + +## GitHub Actions Setup + +### Step 1: Create Workflow File + +Create `.github/workflows/publish-mcp.yml`. Here's an example for NPM-based packages, but the MCP registry publishing steps are the same for all package types: + +```yaml +name: Publish to MCP Registry + +on: + push: + tags: ["v*"] # Triggers on version tags like v1.0.0 + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + id-token: write # Required for OIDC authentication + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v5 + + - name: Setup Node.js # Adjust for your language + uses: actions/setup-node@v5 + with: + node-version: "lts/*" + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm run test --if-present + + - name: Build package + run: npm run build --if-present + + - name: Publish to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + - name: Install MCP Publisher + run: | + curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher + + - name: Login to MCP Registry + run: ./mcp-publisher login github-oidc + + - name: Publish to MCP Registry + run: ./mcp-publisher publish +``` + +### Step 2: Configure Secrets + +You don't need any secrets for publishing to the MCP Registry using GitHub OIDC. + +However you might need to add secrets for your package registry. For example the workflow above needs a `NPM_TOKEN` (which you can add in Settings โ†’ Secrets and variables โ†’ Actions). + +### Step 3: Tag and Release + +Create a version tag to trigger the workflow: + +```bash +git tag v1.0.0 +git push origin v1.0.0 +``` + +The workflow runs tests, builds your package, publishes to npm, and publishes to the MCP Registry. + +## Authentication Methods + +### GitHub Actions OIDC (Recommended) + +```yaml +- name: Login to MCP Registry + run: mcp-publisher login github-oidc +``` + +### GitHub Personal Access Token + +```yaml +- name: Login to MCP Registry + run: mcp-publisher login github --token ${{ secrets.GITHUB_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.MCP_GITHUB_TOKEN }} +``` + +Add `MCP_GITHUB_TOKEN` secret with a GitHub PAT that has repo access. + +### DNS Authentication + +For custom domain namespaces (`com.yourcompany/*`): + +```yaml +- name: Login to MCP Registry + run: | + echo "${{ secrets.MCP_PRIVATE_KEY }}" > key.pem + mcp-publisher login dns --domain yourcompany.com --private-key-file key.pem +``` + +Add your Ed25519 private key as `MCP_PRIVATE_KEY` secret. + +## Examples + +See these real-world examples of automated publishing workflows: +- [NPM, Docker and MCPB](https://github.com/domdomegg/airtable-mcp-server) +- [NuGet](https://github.com/domdomegg/time-mcp-nuget) +- [PyPI](https://github.com/domdomegg/time-mcp-pypi) + +## Tips + +You can keep your package version and server.json version in sync automatically with something like: +```yaml +- run: | + VERSION=${GITHUB_REF#refs/tags/v} + jq --arg v "$VERSION" '.version = $v' server.json > tmp && mv tmp server.json +``` + +## Troubleshooting +- **"Authentication failed"**: Ensure `id-token: write` permission is set for OIDC, or check secrets +- **"Package validation failed"**: Verify your package published to your registry (NPM, PyPi etc.) successfully first, and that you have done the necessary validation steps in the [Publishing Tutorial](publish-server.md) + +--- + +## File: docs/guides/publishing/publish-server.md + +# Publish Your MCP Server + +Complete guide to publishing an MCP server to the registry. + +> [!TIP] +> Using an agentic AI coding assistant? Just use this prompt: +> ``` +> Read https://raw.githubusercontent.com/modelcontextprotocol/registry/refs/heads/main/docs/guides/publishing/publish-server.md and https://raw.githubusercontent.com/modelcontextprotocol/registry/refs/heads/main/docs/guides/publishing/github-actions.md. Evaluate the best way to publish this server to the registry (prefer automated CI flows over manual flows where possible), and implement that. If possible, validate the server.json against the $schema before telling the user you are done, using a proper json schema library or tool available on the user's machine. If you get stuck, guide the user through the parts of the publishing process they need to do (e.g. logging into the publisher CLI if doing manual pubishing). +> ``` + +## What You'll Learn + +By the end of this tutorial, you'll have: +- Created a server.json file for your MCP server +- Authenticated with the registry +- Successfully published your server +- Verified your server appears in the registry + +## Prerequisites + +- An MCP server you've already built ([follow this guide if you don't have one already](https://modelcontextprotocol.io/quickstart/server)) + +## Deployment Options + +You can make your MCP server available in multiple ways: + +- **๐Ÿ“ฆ Package deployment**: Published to registries (npm, PyPI, Docker Hub, etc.) and run locally by clients +- **๐ŸŒ Remote deployment**: Hosted as a web service that clients connect to directly +- **๐Ÿ”„ Hybrid deployment**: Offer both package and remote options for maximum flexibility + +Learn more about [MCP server architecture](https://modelcontextprotocol.io/docs/concepts/servers) in the official docs. + +## Step 1: Install the Publisher CLI + +
+๐Ÿบ macOS/Linux/WSL: With Homebrew (recommended) + +Requires [Homebrew](https://brew.sh): + +```bash +brew install mcp-publisher +``` + +
+ +
+โฌ‡๏ธ macOS/Linux/WSL: Pre-built binaries + +```bash +curl -L "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher && sudo mv mcp-publisher /usr/local/bin/ +``` + +
+ +
+๐Ÿ—๏ธ macOS/Linux/WSL: From source + +Requires Git, Make and Go 1.24+: + +```bash +# Clone the registry repository +git clone https://github.com/modelcontextprotocol/registry +cd registry +make publisher + +# The binary will be at bin/mcp-publisher +export PATH=$PATH:$(pwd)/bin +``` + +
+ +
+๐ŸชŸ Windows PowerShell: Pre-built binaries + +```powershell +$arch = if ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq "Arm64") { "arm64" } else { "amd64" }; Invoke-WebRequest -Uri "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_windows_$arch.tar.gz" -OutFile "mcp-publisher.tar.gz"; tar xf mcp-publisher.tar.gz mcp-publisher.exe; rm mcp-publisher.tar.gz +# Move mcp-publisher.exe to a directory in your PATH +``` + +
+ +## Step 2: Initialize Your server.json + +Navigate to your server's directory and create a template: + +```bash +cd /path/to/your/mcp-server +mcp-publisher init +``` + +This creates a `server.json` with auto-detected values. You'll see something like: + +```json +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "io.github.yourname/your-server", + "description": "A description of your MCP server", + "version": "1.0.0", + "packages": [ + { + "registry_type": "npm", + "identifier": "your-package-name", + "version": "1.0.0" + } + ] +} +``` + +## Step 3: Configure Your Server Details + +Edit the generated `server.json`: + +### Choose Your Namespace + +The `name` field determines authentication requirements: + +- **`io.github.yourname/*`** - Requires GitHub authentication +- **`com.yourcompany/*`** - Requires DNS or HTTP domain verification + +### Configure Deployment Methods + +Configure your server to support packages, remotes, or both: + +#### Package Deployment + +Add package validation metadata to prove ownership of your packages. + + +
+๐Ÿ“ฆ NPM Packages + +### Requirements +Add an `mcpName` field to your `package.json`: + +```json +{ + "name": "your-npm-package", + "version": "1.0.0", + "mcpName": "io.github.username/server-name" +} +``` + +### How It Works +- Registry fetches `https://registry.npmjs.org/your-npm-package` +- Checks that `mcpName` field matches your server name +- Fails if field is missing or doesn't match + +### Example server.json +```json +{ + "name": "io.github.username/server-name", + "packages": [ + { + "registry_type": "npm", + "identifier": "your-npm-package", + "version": "1.0.0" + } + ] +} +``` + +The official MCP registry currently only supports the NPM public registry (`https://registry.npmjs.org`). + +
+ +
+๐Ÿ PyPI Packages + +### Requirements +Include your server name in your package README file using this format: + +**MCP name format**: `mcp-name: io.github.username/server-name` + +Add it to your README.md file (which becomes the package description on PyPI). This can be in a comment if you want to hide it from display elsewhere. + +### How It Works +- Registry fetches `https://pypi.org/pypi/your-package/json` +- Passes if `mcp-name: server-name` is in the README content + +### Example server.json +```json +{ + "name": "io.github.username/server-name", + "packages": [ + { + "registry_type": "pypi", + "identifier": "your-pypi-package", + "version": "1.0.0" + } + ] +} +``` + +The official MCP registry currently only supports the official PyPI registry (`https://pypi.org`). + +
+ +
+๐Ÿ“‹ NuGet Packages + +### Requirements +Include your server name in your package's README using this format: + +**MCP name format**: `mcp-name: io.github.username/server-name` + +Add a README file to your NuGet package that includes the server name. This can be in a comment if you want to hide it from display elsewhere. + +### How It Works +- Registry fetches and cached service index `https://api.nuget.org/v3/index.json` +- Registry uses `ReadmeUriTemplate/6.13.0` URL template in service index to fetch README +- Passes if `mcp-name: server-name` is found in the README content + +### Example server.json +```json +{ + "name": "io.github.username/server-name", + "packages": [ + { + "registry_type": "nuget", + "identifier": "Your.NuGet.Package", + "version": "1.0.0" + } + ] +} +``` + +The official MCP registry currently only supports the official NuGet registry (`https://api.nuget.org/v3/index.json`). + +
+ +
+๐Ÿณ Docker/OCI Images + +### Requirements +Add an annotation to your Docker image: + +```dockerfile +LABEL io.modelcontextprotocol.server.name="io.github.username/server-name" +``` + +### How It Works +- Registry authenticates with Docker Hub using public token +- Fetches image manifest using Docker Registry v2 API +- Checks that `io.modelcontextprotocol.server.name` annotation matches your server name +- Fails if annotation is missing or doesn't match + +### Example server.json +```json +{ + "name": "io.github.username/server-name", + "packages": [ + { + "registry_type": "oci", + "identifier": "yourusername/your-mcp-server", + "version": "1.0.0" + } + ] +} +``` + +The identifier is `namespace/repository`, and version is the tag and optionally digest. + +The official MCP registry currently only supports the official Docker registry (`https://docker.io`). + +
+ +
+๐Ÿ“ MCPB Packages + +### Requirements +**MCP reference** - MCPB package URLs must contain "mcp" somewhere within them, to ensure the correct artifact has been uploaded. This may be with the `.mcpb` extension or in the name of your repository. + +**File integrity** - MCPB packages must include a SHA-256 hash for file integrity verification. This is required at publish time and MCP clients will validate this hash before installation. + +### How to Generate File Hashes +Calculate the SHA-256 hash of your MCPB file: + +```bash +openssl dgst -sha256 server.mcpb +``` + +### Example server.json +```json +{ + "name": "io.github.username/server-name", + "packages": [ + { + "registry_type": "mcpb", + "identifier": "https://github.com/you/your-repo/releases/download/v1.0.0/server.mcpb", + "file_sha256": "fe333e598595000ae021bd27117db32ec69af6987f507ba7a63c90638ff633ce" + } + ] +} +``` + +### File Hash Validation +- **Authors** are responsible for generating correct SHA-256 hashes when creating server.json +- **MCP clients** validate the hash before installing packages to ensure file integrity +- **The official registry** stores hashes but does not validate them +- **Subregistries** may choose to implement their own validation. This enables them to perform security scanning on MCPB files, and ensure clients get the same security scanned content. + +The official MCP registry currently only supports artifacts hosted on GitHub or GitLab releases. + +
+ +#### Remote Deployment + +Add the `remotes` field to your `server.json` (can coexist with `packages`): + +
+๐ŸŒ Remote Server Configuration + +### Requirements + +- **Service endpoint**: Your MCP server must be accessible at the specified URL +- **Transport protocol**: Choose from `sse` (Server-Sent Events) or `streamable-http` +- **URL validation**: For domain namespaces only (see URL requirements below) + +### Example server.json + +```json +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "com.yourcompany/api-server", + "description": "Cloud-hosted MCP server for API operations", + "version": "2.0.0", + "remotes": [ + { + "type": "sse", + "url": "https://mcp.yourcompany.com/sse" + } + ] +} +``` + +### Multiple Transport Options + +You can offer multiple connection methods: + +```json +{ + "remotes": [ + { + "type": "sse", + "url": "https://mcp.yourcompany.com/sse" + }, + { + "type": "streamable-http", + "url": "https://mcp.yourcompany.com/http" + } + ] +} +``` + +### URL Validation Requirements + +- For `com.yourcompany/*` namespaces: URLs must be on `yourcompany.com` or its subdomains +- For `io.github.username/*` namespaces: No URL restrictions (but you must authenticate via GitHub) + +### Authentication Headers (Optional) + +Configure headers that clients should send when connecting: + +```json +{ + "remotes": [ + { + "type": "sse", + "url": "https://mcp.yourcompany.com/sse", + "headers": [ + { + "name": "X-API-Key", + "description": "API key for authentication", + "is_required": true, + "is_secret": true + } + ] + } + ] +} +``` + +
+ +## Step 4: Authenticate + +Choose your authentication method based on your namespace: + +### GitHub Authentication (for io.github.* namespaces) + +```bash +mcp-publisher login github +``` + +This opens your browser for OAuth authentication. + +### DNS Authentication (for custom domains) + +```bash +# Generate keypair +openssl genpkey -algorithm Ed25519 -out key.pem + +# Get public key for DNS record +echo "yourcompany.com. IN TXT \"v=MCPv1; k=ed25519; p=$(openssl pkey -in key.pem -pubout -outform DER | tail -c 32 | base64)\"" + +# Add the TXT record to your DNS, then login +mcp-publisher login dns --domain yourcompany.com --private-key $(openssl pkey -in key.pem -noout -text | grep -A3 "priv:" | tail -n +2 | tr -d ' :\n') +``` + +## Step 5: Publish Your Server + +With authentication complete, publish your server: + +```bash +mcp-publisher publish +``` + +You'll see output like: +``` +โœ“ Successfully published +``` + +## Step 6: Verify Publication + +Check that your server appears in the registry by searching for it: + +```bash +curl "https://registry.modelcontextprotocol.io/v0/servers?search=io.github.yourname/weather-server" +``` + +You should see your server metadata returned in the JSON response. + +## Troubleshooting + +**"Package validation failed"** - Ensure your package includes the required validation metadata (mcpName field, README mention, or Docker label). + +**"Authentication failed"** - Verify you've correctly set up DNS records or are logged into the right GitHub account. + +**"Namespace not authorized"** - Your authentication method doesn't match your chosen namespace format. + +## Examples + +See these real-world examples of published servers: +- [NPM, Docker and MCPB example](https://github.com/domdomegg/airtable-mcp-server) +- [NuGet example](https://github.com/domdomegg/time-mcp-nuget) +- [PyPI example](https://github.com/domdomegg/time-mcp-pypi) + +## Next Steps + +- **Update your server**: Publish new versions with updated server.json files +- **Set up CI/CD**: Automate publishing with [GitHub Actions](github-actions.md) +- **Learn more**: Understand [server.json format](../../reference/server-json/generic-server-json.md) in depth +- **More examples**: See [remote server configurations](../../reference/server-json/generic-server-json.md#remote-server-example) and [hybrid deployments](../../reference/server-json/generic-server-json.md#server-with-remote-and-package-options) in the schema documentation + +## What You've Accomplished + +You've successfully published your first MCP server to the registry! Your server is now discoverable by MCP clients and can be installed by users worldwide. + +--- + +## File: docs/reference/api/generic-registry-api.md + +# Generic Registry API Specification + +A standardized RESTful HTTP API for MCP registries to provide consistent endpoints for discovering and retrieving MCP servers. + +Also see: +- For guidance consuming the API, see the [consuming guide](../../guides/consuming/use-rest-api.md). + +## Browse the Complete API Specification + +**๐Ÿ“‹ View the full API specification interactively**: Open [openapi.yaml](./openapi.yaml) in an OpenAPI viewer like [Stoplight Elements](https://elements-demo.stoplight.io/?spec=https://raw.githubusercontent.com/modelcontextprotocol/registry/refs/heads/main/docs/reference/api/openapi.yaml). + +The official registry has some more endpoints and restrictions on top of this. See the [official registry API spec](./official-registry-api.md) for details. + +## Quick Reference + +### Core Endpoints +- **`GET /v0/servers`** - List all servers with pagination +- **`GET /v0/servers/{id}`** - Get server details by UUID +- **`POST /v0/publish`** - Publish new server (optional, registry-specific authentication) + +### Authentication +- **Read operations**: No authentication required +- **Write operations**: Registry-specific authentication (if supported) + +### Content Type +All requests and responses use `application/json` + +### Basic Example: List Servers + +```bash +curl https://registry.example.com/v0/servers?limit=10 +``` + +```json +{ + "servers": [ + { + "name": "io.modelcontextprotocol/filesystem", + "description": "Filesystem operations server", + "status": "active", + "version": "1.0.2" + } + ], + "metadata": { + "count": 10, + "next_cursor": "eyJ..." + } +} +``` + +For complete endpoint documentation, view the OpenAPI specification in a schema viewer. + +--- + +## File: docs/reference/cli/commands.md + +# Publisher CLI Commands Reference + +Complete command reference for the `mcp-publisher` CLI tool. + +See the [publishing guide](../../guides/publishing/publish-server.md) for a walkthrough of using the CLI to publish a server. + +## Installation + +Install via Homebrew (macOS/Linux): + +```bash +$ brew install mcp-publisher +``` + +## Global Options + +All commands support: +- `--help`, `-h` - Show command help +- `--registry` - Registry URL (default: `https://registry.modelcontextprotocol.io`) + +## Commands + +### `mcp-publisher init` + +Generate a `server.json` template with automatic detection. + +**Usage:** +```bash +mcp-publisher init [options] +``` + +**Behavior:** +- Creates `server.json` in current directory +- Auto-detects package managers (`package.json`, `setup.py`, etc.) +- Pre-fills fields where possible +- Prompts for missing required fields + +**Example output:** +```json +{ + "name": "io.github.username/server-name", + "description": "TODO: Add server description", + "version": "1.0.0", + "packages": [ + { + "registry_type": "npm", + "identifier": "detected-package-name", + "version": "1.0.0" + } + ] +} +``` + +### `mcp-publisher login ` + +Authenticate with the registry. + +**Authentication Methods:** + +#### GitHub Interactive +```bash +mcp-publisher login github [--registry=URL] +``` +- Opens browser for GitHub OAuth flow +- Grants access to `io.github.{username}/*` and `io.github.{org}/*` namespaces + +#### GitHub OIDC (CI/CD) +```bash +mcp-publisher login github-oidc [--registry=URL] +``` +- Uses GitHub Actions OIDC tokens automatically +- Requires `id-token: write` permission in workflow +- No browser interaction needed + +Also see [the guide to publishing from GitHub Actions](../../guides/publishing/github-actions.md). + +#### DNS Verification +```bash +mcp-publisher login dns --domain=example.com --private-key=HEX_KEY [--registry=URL] +``` +- Verifies domain ownership via DNS TXT record +- Grants access to `com.example.*` namespaces +- Requires Ed25519 private key (64-character hex) + +**Setup:** +```bash +# Generate keypair +openssl genpkey -algorithm Ed25519 -out key.pem + +# Get public key for DNS record +openssl pkey -in key.pem -pubout -outform DER | tail -c 32 | base64 + +# Add DNS TXT record: +# example.com. IN TXT "v=MCPv1; k=ed25519; p=PUBLIC_KEY" + +# Extract private key for login +openssl pkey -in key.pem -noout -text | grep -A3 "priv:" | tail -n +2 | tr -d ' :\n' +``` + +#### HTTP Verification +```bash +mcp-publisher login http --domain=example.com --private-key=HEX_KEY [--registry=URL] +``` +- Verifies domain ownership via HTTPS endpoint +- Grants access to `com.example.*` namespaces +- Requires Ed25519 private key (64-character hex) + +**Setup:** +```bash +# Generate keypair (same as DNS) +openssl genpkey -algorithm Ed25519 -out key.pem + +# Host public key at: +# https://example.com/.well-known/mcp-registry-auth +# Content: v=MCPv1; k=ed25519; p=PUBLIC_KEY +``` + +#### Anonymous (Testing) +```bash +mcp-publisher login none [--registry=URL] +``` +- No authentication - for local testing only +- Only works with local registry instances + +### `mcp-publisher publish` + +Publish server to the registry. + +For detailed guidance on the publishing process, see the [publishing guide](../../guides/publishing/publish-server.md). + +**Usage:** +```bash +mcp-publisher publish [PATH] +``` + +**Options:** +- `PATH` - Path to server.json (default: `./server.json`) + +**Process:** +1. Validates `server.json` against schema +2. Publishes the `server.json` to the registry server URL specified in the login token +3. Server: Verifies package ownership (see [Official Registry Requirements](../server-json/official-registry-requirements.md)) +4. Server: Checks namespace authentication +5. Server: Publishes to registry + +**Example:** +```bash +# Basic publish +mcp-publisher publish + +# Custom file location +mcp-publisher publish ./config/server.json +``` + +### `mcp-publisher logout` + +Clear stored authentication credentials. + +**Usage:** +```bash +mcp-publisher logout +``` + +**Behavior:** +- Removes `~/.config/mcp-publisher/token.json` +- Also cleans up legacy token files (`~/.mcp_publisher_token`, `.mcpregistry_*`) +- Does not revoke tokens on server side + +## Configuration + +### Token Storage +Authentication tokens are stored in `~/.config/mcp-publisher/token.json` as JSON: +```json +{ + "token": "jwt-token-here", + "method": "github", + "registry": "https://registry.modelcontextprotocol.io" +} +``` + +> **Note:** Tokens were previously stored in `~/.mcp_publisher_token`. If you are upgrading, run `mcp-publisher logout` followed by `mcp-publisher login` to migrate to the new location. + +--- + +## File: docs/reference/faq.md + +# MCP Registry FAQ + +These questions come up often in discussions about the MCP Registry. If you have a question that isn't answered here, please start a discussion on the [MCP Registry Discussions page](https://github.com/modelcontextprotocol/registry/discussions). + +## General Questions + +### What is the MCP Registry? + +The MCP Registry is the official centralized metadata repository for publicly-accessible MCP servers. It provides: + +- A single place for server creators to publish metadata about their servers +- A REST API for MCP clients and aggregators to discover available servers +- Standardized installation and configuration information +- Namespace management through DNS verification + +### What is the difference between "Official MCP Registry", "MCP Registry", "MCP registry", "MCP Registry API", etc? + +There are four underlying concepts: +- "MCP Server Registry API" (or "MCP Registry API"): The OpenAPI specification defined in [openapi.yaml](./api/openapi.yaml). This is a reusable API specification that anyone building any sort of "MCP server registry" should consider adopting / aligning with. +- "Official MCP Registry" (or "MCP Registry"): The application that lives at `https://registry.modelcontextprotocol.io`. This registry currently only catalogs MCP servers, but may be extended in the future to also catalog MCP client/host apps and frameworks. +- "Official MCP Registry API": The REST API served at `https://registry.modelcontextprotocol.io`, which is a superset of the MCP Registry API. Its OpenAPI specification can be downloaded from [https://registry.modelcontextprotocol.io/openapi.yaml](https://registry.modelcontextprotocol.io/openapi.yaml) +- "MCP server registry" (or "MCP registry"): A third party, likely commercial, implementation of the MCP Server Registry API or derivative specification. + +### Is the MCP Registry a package registry? + +No. The MCP Registry stores metadata about MCP servers and references to where they're hosted (npm, PyPI, NuGet, Docker Hub, etc.), but does not host the actual source code or packages. + +### Who should use the MCP Registry directly? + +The registry is primarily designed for programmatic consumption by subregistries (Smithery, PulseMCP, Docker Hub, Anthropic, GitHub, etc.). It is NOT currently intended for individual clients or end-users (they should use subregistries). + +### Will there be feature X? + +See [roadmap.md](../explanations/roadmap.md). + +## Publishing Servers + +### How do I publish my MCP server? + +See the [publisher README](../../cmd/publisher/README.md) + +### What namespaces are available? + +- **With GitHub verification**: `io.github.yourusername/server-name`, `io.github.yourorg/server-name` +- **With DNS verification**: `com.yourcompany.*`, `com.yourcompany.*/*` +- **With HTTP verification**: `com.yourcompany/*` + +### Is open source required? + +No. While open source code is encouraged, it is not required for either locally or remotely run servers. + +### What package registries are supported? + +- npm (Node.js packages) +- PyPI (Python packages) +- NuGet.org (.NET packages) +- GitHub Container Registry (GHCR) +- Docker Hub + +More can be added as the community desires; feel free to open an issue if you are interested in building support for another registry. + +### Can I publish multiple versions? + +Yes, versioning is supported: + +- Each version gets its own immutable metadata +- Version strings must be unique for each server +- Old versions remain accessible for compatibility +- The registry tracks which version is "latest" based on semantic version ordering when possible + +### How do I update my server metadata? + +Submit a new `server.json` with a unique version string. Once published, version metadata is immutable (similar to npm). + +### What version format should I use? + +The registry accepts any version string up to 255 characters, but we recommend: + +- **SHOULD use semantic versioning** (e.g., "1.0.2", "2.1.0-alpha") for predictable ordering +- **SHOULD align with package versions** to reduce confusion +- **MAY use prerelease labels** (e.g., "1.0.0-1") for registry-specific versions + +The registry attempts to parse versions as semantic versions for proper ordering. Non-semantic versions are allowed but will be ordered by publication timestamp. Version ranges (e.g., `^1.2.3`, `~1.2.3`, `>=1.2.3`, `1.x`, `1.*`) are rejected; publish a specific version instead. See the [versioning guide](../explanations/versioning.md) for detailed guidance. + +### Can I add custom metadata when publishing? + +Yes, extensions under the `x-publisher` property are preserved when publishing to the registry. This allows you to include custom metadata specific to your publishing process. + +### Can I delete/unpublish my server? + +At time of last update, this was open for discussion in [#104](https://github.com/modelcontextprotocol/registry/issues/104). + +### Can I publish a private server? + +Private servers are those that are only accessible to a narrow set of users. For example, servers published on a private network (like `mcp.acme-corp.internal`) or on private package registries (e.g. `npx -y @acme/mcp --registry https://artifactory.acme-corp.internal/npm`). + +These are generally not supported on the official MCP registry, which is designed for publicly accessible MCP servers. + +If you want to publish private servers we recommend you host your own MCP subregistry, and add them there. + +## Security & Trust + +### How do I know a server is from the claimed organization? + +DNS verification ensures namespace ownership. For example: + +- `com.microsoft/server` requires DNS verification of microsoft.com +- `io.github.name/server` is tied to a GitHub account or GitHub organization `name` + +### Is there security scanning? + +The MVP delegates security scanning to: +- underlying package registries; and +- subregistries + +### How is spam prevented? + +- Namespace authentication requirements +- Character limits and regex validation on free-form fields +- Manual takedown of spam or malicious servers + +In future we might explore: +- Stricter rate limiting (e.g., 10 new servers per user per day) +- Potential AI-based spam detection +- Community reporting and admin blacklisting capabilities + +## API & Integration + +### How often should I poll the registry? + +Recommended polling frequency: + +- `/servers` endpoint: once per hour +- `/servers/:id` endpoint: once per version (results are immutable) +- Design assumes CDN caching between registry and consumers + +Also see [#291](https://github.com/modelcontextprotocol/registry/issues/291), which might mean the above can be more regular. + +### Will there be webhooks? + +Not in the initial MVP, but the architecture supports adding webhooks for update notifications in the future. + +### Can I run my own registry instance? + +Yes! The API shapes and data formats are intentionally designed for reuse by subregistries. Organizations needing private registries should: + +- Implement the same API shape +- Use the same `server.json` format +- Potentially mirror/filter the official registry data + +### Can I extend the registry API? + +Yes, we support `x-com.example` style extensions in a bunch of places - see the official MCP registry API spec. This can be used to add annotations to many objects, e.g. add security scanning details, enrich package metadata, etc. + +If you have a use case that can't be addressed here, raise a GitHub issue! + +### Can I use the code here to run my own registry instance? + +The registry implementation here is not designed for self-hosting, but you're welcome to try to use it/fork it as necessary. Note that this is not an intended use, and the registry maintainers cannot provide any support for this at this time. + +## Operations & Maintenance + +### What's the expected reliability? + +- This is a community maintained project without full time staffing. You should therefore expect downtime periods of up to 1 business day. No strict guarantees are provided. (Also see discussion in [#150](https://github.com/modelcontextprotocol/registry/issues/150)) +- Ideally clients should use subregistries with higher availability guarantees, to avoid direct end-user impact (as subregistries can cache data). + +### What if I need to report a spam or malicious server? + +1. Report it as abuse to the underlying package registry (e.g. NPM, PyPi, DockerHub, etc.); and +2. Raise a GitHub issue on the registry repo with a title beginning `Abuse report: ` + +### What if I need to report a security vulnerability in the registry itself? + +Follow [the MCP community SECURITY.md](https://github.com/modelcontextprotocol/.github/blob/main/SECURITY.md). + +--- + +## File: docs/reference/server-json/generic-server-json.md + +# server.json Format Specification + +A `server.json` file is a standardized way to describe MCP servers for registry publishing, client discovery, and package management. + +Also see: +- For step-by-step instructions on creating and using server.json files, see the [publishing guide](../../guides/publishing/publish-server.md). +- For understanding the validation requirements when publishing to the official registry, see [official registry requirements](./official-registry-requirements.md). + +## Browse the Complete Schema + +**๐Ÿ“‹ View the full specification interactively**: Open [server.schema.json](./server.schema.json) in a schema viewer like [json-schema.app](https://json-schema.app/view/%23?url=https%3A%2F%2Fstatic.modelcontextprotocol.io%2Fschemas%2F2025-07-09%2Fserver.schema.json). + +The schema contains all field definitions, validation rules, examples, and detailed descriptions. + +The official registry has some more restrictions on top of this. See the [official registry requirements](./official-registry-requirements.md) for details. + +## Examples + + + +### Basic Server with NPM Package + +```json +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "io.modelcontextprotocol.anonymous/brave-search", + "description": "MCP server for Brave Search API integration", + "status": "active", + "website_url": "https://anonymous.modelcontextprotocol.io/examples", + "repository": { + "url": "https://github.com/modelcontextprotocol/servers", + "source": "github" + }, + "version": "1.0.2", + "packages": [ + { + "registry_type": "npm", + "registry_base_url": "https://registry.npmjs.org", + "identifier": "@modelcontextprotocol/server-brave-search", + "version": "1.0.2", + "transport": { + "type": "stdio" + }, + "environment_variables": [ + { + "name": "BRAVE_API_KEY", + "description": "Brave Search API Key", + "is_required": true, + "is_secret": true + } + ] + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "npm-publisher", + "version": "1.0.1", + "build_info": { + "timestamp": "2023-12-01T10:30:00Z" + } + } + } +} +``` + +### Server in a Monorepo with Subfolder + +For MCP servers located within a subdirectory of a larger repository (monorepo structure), use the `subfolder` field to specify the relative path: + +```json +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "io.modelcontextprotocol/everything", + "description": "MCP server that exercises all the features of the MCP protocol", + "status": "active", + "repository": { + "url": "https://github.com/modelcontextprotocol/servers", + "source": "github", + "subfolder": "src/everything" + }, + "version": "0.6.2", + "packages": [ + { + "registry_type": "npm", + "registry_base_url": "https://registry.npmjs.org", + "identifier": "@modelcontextprotocol/everything", + "version": "0.6.2", + "transport": { + "type": "stdio" + } + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "npm-publisher", + "version": "1.0.1", + "build_info": { + "timestamp": "2023-12-01T10:30:00Z" + } + } + } +} +``` + +### Constant (fixed) arguments needed to start the MCP server + +Suppose your MCP server application requires a `mcp start` CLI arguments to start in MCP server mode. Express these as positional arguments like this: + +```json +{ + "name": "io.github.joelverhagen/knapcode-samplemcpserver", + "description": "Sample NuGet MCP server for a random number and random weather", + "version": "0.4.0-beta", + "packages": [ + { + "registry_type": "nuget", + "registry_base_url": "https://api.nuget.org/v3/index.json", + "identifier": "Knapcode.SampleMcpServer", + "version": "0.4.0-beta", + "transport": { + "type": "stdio" + }, + "package_arguments": [ + { + "type": "positional", + "value": "mcp" + }, + { + "type": "positional", + "value": "start" + } + ] + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "nuget-publisher", + "version": "2.1.0", + "build_info": { + "timestamp": "2023-11-15T14:22:00Z", + "pipeline_id": "nuget-build-456" + } + } + } +} +``` + +This will essentially instruct the MCP client to execute `dnx Knapcode.SampleMcpServer@0.4.0-beta -- mcp start` instead of the default `dnx Knapcode.SampleMcpServer@0.4.0-beta` (when no `package_arguments` are provided). + +### Filesystem Server with Multiple Packages + +```json +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "io.github.modelcontextprotocol/filesystem", + "description": "Node.js server implementing Model Context Protocol (MCP) for filesystem operations.", + "status": "active", + "repository": { + "url": "https://github.com/modelcontextprotocol/servers", + "source": "github", + "id": "b94b5f7e-c7c6-d760-2c78-a5e9b8a5b8c9" + }, + "version": "1.0.2", + "packages": [ + { + "registry_type": "npm", + "registry_base_url": "https://registry.npmjs.org", + "identifier": "@modelcontextprotocol/server-filesystem", + "version": "1.0.2", + "transport": { + "type": "stdio" + }, + "package_arguments": [ + { + "type": "positional", + "value_hint": "target_dir", + "description": "Path to access", + "default": "/Users/username/Desktop", + "is_required": true, + "is_repeated": true + } + ], + "environment_variables": [ + { + "name": "LOG_LEVEL", + "description": "Logging level (debug, info, warn, error)", + "default": "info" + } + ] + }, + { + "registry_type": "oci", + "registry_base_url": "https://docker.io", + "identifier": "mcp/filesystem", + "version": "1.0.2", + "transport": { + "type": "stdio" + }, + "runtime_arguments": [ + { + "type": "named", + "description": "Mount a volume into the container", + "name": "--mount", + "value": "type=bind,src={source_path},dst={target_path}", + "is_required": true, + "is_repeated": true, + "variables": { + "source_path": { + "description": "Source path on host", + "format": "filepath", + "is_required": true + }, + "target_path": { + "description": "Path to mount in the container. It should be rooted in `/project` directory.", + "is_required": true, + "default": "/project" + } + } + } + ], + "package_arguments": [ + { + "type": "positional", + "value_hint": "target_dir", + "value": "/project" + } + ], + "environment_variables": [ + { + "name": "LOG_LEVEL", + "description": "Logging level (debug, info, warn, error)", + "default": "info" + } + ] + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "ci-publisher", + "version": "3.2.1", + "build_info": { + "commit": "a1b2c3d4e5f6789", + "timestamp": "2023-12-01T10:30:00Z", + "pipeline_id": "filesystem-build-789", + "environment": "production" + } + } + } +} +``` + +### Remote Server Example + +```json +{ + "name": "io.modelcontextprotocol.anonymous/mcp-fs", + "description": "Cloud-hosted MCP filesystem server", + "repository": { + "url": "https://github.com/example/remote-fs", + "source": "github", + "id": "xyz789ab-cdef-0123-4567-890ghijklmno" + }, + "version": "2.0.0", + "remotes": [ + { + "type": "sse", + "url": "http://mcp-fs.anonymous.modelcontextprotocol.io/sse" + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "cloud-deployer", + "version": "2.4.0", + "build_info": { + "commit": "f7e8d9c2b1a0", + "timestamp": "2023-12-05T08:45:00Z", + "deployment_id": "remote-fs-deploy-456", + "region": "us-west-2" + } + } + } +} +``` + +### Python Package Example + +```json +{ + "name": "io.github.example/weather-mcp", + "description": "Python MCP server for weather data access", + "repository": { + "url": "https://github.com/example/weather-mcp", + "source": "github", + "id": "def456gh-ijkl-7890-mnop-qrstuvwxyz12" + }, + "version": "0.5.0", + "packages": [ + { + "registry_type": "pypi", + "registry_base_url": "https://pypi.org", + "identifier": "weather-mcp-server", + "version": "0.5.0", + "runtime_hint": "uvx", + "transport": { + "type": "stdio" + }, + "environment_variables": [ + { + "name": "WEATHER_API_KEY", + "description": "API key for weather service", + "is_required": true, + "is_secret": true + }, + { + "name": "WEATHER_UNITS", + "description": "Temperature units (celsius, fahrenheit)", + "default": "celsius" + } + ] + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "poetry-publisher", + "version": "1.8.3", + "build_info": { + "python_version": "3.11.5", + "timestamp": "2023-11-28T16:20:00Z", + "build_id": "pypi-weather-123", + "dependencies_hash": "sha256:a9b8c7d6e5f4" + } + } + } +} +``` + +### NuGet (.NET) Package Example + +The `dnx` tool ships with the .NET 10 SDK, starting with Preview 6. + +```json +{ + "name": "io.github.joelverhagen/knapcode-samplemcpserver", + "description": "Sample NuGet MCP server for a random number and random weather", + "repository": { + "url": "https://github.com/joelverhagen/Knapcode.SampleMcpServer", + "source": "github", + "id": "example-nuget-id-0000-1111-222222222222" + }, + "version": "0.5.0", + "packages": [ + { + "registry_type": "nuget", + "registry_base_url": "https://api.nuget.org/v3/index.json", + "identifier": "Knapcode.SampleMcpServer", + "version": "0.5.0", + "runtime_hint": "dnx", + "transport": { + "type": "stdio" + }, + "environment_variables": [ + { + "name": "WEATHER_CHOICES", + "description": "Comma separated list of weather descriptions to randomly select.", + "is_required": true, + "is_secret": false + } + ] + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "dotnet-publisher", + "version": "8.0.100", + "build_info": { + "dotnet_version": "8.0.0", + "timestamp": "2023-12-10T12:15:00Z", + "configuration": "Release", + "target_framework": "net8.0", + "build_number": "20231210.1" + } + } + } +} +``` + +### Complex Docker Server with Multiple Arguments + +```json +{ + "name": "io.github.example/database-manager", + "description": "MCP server for database operations with support for multiple database types", + "repository": { + "url": "https://github.com/example/database-manager-mcp", + "source": "github", + "id": "ghi789jk-lmno-1234-pqrs-tuvwxyz56789" + }, + "version": "3.1.0", + "packages": [ + { + "registry_type": "oci", + "registry_base_url": "https://docker.io", + "identifier": "example/database-manager-mcp", + "version": "3.1.0", + "transport": { + "type": "stdio" + }, + "runtime_arguments": [ + { + "type": "named", + "name": "--network", + "value": "host", + "description": "Use host network mode" + }, + { + "type": "named", + "name": "-e", + "value": "DB_TYPE={db_type}", + "description": "Database type to connect to", + "is_repeated": true, + "variables": { + "db_type": { + "description": "Type of database", + "choices": [ + "postgres", + "mysql", + "mongodb", + "redis" + ], + "is_required": true + } + } + } + ], + "package_arguments": [ + { + "type": "named", + "name": "--host", + "description": "Database host", + "default": "localhost", + "is_required": true + }, + { + "type": "named", + "name": "--port", + "description": "Database port", + "format": "number" + }, + { + "type": "positional", + "value_hint": "database_name", + "description": "Name of the database to connect to", + "is_required": true + } + ], + "environment_variables": [ + { + "name": "DB_USERNAME", + "description": "Database username", + "is_required": true + }, + { + "name": "DB_PASSWORD", + "description": "Database password", + "is_required": true, + "is_secret": true + }, + { + "name": "SSL_MODE", + "description": "SSL connection mode", + "default": "prefer", + "choices": [ + "disable", + "prefer", + "require" + ] + } + ] + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "docker-buildx", + "version": "0.12.1", + "build_info": { + "docker_version": "24.0.7", + "timestamp": "2023-12-08T14:30:00Z", + "platform": "linux/amd64,linux/arm64", + "registry": "docker.io", + "image_digest": "sha256:1a2b3c4d5e6f7890" + } + } + } +} +``` + +### Server with Remote and Package Options + +```json +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "io.modelcontextprotocol.anonymous/hybrid-mcp", + "description": "MCP server available as both local package and remote service", + "repository": { + "url": "https://github.com/example/hybrid-mcp", + "source": "github", + "id": "klm012no-pqrs-3456-tuvw-xyz789abcdef" + }, + "version": "1.5.0", + "packages": [ + { + "registry_type": "npm", + "registry_base_url": "https://registry.npmjs.org", + "identifier": "@example/hybrid-mcp-server", + "version": "1.5.0", + "runtime_hint": "npx", + "transport": { + "type": "stdio" + }, + "package_arguments": [ + { + "type": "named", + "name": "--mode", + "description": "Operation mode", + "default": "local", + "choices": [ + "local", + "cached", + "proxy" + ] + } + ] + } + ], + "remotes": [ + { + "type": "sse", + "url": "https://mcp.anonymous.modelcontextprotocol.io/sse", + "headers": [ + { + "name": "X-API-Key", + "description": "API key for authentication", + "is_required": true, + "is_secret": true + }, + { + "name": "X-Region", + "description": "Service region", + "default": "us-east-1", + "choices": [ + "us-east-1", + "eu-west-1", + "ap-southeast-1" + ] + } + ] + }, + { + "type": "streamable-http", + "url": "https://mcp.anonymous.modelcontextprotocol.io/http" + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "hybrid-deployer", + "version": "1.7.2", + "build_info": { + "timestamp": "2023-12-03T11:00:00Z", + "deployment_strategy": "blue-green", + "npm_version": "10.2.4", + "node_version": "20.10.0", + "service_endpoints": { + "sse": "deployed", + "streamable": "deployed" + } + } + } + } +} +``` + +### MCP Bundle (MCPB) Package Example + +```json +{ + "name": "io.modelcontextprotocol/text-editor", + "description": "MCP Bundle server for advanced text editing capabilities", + "repository": { + "url": "https://github.com/modelcontextprotocol/text-editor-mcpb", + "source": "github" + }, + "version": "1.0.2", + "packages": [ + { + "registry_type": "mcpb", + "registry_base_url": "https://github.com", + "identifier": "https://github.com/modelcontextprotocol/text-editor-mcpb/releases/download/v1.0.2/text-editor.mcpb", + "version": "1.0.2", + "file_sha256": "fe333e598595000ae021bd27117db32ec69af6987f507ba7a63c90638ff633ce", + "transport": { + "type": "stdio" + } + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "mcpb-publisher", + "version": "1.0.0", + "build_info": { + "timestamp": "2023-12-02T09:15:00Z", + "bundle_format": "mcpb-v1" + } + } + } +} +``` + +This example shows an MCPB (MCP Bundle) package that: +- Is hosted on GitHub Releases (an allowlisted provider) +- Includes a SHA-256 hash for integrity verification +- Can be downloaded and executed directly by MCP clients that support MCPB + +### Embedded MCP inside a CLI tool + +Some CLI tools bundle an MCP server, without a standalone MCP package or a public repository. In these cases, reuse the existing `packages` shape by pointing at the host CLI package and supplying the `package_arguments` and `runtime_hint` if needed to start the MCP server. + +```json +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "io.snyk/cli-mcp", + "description": "MCP server provided by the Snyk CLI", + "status": "active", + "version": "1.1298.0", + "packages": [ + { + "registry_type": "npm", + "registry_base_url": "https://registry.npmjs.org", + "identifier": "snyk", + "version": "1.1298.0", + "transport": { + "type": "stdio" + }, + "package_arguments": [ + { "type": "positional", "value": "mcp" }, + { + "type": "named", + "name": "-t", + "description": "Transport type for MCP server", + "default": "stdio", + "choices": ["stdio", "sse"] + } + ] + } + ] +} +``` + +### Server with Custom Installation Path + +For MCP servers that follow a custom installation path or are embedded in applications without standalone packages, use the `website_url` field to direct users to setup documentation: + +```json +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json", + "name": "io.modelcontextprotocol.anonymous/embedded-mcp", + "description": "MCP server embedded in a Desktop app", + "status": "active", + "website_url": "https://anonymous.modelcontextprotocol.io/embedded-mcp-guide", + "version": "0.1.0" +} +``` + +### Deprecated Server Example + +```json +{ + "name": "io.github.example/old-weather", + "description": "Legacy weather server - DEPRECATED: Use weather-v2 instead for new projects", + "status": "deprecated", + "repository": { + "url": "https://github.com/example/old-weather", + "source": "github", + "id": "legacy-abc123-def456-789012-345678-901234567890" + }, + "version": "0.9.5", + "packages": [ + { + "registry_type": "npm", + "registry_base_url": "https://registry.npmjs.org", + "identifier": "@legacy/old-weather-server", + "version": "0.9.5", + "transport": { + "type": "stdio" + }, + "environment_variables": [ + { + "name": "WEATHER_API_KEY", + "description": "Weather API key", + "is_required": true, + "is_secret": true + } + ] + } + ], + "_meta": { + "io.modelcontextprotocol.registry/publisher-provided": { + "tool": "legacy-publisher", + "version": "0.8.1", + "build_info": { + "timestamp": "2023-06-15T09:30:00Z", + "deprecation_notice": "This publisher is deprecated. Use npm-publisher v2.0+ for new projects.", + "maintenance_mode": true, + "final_version": true + } + } + } +} +``` \ No newline at end of file diff --git a/deploy/Pulumi.gcpProd.yaml b/deploy/Pulumi.gcpProd.yaml index 6645551..d4eaaee 100644 --- a/deploy/Pulumi.gcpProd.yaml +++ b/deploy/Pulumi.gcpProd.yaml @@ -1,7 +1,7 @@ config: mcp-registry:environment: prod mcp-registry:provider: gcp - mcp-registry:imageTag: 1.8.1 # Set specific image tag for production (change this to deploy different versions) + mcp-registry:imageTag: 1.8.0 # Set specific image tag for production (change this to deploy different versions) gcp:project: mcp-registry-prod mcp-registry:githubClientId: Iv23liUydBbI7Z2Q9bOZ mcp-registry:githubClientSecret: diff --git a/deploy/README.md b/deploy/README.md index 7b407e7..392b244 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -147,20 +147,15 @@ Pre-requisites: ## Configuration -Configuration keys are namespaced. Set them with `pulumi config set [--secret]`. - | Parameter | Description | Required | |-----------|-------------|----------| -| `mcp-registry:environment` | Deployment environment (local/staging/prod) | Yes | -| `mcp-registry:provider` | Kubernetes provider (local/gcp) | No (default: local) | -| `mcp-registry:githubClientId` | GitHub OAuth Client ID | Yes | -| `mcp-registry:githubClientSecret` | GitHub OAuth Client Secret | Yes (secret) | -| `mcp-registry:jwtPrivateKey` | Ed25519 seed used to sign registry JWTs | Yes (secret) | -| `mcp-registry:googleOauthClientSecret` | Google OAuth client secret for Grafana login | Yes (secret) | -| `mcp-registry:imageTag` | Docker image tag for production environment | Yes (prod only) | -| `gcp:project` | GCP Project ID | Yes when `provider=gcp` | -| `gcp:region` | GCP Region | No (default: us-central1) | -| `gcp:credentials` | GCP service account credentials JSON | No (secret; set in staging/prod) | +| `environment` | Deployment environment (local/staging/prod) | Yes | +| `provider` | Kubernetes provider (local/gcp) | No (default: local) | +| `githubClientId` | GitHub OAuth Client ID | Yes | +| `githubClientSecret` | GitHub OAuth Client Secret | Yes | +| `imageTag` | Docker image tag for production environment | Yes (prod only) | +| `gcpProjectId` | GCP Project ID (required when provider=gcp) | No | +| `gcpRegion` | GCP Region (default: us-central1) | No | ## Database Backups diff --git a/deploy/go.mod b/deploy/go.mod index 031069c..b2365a5 100644 --- a/deploy/go.mod +++ b/deploy/go.mod @@ -1,11 +1,11 @@ module github.com/modelcontextprotocol/registry/deploy/infra -go 1.26.6 +go 1.26 require ( github.com/pulumi/pulumi-gcp/sdk/v8 v8.41.1 - github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.34.0 - github.com/pulumi/pulumi/sdk/v3 v3.261.0 + github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.33.0 + github.com/pulumi/pulumi/sdk/v3 v3.255.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -23,29 +23,25 @@ require ( github.com/charmbracelet/bubbletea v1.3.10 // indirect github.com/charmbracelet/colorprofile v0.4.3 // indirect github.com/charmbracelet/lipgloss v1.1.0 // indirect - github.com/charmbracelet/x/ansi v0.11.8 // indirect + github.com/charmbracelet/x/ansi v0.11.7 // indirect github.com/charmbracelet/x/cellbuf v0.0.15 // indirect github.com/charmbracelet/x/term v0.2.2 // indirect + github.com/cheggaaa/pb v1.0.29 // indirect github.com/clipperhouse/displaywidth v0.11.0 // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect github.com/cloudflare/circl v1.6.3 // indirect - github.com/danieljoos/wincred v1.2.3 // indirect - github.com/deckarep/golang-set/v2 v2.5.0 // indirect github.com/djherbis/times v1.5.0 // indirect - github.com/ebitengine/purego v0.10.2 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/go-git/gcfg/v2 v2.0.2 // indirect - github.com/go-git/go-billy/v6 v6.0.0-alpha.2 // indirect - github.com/go-git/go-git/v6 v6.0.0-alpha.5 // indirect - github.com/go-logr/logr v1.4.4 // indirect + github.com/go-git/go-billy/v6 v6.0.0-alpha.1 // indirect + github.com/go-git/go-git/v6 v6.0.0-alpha.4 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/godbus/dbus/v5 v5.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.2.5 // indirect - github.com/google/go-tpm v0.9.8 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect @@ -54,12 +50,12 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/kevinburke/ssh_config v1.6.0 // indirect - github.com/klauspost/compress v1.18.7 // indirect + github.com/klauspost/compress v1.18.0 // indirect github.com/klauspost/cpuid/v2 v2.3.0 // indirect - github.com/lucasb-eyer/go-colorful v1.4.1 // indirect - github.com/mattn/go-isatty v0.0.24 // indirect + github.com/lucasb-eyer/go-colorful v1.4.0 // indirect + github.com/mattn/go-isatty v0.0.22 // indirect github.com/mattn/go-localereader v0.0.1 // indirect - github.com/mattn/go-runewidth v0.0.28 // indirect + github.com/mattn/go-runewidth v0.0.24 // indirect github.com/mitchellh/go-ps v1.0.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -85,37 +81,36 @@ require ( github.com/texttheater/golang-levenshtein v1.0.1 // indirect github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect github.com/uber/jaeger-lib v2.4.1+incompatible // indirect - github.com/xo/terminfo v1.0.0 // indirect - github.com/zalando/go-keyring v0.2.8 // indirect + github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/zclconf/go-cty v1.16.3 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/collector/featuregate v1.65.0 // indirect - go.opentelemetry.io/collector/pdata v1.65.0 // indirect - go.opentelemetry.io/contrib/bridges/otelslog v0.20.0 // indirect - go.opentelemetry.io/otel v1.45.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.21.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0 // indirect - go.opentelemetry.io/otel/log v0.21.0 // indirect - go.opentelemetry.io/otel/metric v1.45.0 // indirect - go.opentelemetry.io/otel/sdk v1.45.0 // indirect - go.opentelemetry.io/otel/sdk/log v0.21.0 // indirect - go.opentelemetry.io/otel/trace v1.45.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.opentelemetry.io/collector/featuregate v1.59.0 // indirect + go.opentelemetry.io/collector/pdata v1.59.0 // indirect + go.opentelemetry.io/contrib/bridges/otelslog v0.18.0 // indirect + go.opentelemetry.io/otel v1.44.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.19.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 // indirect + go.opentelemetry.io/otel/log v0.19.0 // indirect + go.opentelemetry.io/otel/metric v1.44.0 // indirect + go.opentelemetry.io/otel/sdk v1.44.0 // indirect + go.opentelemetry.io/otel/sdk/log v0.19.0 // indirect + go.opentelemetry.io/otel/trace v1.44.0 // indirect + go.opentelemetry.io/proto/otlp v1.10.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.55.0 // indirect - golang.org/x/mod v0.38.0 // indirect - golang.org/x/net v0.58.0 // indirect - golang.org/x/sync v0.22.0 // indirect - golang.org/x/sys v0.47.0 // indirect - golang.org/x/term v0.45.0 // indirect - golang.org/x/text v0.41.0 // indirect - golang.org/x/tools v0.48.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect + golang.org/x/crypto v0.52.0 // indirect + golang.org/x/mod v0.35.0 // indirect + golang.org/x/net v0.55.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/sys v0.45.0 // indirect + golang.org/x/term v0.43.0 // indirect + golang.org/x/text v0.37.0 // indirect + golang.org/x/tools v0.44.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect + google.golang.org/grpc v1.82.1 // indirect + google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/frand v1.5.1 // indirect ) diff --git a/deploy/go.sum b/deploy/go.sum index 14ce36c..f55881a 100644 --- a/deploy/go.sum +++ b/deploy/go.sum @@ -30,12 +30,14 @@ github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q= github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30= -github.com/charmbracelet/x/ansi v0.11.8 h1:JMFwp0CgDC2+jcOB162HH5k7I3FVbgFSMMYg7dSPBQQ= -github.com/charmbracelet/x/ansi v0.11.8/go.mod h1:ZNN+3mXny/516oTQPLMPIBeSINvNJJQ8uQXDgbeJxY0= +github.com/charmbracelet/x/ansi v0.11.7 h1:kzv1kJvjg2S3r9KHo8hDdHFQLEqn4RBCb39dAYC84jI= +github.com/charmbracelet/x/ansi v0.11.7/go.mod h1:9qGpnAVYz+8ACONkZBUWPtL7lulP9No6p1epAihUZwQ= github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI= github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI= +github.com/cheggaaa/pb v1.0.29 h1:FckUN5ngEk2LpvuG0fw1GEFx6LtyY2pWI/Z2QgCnEYo= +github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuPxX30= github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8= github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= @@ -43,39 +45,34 @@ github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJ github.com/cloudflare/circl v1.6.3 h1:9GPOhQGF9MCYUeXyMYlqTR6a5gTrgR/fBLXvUgtVcg8= github.com/cloudflare/circl v1.6.3/go.mod h1:2eXP6Qfat4O/Yhh8BznvKnJ+uzEoTQ6jVKJRn81BiS4= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= -github.com/danieljoos/wincred v1.2.3 h1:v7dZC2x32Ut3nEfRH+vhoZGvN72+dQ/snVXo/vMFLdQ= -github.com/danieljoos/wincred v1.2.3/go.mod h1:6qqX0WNrS4RzPZ1tnroDzq9kY3fu1KwE7MRLQK4X0bs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.5.0 h1:hn6cEZtQ0h3J8kFrHR/NrzyOoTnjgW1+FmNJzQ7y/sA= -github.com/deckarep/golang-set/v2 v2.5.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/djherbis/times v1.5.0 h1:79myA211VwPhFTqUk8xehWrsEO+zcIZj0zT8mXPVARU= github.com/djherbis/times v1.5.0/go.mod h1:5q7FDLvbNg1L/KaBmPcWlVR9NmoKo3+ucqUA3ijQhA0= -github.com/ebitengine/purego v0.10.2 h1:W809HbnvzAxgdm+aOvlSekrM16wGCdT/e76+9tS7gzE= -github.com/ebitengine/purego v0.10.2/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c= github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU= github.com/go-git/gcfg/v2 v2.0.2 h1:MY5SIIfTGGEMhdA7d7JePuVVxtKL7Hp+ApGDJAJ7dpo= github.com/go-git/gcfg/v2 v2.0.2/go.mod h1:/lv2NsxvhepuMrldsFilrgct6pxzpGdSRC13ydTLSLs= -github.com/go-git/go-billy/v6 v6.0.0-alpha.2 h1:1Sv5WemXL8CxKrAx1gioJ+uHNb2bZJhiQLfwSZ4Et8c= -github.com/go-git/go-billy/v6 v6.0.0-alpha.2/go.mod h1:r/bsv9i/iDyyEU8/Z6mjC+YraOVwie1ddfUqBCElKXQ= +github.com/go-git/go-billy/v6 v6.0.0-alpha.1 h1:xVjAR4oUvrKy7/Xuw/lLlV3gkxR3KO2H8W+MamuVVsQ= +github.com/go-git/go-billy/v6 v6.0.0-alpha.1/go.mod h1:eaCUpHbedW7//EwcYmUDfJe2N6sJC9O12AT0OTqJR1E= github.com/go-git/go-git-fixtures/v6 v6.0.0-alpha.1 h1:gmqi2jvsreu0s8JMLylYDFq4sbjHwwlhktMw0DUg3mA= github.com/go-git/go-git-fixtures/v6 v6.0.0-alpha.1/go.mod h1:ECf1MqJlBdYpKggBrOXjo/0EnvRZx6D++I86UYjPgAQ= -github.com/go-git/go-git/v6 v6.0.0-alpha.5 h1:sE+OlkHgYWNMVmN1s9sR7uyFgsWLtxcNWse/vBYKxRE= -github.com/go-git/go-git/v6 v6.0.0-alpha.5/go.mod h1:3IjhiZnM+uBmUrOGSeqrJpsmi4Vd0H2NZO/uK2a7d0s= +github.com/go-git/go-git/v6 v6.0.0-alpha.4 h1:aDTc2UGanmaE7FkGLSlBEB9nohMnQ+RKXcfq/D+esDQ= +github.com/go-git/go-git/v6 v6.0.0-alpha.4/go.mod h1:4ODa/G7hPWrh4Y+7lmt59Ij3zW38IEfvRoAZxLYYBhc= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= -github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ= -github.com/godbus/dbus/v5 v5.2.2/go.mod h1:3AAv2+hPq5rdnr5txxxRwiGjPXamgoIHgz9FPBfOp3c= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -85,15 +82,11 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo= -github.com/google/go-tpm v0.9.8/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY= -github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba h1:qJEJcuLzH5KDR0gKc0zcktin6KSAwL7+jWKBYceddTc= -github.com/google/go-tpm-tools v0.3.13-0.20230620182252-4639ecce2aba/go.mod h1:EFYHy8/1y2KfgTAsx7Luu7NGhoxtuVHnNo8jE7FikKc= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 h1:MJG/KsmcqMwFAkh8mTnAwhyKoB+sTAnY4CACC110tbU= github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -114,8 +107,8 @@ github.com/kevinburke/ssh_config v1.6.0/go.mod h1:q2RIzfka+BXARoNexmF9gkxEX7Dmvb github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.18.7 h1:aUyZsS4kH3QTKurYhAOwAHxllVPnOthb3vPfnF1Ehjw= -github.com/klauspost/compress v1.18.7/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/klauspost/cpuid/v2 v2.3.0 h1:S4CRMLnYUhGeDFDqkGriYKdfoFlDnMtqTiI/sFzhA9Y= github.com/klauspost/cpuid/v2 v2.3.0/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -125,14 +118,20 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lucasb-eyer/go-colorful v1.4.1 h1:1EO+WB73+EH8EVbzlrG3KLAfEypQWVHIBqlTf+2hNss= -github.com/lucasb-eyer/go-colorful v1.4.1/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= -github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= +github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW4TvVgFr4= +github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= +github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= -github.com/mattn/go-runewidth v0.0.28 h1:rPyg2ybwEKPebvpzVWe1gKBkH8EQFkxO4Y0hjBeLaBU= -github.com/mattn/go-runewidth v0.0.28/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8= +github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.24 h1:cpokDiIn0MGnhdHwuWnJBITySJ20QyNGnY2kR/ay2DU= +github.com/mattn/go-runewidth v0.0.24/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs= github.com/mitchellh/go-ps v1.0.0 h1:i6ampVEEF4wQFF+bkYfwYgY+F/uYJDktmvLPf7qIgjc= github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= @@ -171,10 +170,10 @@ github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231 h1:vkHw5I/plNdTr435 github.com/pulumi/appdash v0.0.0-20231130102222-75f619a67231/go.mod h1:murToZ2N9hNJzewjHBgfFdXhZKjY3z5cYC1VXk+lbFE= github.com/pulumi/pulumi-gcp/sdk/v8 v8.41.1 h1:w6OnO3d4j5yVf2vpm8OzXFC/xHOEGqt+9FjWCUBCq6U= github.com/pulumi/pulumi-gcp/sdk/v8 v8.41.1/go.mod h1:UyZyv7hz4knpFx6/Sh+SkZe6hT6sJHtDvw9A0TbvEsk= -github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.34.0 h1:r00p17ecoDVWqBg38/Is/9jU/JsWLPxnWzhfYqKitx0= -github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.34.0/go.mod h1:/klrd3ib4AMRlFMjrxkv5r76x3Bdr68wIMEKfRkRzHU= -github.com/pulumi/pulumi/sdk/v3 v3.261.0 h1:1C2V6bxzO9UBe91PRebO/zeiUIQ2C05eRNkVFvJuuqc= -github.com/pulumi/pulumi/sdk/v3 v3.261.0/go.mod h1:xlOo55i2hj5tDyMY8diTS5LfFAn2sFew+50d67sVNdg= +github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.33.0 h1:fFP72Q6/GfyI7BII3hUS7vn45Eg16zKIIS3I3R9bNEY= +github.com/pulumi/pulumi-kubernetes/sdk/v4 v4.33.0/go.mod h1:sIZVlvi6oFQMEgTa+XkYfr/sAXRfrprPo3Ja6UYpGEU= +github.com/pulumi/pulumi/sdk/v3 v3.255.0 h1:G872L4M1EPW3l60yEc52GgLpFRdXAVf0rn96q3MwDVQ= +github.com/pulumi/pulumi/sdk/v3 v3.255.0/go.mod h1:b99ZkmEGjVyW55blOwL94IfPLcaajhOfV8OTePZrRJM= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= @@ -206,54 +205,52 @@ github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaO github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= -github.com/xo/terminfo v1.0.0 h1:2ZpYzqWzyyytjk3TP6aJVDhkMAkc99/1xKQdA3TDTBY= -github.com/xo/terminfo v1.0.0/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= +github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/zalando/go-keyring v0.2.8 h1:6sD/Ucpl7jNq10rM2pgqTs0sZ9V3qMrqfIIy5YPccHs= -github.com/zalando/go-keyring v0.2.8/go.mod h1:tsMo+VpRq5NGyKfxoBVjCuMrG47yj8cmakZDO5QGii0= github.com/zclconf/go-cty v1.16.3 h1:osr++gw2T61A8KVYHoQiFbFd1Lh3JOCXc/jFLJXKTxk= github.com/zclconf/go-cty v1.16.3/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/collector/featuregate v1.65.0 h1:Dh+uYVB+POc5DTebZRWjtKJolGhevkiIpbHn+zhkq2o= -go.opentelemetry.io/collector/featuregate v1.65.0/go.mod h1:4ga1QBMPEejXXmpyJS8lmaRpknJ3Lb9Bvk6e420bUFU= -go.opentelemetry.io/collector/internal/testutil v0.159.0 h1:/OfAv3ZRIc3eVFFq4bFc+Ju5HQBebiWywgvAcysIX4M= -go.opentelemetry.io/collector/internal/testutil v0.159.0/go.mod h1:Jkjs6rkqs973LqgZ0Fe3zrokQRKULYXPIf4HuqStiEE= -go.opentelemetry.io/collector/pdata v1.65.0 h1:6bQ3sIrEzOdapetxYFjdCns90kKXg1qCoIZ3la1aR5E= -go.opentelemetry.io/collector/pdata v1.65.0/go.mod h1:r5vRY0p7nZcEif06twUW09Sf6vaNsyPzij+EpwI/xeI= -go.opentelemetry.io/contrib/bridges/otelslog v0.20.0 h1:oEl2Pw/i4OQwhAuda2pAHFAcOMivA+Xa+iTccBfab/g= -go.opentelemetry.io/contrib/bridges/otelslog v0.20.0/go.mod h1:yMSQaiiq5dpfrSJCYLBcqFeJkFFI67seT4ngvx6jfVo= -go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU= -go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.21.0 h1:WseeVYf5dJZTsyPiyW5L14k5qsSibqXAMTSiFEDiWr0= -go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.21.0/go.mod h1:SiLZnQS6Qk2eCpvr2CH/XMAOa64TWGXxEZJZCpD2Lmc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0 h1:QRefszxJmfPdjXUUm3j6iDzY03mTPXMjqErFqQ67vUg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0/go.mod h1:Tiz03lTBVBrm7eWZBOidzEaYaJa8tjwGUGv6d8mlTyk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0 h1:fG5MCxGz8+2VtrN/WgqSpJFctVz24gpxj8CxkKmc8Ww= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0/go.mod h1:BmAYTn+3ysbRe+IU2msxmf5Rx3g6DHvex+tWI3LdhYI= -go.opentelemetry.io/otel/log v0.21.0 h1:SLsVDGmtyBrdw8/a2Z0bOIxou/+bN4z56GebH7T0LvA= -go.opentelemetry.io/otel/log v0.21.0/go.mod h1:iReetQrZL9Wyg84cCkOoCmqDHS5RCFfyxC7J+r8fn8g= -go.opentelemetry.io/otel/metric v1.45.0 h1:7Eg1uH7CJ5cXv9is6tnBe1FI6rj1nwUdbFypRm3br/M= -go.opentelemetry.io/otel/metric v1.45.0/go.mod h1:HAPbm1nd3p1PmFH7v2dR+6BjXxw+Lq4a2+pndMAm08s= -go.opentelemetry.io/otel/sdk v1.45.0 h1:4VVSMgQ83dUgW2aoX5f6JgLvHwIvzcuLnF9lUdCSpCw= -go.opentelemetry.io/otel/sdk v1.45.0/go.mod h1:Sr40LgXV7DsKMMJMKOhUWOgMWTfAaqvm2kF0g7ilwuA= -go.opentelemetry.io/otel/sdk/log v0.21.0 h1:QsE7XSR0ktQdKmRKGnR+f1ObGF32WG+7MER/P9KgmYc= -go.opentelemetry.io/otel/sdk/log v0.21.0/go.mod h1:m9mApjCoD2/1QuKCAptjv+BrG9WKOvQLVdNx+iBldTo= -go.opentelemetry.io/otel/sdk/log/logtest v0.21.0 h1:X+JBBgKlswCGYsmgL0CnoUUtlE//VB345c84jYAYkdQ= -go.opentelemetry.io/otel/sdk/log/logtest v0.21.0/go.mod h1:HD1575K8e6sIFBBDd5tZB3t9DlMytWXq9FuR+Y4rfjE= -go.opentelemetry.io/otel/sdk/metric v1.45.0 h1:oVFszMfyj1Am6s24Vtc7wBb8BKLcwepJjNEYILuiE3o= -go.opentelemetry.io/otel/sdk/metric v1.45.0/go.mod h1:vUWUxDZvu1WVRj8JA8S0AdhsPrZoDpA2DdZauIh4mDA= -go.opentelemetry.io/otel/trace v1.45.0 h1:l/mP6Uv7oNO7/TblbhpbgMidxhq1uO/rPsikOyVhxag= -go.opentelemetry.io/otel/trace v1.45.0/go.mod h1:qoJJA2xNMnxRrdISU/kLtfUH2wNeQbiv+jhs/CxI8bc= -go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= -go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= -go.opentelemetry.io/proto/slim/otlp v1.11.0 h1:zB37f+f99+y6UIZR4h7UpwbXd5kFNyip35U7GaJ/Jik= -go.opentelemetry.io/proto/slim/otlp v1.11.0/go.mod h1:mI3DeND+VXZuA4keqFPKDJ3BklwveYm1JqBcEWKDEOM= -go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.4.0 h1:mt+DWtks0biKnz0jXMpDbxWN0CHJi6OJDKe4GcREkcs= -go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.4.0/go.mod h1:7UXaX/7uT+kumUHd3LIWyjMlklEp0mPlrE9xmtbG6/8= -go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.4.0 h1:rLHkdB6eHDiRSIoz0cvNuTJsVJBxaL6IyS1e9BSaXLY= -go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.4.0/go.mod h1:BrX0dmOGsMuWNXXbFafTD7Gb6F3yK+2czVQ6+c24Cnk= +go.opentelemetry.io/collector/featuregate v1.59.0 h1:pu70/9eWRjAjzGnr3VmqwY+k6fmU3esLp15AqxfBBz0= +go.opentelemetry.io/collector/featuregate v1.59.0/go.mod h1:4ga1QBMPEejXXmpyJS8lmaRpknJ3Lb9Bvk6e420bUFU= +go.opentelemetry.io/collector/internal/testutil v0.153.0 h1:GJEaPLohao+7wtm08yGf73RGi1rpIHvqzxOb7Xn8sP0= +go.opentelemetry.io/collector/internal/testutil v0.153.0/go.mod h1:Jkjs6rkqs973LqgZ0Fe3zrokQRKULYXPIf4HuqStiEE= +go.opentelemetry.io/collector/pdata v1.59.0 h1:lO1IcaO9+HUVdFh+RATCUG3oTP+uCZzsE7HJ0MjmzRc= +go.opentelemetry.io/collector/pdata v1.59.0/go.mod h1:AH6M14C6qhesnUpcvigkvFMiX9KtdSWQENMBNyNhe7I= +go.opentelemetry.io/contrib/bridges/otelslog v0.18.0 h1:hhPGP3zvvy1xWT9RTy970wlniSxFttBIsAK1gvMguJM= +go.opentelemetry.io/contrib/bridges/otelslog v0.18.0/go.mod h1:twJF7inoMza6kxMcF8JOdL3mPmtOZu7GEr34CUNE6Dg= +go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= +go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.19.0 h1:Dn8rkudDzY6KV9dr/D/bTUuWgqDf9xe0rr4G2elrn0Y= +go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.19.0/go.mod h1:gMk9F0xDgyN9M/3Ed5Y1wKcx/9mlU91NXY2SNq7RQuU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0 h1:4YsVu3B8+3qtWYYrsUYgn0OG78pN0rnNPRGX4SbokQI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.44.0/go.mod h1:+wnlSn0mD1ADVMe3v9Z/WIaiz6q6gL2J/ejaAmdmv80= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0 h1:qazEJlUOQzhCpzQpFETGby7EdqjI1wsd0W+6Gg1SCTU= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.44.0/go.mod h1:fOD2Yefuxixkx3ahVNf0O/PERb6r4OlbxfATVnYvzCo= +go.opentelemetry.io/otel/log v0.19.0 h1:KUZs/GOsw79TBBMfDWsXS+KZ4g2Ckzksd1ymzsIEbo4= +go.opentelemetry.io/otel/log v0.19.0/go.mod h1:5DQYeGmxVIr4n0/BcJvF4upsraHjg6vudJJpnkL6Ipk= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/log v0.19.0 h1:scYVLqT22D2gqXItnWiocLUKGH9yvkkeql5dBDiXyko= +go.opentelemetry.io/otel/sdk/log v0.19.0/go.mod h1:vFBowwXGLlW9AvpuF7bMgnNI95LiW10szrOdvzBHlAg= +go.opentelemetry.io/otel/sdk/log/logtest v0.19.0 h1:BEbF7ZBB6qQloV/Ub1+3NQoOUnVtcGkU3XX4Ws3GQfk= +go.opentelemetry.io/otel/sdk/log/logtest v0.19.0/go.mod h1:Lua81/3yM0wOmoHTokLj9y9ADeA02v1naRrVrkAZuKk= +go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= +go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= +go.opentelemetry.io/proto/otlp v1.10.0 h1:IQRWgT5srOCYfiWnpqUYz9CVmbO8bFmKcwYxpuCSL2g= +go.opentelemetry.io/proto/otlp v1.10.0/go.mod h1:/CV4QoCR/S9yaPj8utp3lvQPoqMtxXdzn7ozvvozVqk= +go.opentelemetry.io/proto/slim/otlp v1.10.0 h1:iR97Vs/ZDR+y9TfuP9b1XBtdPWeC+OMslIBmhcLU7jM= +go.opentelemetry.io/proto/slim/otlp v1.10.0/go.mod h1:lV9250stpjYLPNA5viFabIgP2QlUGRT1GdTgAf8SIUk= +go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.3.0 h1:RUF5rO0hAlgiJt1fzQVzcVs3vZVNHIcMLgOgG4rWNcQ= +go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.3.0/go.mod h1:I89cynRj8y+383o7tEQVg2SVA6SRgDVIouWPUVXjx0U= +go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.3.0 h1:CQvJSldHRUN6Z8jsUeYv8J0lXRvygALXIzsmAeCcZE0= +go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.3.0/go.mod h1:xSQ+mEfJe/GjK1LXEyVOoSI1N9JV9ZI923X5kup43W4= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -264,64 +261,66 @@ go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= -golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= +golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988= +golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc= golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM= golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk= -golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= -golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= +golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= +golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= -golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= -golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= -golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= +golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= +golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= +golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= -golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE= -golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= -google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 h1:cYNAzI2sUwhmCcoj9TxvihSrqsxt6uIkj3rDRhSDmW4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= -google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= -google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= -google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= -google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa h1:Kjn0N0tCrDgiAFW+lGO4JZ3ck44CehvJQMAwj9QF0G8= +google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:q4lMZS6kskjT5HvCPrnnypcDPVJqT/f4nfxmkE7gryY= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE= +google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/docker-compose.yml b/docker-compose.yml index 3fff7bc..7eb71c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,6 +10,7 @@ services: # See .env.example for more documentation environment: - MCP_REGISTRY_DATABASE_URL=${MCP_REGISTRY_DATABASE_URL:-postgres://mcpregistry:mcpregistry@postgres:5432/mcp-registry} + - MCP_REGISTRY_ENVIRONMENT=${MCP_REGISTRY_ENVIRONMENT:-test} - MCP_REGISTRY_GITHUB_CLIENT_ID=${MCP_REGISTRY_GITHUB_CLIENT_ID:-Iv23licy3GSiM9Km5jtd} - MCP_REGISTRY_GITHUB_CLIENT_SECRET=${MCP_REGISTRY_GITHUB_CLIENT_SECRET:-0e8db54879b02c29adef51795586f3c510a9341d} - MCP_REGISTRY_JWT_PRIVATE_KEY=${MCP_REGISTRY_JWT_PRIVATE_KEY:-8103179d8ef955f6d3de6d6217224a909ec4060529dfeb1d4ca5a994537658cd} diff --git a/docs/README.md b/docs/README.md index d276482..cb06d3e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -17,4 +17,3 @@ The MCP registry provides MCP clients with a list of MCP servers, like an app st - ๐Ÿ“– [Reference](./reference/) - Technical specifications - ๐Ÿ”ง [Contributing guides](./contributing/) - How to contribute - ๐Ÿ”’ [Administration](./administration/) - Admin operations -- ๐Ÿค [Community projects](./community-projects.md) - Notable registry-related work from the community diff --git a/docs/administration/admin-operations.md b/docs/administration/admin-operations.md index f3131bf..6b3a04d 100644 --- a/docs/administration/admin-operations.md +++ b/docs/administration/admin-operations.md @@ -1,6 +1,6 @@ # Admin Operations -This is a brief guide for admins and moderators managing content on the registry. All actions should be taken in line with the [moderation policy](../modelcontextprotocol-io/moderation-policy.mdx). +This is a brief guide for admins and moderators managing content on the registry. All actions should be taken in line with the [moderation guidelines](moderation-guidelines.md). ## Prerequisites @@ -33,8 +33,8 @@ ENCODED_SERVER_NAME=$(echo "$SERVER_NAME" | sed 's|/|%2F|g') # Get specific version curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions/${VERSION}" > server.json -# Or get the latest version (use the special version "latest") -curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions/latest" > server.json +# Or get latest version (omit /versions/VERSION) +curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}" > server.json ``` ### Step 2: Make Changes @@ -44,46 +44,19 @@ Open `server.json` and edit the specific version details. You cannot change the ### Step 3: Update Version ```bash -# Update specific version (requires the full server.json body) +# Update specific version curl -X PUT "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions/${VERSION}" \ -H "Authorization: Bearer ${REGISTRY_TOKEN}" \ -H "Content-Type: application/json" \ -d "$(cat server.json)" -``` -To change **only** the status of a version, use the status endpoint instead โ€” it does not require -the full server configuration: - -```bash -curl -X PATCH "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions/${VERSION}/status" \ - -H "Authorization: Bearer ${REGISTRY_TOKEN}" \ - -H "Content-Type: application/json" \ - -d '{"status": "deprecated", "statusMessage": "Superseded by v2"}' ``` ## Edit an Entire Server (All Versions) -### Status Changes Across All Versions +Use this when you need to apply changes across all versions of a server (e.g., mark entire server as deleted, apply content scrubbing). -A status change applies to every version of a server in a single request. The response reports -how many versions were updated in `updatedCount`. - -```bash -export SERVER_NAME="" # e.g., "com.example/my-server" -ENCODED_SERVER_NAME=$(echo "$SERVER_NAME" | sed 's|/|%2F|g') - -curl -X PATCH "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/status" \ - -H "Authorization: Bearer ${REGISTRY_TOKEN}" \ - -H "Content-Type: application/json" \ - -d '{"status": "deleted", "statusMessage": "Removed per moderation policy"}' -``` - -### Content Changes Across All Versions - -Content edits (e.g. scrubbing sensitive text from descriptions) have no bulk endpoint and must be -applied per version using the edit endpoint, which takes the full server configuration. - -#### Step 1: List All Versions +### Step 1: List All Versions ```bash export SERVER_NAME="" # e.g., "com.example/my-server" @@ -92,32 +65,29 @@ ENCODED_SERVER_NAME=$(echo "$SERVER_NAME" | sed 's|/|%2F|g') curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions" > all_versions.json ``` -#### Step 2: Extract Versions +### Step 2: Extract Versions ```bash # Extract all versions from the server jq -r '.servers[].server.version' all_versions.json > versions.txt ``` -#### Step 3: Apply Changes to Each Version +### Step 3: Apply Changes to All Versions ```bash +# For each version, apply changes using the edit endpoint while read VERSION; do echo "Processing version: $VERSION" - # Download the version, edit it, then send the full body back - curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions/${VERSION}" > version.json - - # Apply your changes to version.json here, then: - curl -X PUT "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions/${VERSION}" \ + # Apply your changes here (e.g., set status to "deleted") + curl -X PUT "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions/${VERSION}?status=deleted" \ -H "Authorization: Bearer ${REGISTRY_TOKEN}" \ - -H "Content-Type: application/json" \ - -d "$(cat version.json)" + -H "Content-Type: application/json" done < versions.txt # Clean up temporary files -rm -f versions.txt all_versions.json version.json +rm versions.txt all_versions.json ``` ## Quick Operations @@ -128,7 +98,7 @@ rm -f versions.txt all_versions.json version.json export SERVER_NAME="" # e.g., "com.example/my-server" ENCODED_SERVER_NAME=$(echo "$SERVER_NAME" | sed 's|/|%2F|g') -curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions/latest" > latest_version.json +curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}" > latest_version.json export VERSION=$(jq -r '.server.version' latest_version.json) echo "Latest version: $VERSION" ``` @@ -143,37 +113,30 @@ export REGISTRY_TOKEN="" REGISTRY_TOKEN="$REGISTRY_TOKEN" SERVER_NAME="$SERVER_NAME" VERSION="$VERSION" ./tools/admin/takedown.sh ``` -### Takedown All Versions of a Server - -`ALL_VERSIONS=true` marks every version as deleted in a single request. The script requires either -`VERSION` or `ALL_VERSIONS` to be set explicitly, so a forgotten `VERSION` cannot take down a whole -server by accident. +### Takedown Latest Version (Entire Server) ```bash export SERVER_NAME="" # e.g., "com.example/my-server" export REGISTRY_TOKEN="" -REGISTRY_TOKEN="$REGISTRY_TOKEN" SERVER_NAME="$SERVER_NAME" ALL_VERSIONS=true ./tools/admin/takedown.sh +# This marks the latest version as deleted +REGISTRY_TOKEN="$REGISTRY_TOKEN" SERVER_NAME="$SERVER_NAME" ./tools/admin/takedown.sh ``` -### Takedown the Latest Version Only +### Takedown All Versions of a Server ```bash export SERVER_NAME="" # e.g., "com.example/my-server" export REGISTRY_TOKEN="" ENCODED_SERVER_NAME=$(echo "$SERVER_NAME" | sed 's|/|%2F|g') -# Resolve the latest version, then take down that specific version -VERSION=$(curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions/latest" | jq -r '.server.version') - -REGISTRY_TOKEN="$REGISTRY_TOKEN" SERVER_NAME="$SERVER_NAME" VERSION="$VERSION" ./tools/admin/takedown.sh -``` - -### Record a Reason with a Takedown - -```bash -REGISTRY_TOKEN="$REGISTRY_TOKEN" SERVER_NAME="$SERVER_NAME" ALL_VERSIONS=true \ - STATUS_MESSAGE="Removed per moderation policy" ./tools/admin/takedown.sh +# Get all versions and takedown each one +curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions" | \ + jq -r '.servers[].server.version' | \ + while read VERSION; do + echo "Taking down version: $VERSION" + REGISTRY_TOKEN="$REGISTRY_TOKEN" SERVER_NAME="$SERVER_NAME" VERSION="$VERSION" ./tools/admin/takedown.sh + done ``` ## Connecting to the Production Database @@ -216,8 +179,6 @@ Any write attempts will fail with an error until you disconnect. ## Notes - **Version-specific changes**: Only affect that particular version -- **Server-wide status changes**: `PATCH /v0/servers/{serverName}/status` updates every version in one request -- **Server-wide content changes**: Have no bulk endpoint and must be applied to each version individually -- **Status vs. edit**: Use `PATCH .../status` to change status alone; the `PUT` edit endpoint requires the full server configuration +- **Server-wide changes**: Must be applied to each version individually - **Content scrubbing**: Use the version-specific edit workflow to scrub sensitive content - **Server name**: Cannot be changed in any version (it's the immutable identifier) diff --git a/docs/administration/maintainer-onboarding.md b/docs/administration/maintainer-onboarding.md index aab0bea..f6e3871 100644 --- a/docs/administration/maintainer-onboarding.md +++ b/docs/administration/maintainer-onboarding.md @@ -16,7 +16,7 @@ When onboarding a new maintainer, complete the following steps: ### 3. README.md -- [ ] Add them to the "Registry Working Group" section in [README.md](../../README.md) +- [ ] Add them to the "Current key maintainers" section in [README.md](../../README.md) ### 4. Discord diff --git a/docs/community-projects.md b/docs/community-projects.md index 2708839..a177ad0 100644 --- a/docs/community-projects.md +++ b/docs/community-projects.md @@ -36,7 +36,6 @@ Self-hostable servers that implement the MCP Registry API specification. - [mcp-registry-cli](https://pypi.org/project/mcp-registry-cli/) - CLI tool to navigate the MCP registry servers - [OtherVibes/mcp-publish-action](https://github.com/OtherVibes/mcp-publish-action) - GitHub Action for publishing MCP servers to the official registry - [polygraph](https://polygraph.so) - Independent behavioral security grades (Aโ€“F) for MCP servers from an open, reproducible harness, published as an adoption-ranked index with per-server reports -- [PulseFeed MCP Drift Watch](https://pulsefeed.dev/mcp/drift) - Daily external diff of the whole registry population, recording what changed in a server *after* it was listed: package ownership transferred, install script added in a later version, repository removed, package unpublished, a removed name republished by someone else. Free JSON/RSS feed filterable to your own packages, a README badge, and webhook alerts; series runs from 2026-07-30 and each day's manifest is timestamped into Bitcoin. ## Adding Your Project diff --git a/docs/contributing/add-package-registry.md b/docs/contributing/add-package-registry.md index f6e07c8..170c2d2 100644 --- a/docs/contributing/add-package-registry.md +++ b/docs/contributing/add-package-registry.md @@ -51,5 +51,6 @@ These steps may evolve as additional validations or details are discovered and m - Add corresponding unit tests: `internal/validators/registries/yourregistry_test.go` - Register your validator in `internal/validators/validators.go` - Update the publishing documentation: - - Add a section for your registry to `docs/modelcontextprotocol-io/package-types.mdx`, following the pattern of the existing registries (npm, PyPI, NuGet, ...) - - Include instructions on how to prepare packages for your registry, and an `### Ownership Verification` subsection describing the validation your registry requires + - Add a new publishing guide: `docs/guides/publishing/publish-[yourregistry].md`, following the pattern of existing publishing guides (e.g., `publish-npm.md`, `publish-pypi.md`) + - Include instructions on how to prepare packages for your registry, including any specific validation requirements + - Update `docs/guides/publishing/README.md` to reference your new publishing guide diff --git a/docs/contributing/releasing.md b/docs/contributing/releasing.md index 56f205b..bbf9345 100644 --- a/docs/contributing/releasing.md +++ b/docs/contributing/releasing.md @@ -5,8 +5,8 @@ 1. **Go to GitHub**: Navigate to https://github.com/modelcontextprotocol/registry/releases 2. **Click "Draft a new release"** 3. **Choose a tag**: Click "Choose a tag" and type a new semantic version that follows the last one available (e.g., `v1.0.0`) -4. **Generate notes**: Click "Generate release notes" to auto-populate the name and description -5. **Publish**: Click "Publish release" +5. **Generate notes**: Click "Generate release notes" to auto-populate the name and description +6. **Publish**: Click "Publish release" The release workflow will automatically: - Build binaries for 6 platforms (Linux, macOS, Windows ร— amd64, arm64) @@ -27,13 +27,13 @@ Releases do not automatically deploy to production. To deploy a release: 1. Update `mcp-registry:imageTag` in `deploy/Pulumi.gcpProd.yaml` to the desired version (e.g., `1.2.3` - note: no 'v' prefix) 2. Commit and push the change to the `main` branch (either through a PR or by pushing directly to main) -3. The [deploy-production.yml](../../.github/workflows/deploy-production.yml) workflow will automatically trigger and deploy the specified version +3. The [deploy-production.yml](../../../.github/workflows/deploy-production.yml) workflow will automatically trigger and deploy the specified version -See the [deployment documentation](../../deploy/README.md) for more details. +See the [deployment documentation](../../../deploy/README.md) for more details. ## Staging -Staging auto-deploys from `main` via [deploy-staging.yml](../../.github/workflows/deploy-staging.yml). It always runs the latest `main` branch code. +Staging auto-deploys from `main` via [deploy-staging.yml](../../../.github/workflows/deploy-staging.yml). It always runs the latest `main` branch code. ## Rollback diff --git a/docs/design/design-principles.md b/docs/design/design-principles.md index 7d805be..d76627a 100644 --- a/docs/design/design-principles.md +++ b/docs/design/design-principles.md @@ -25,13 +25,13 @@ The registry serves as the authoritative metadata repository for publicly-availa - Use mechanisms like DNS verification, OAuth to provide base layer of authentication and trust - Implement rate limiting, field validation, and blacklisting to prevent abuse -## 5. Reusable, Extensible Shapes; Not Infrastructure +## 6. Reusable, Extensible Shapes; Not Infrastructure - API shapes (OpenAPI, server.json) designed for reuse - Enable private/internal registries using same formats - Don't mandate infrastructure reuse - focus on interface compatibility -## 6. Progressive Enhancement +## 7. Progressive Enhancement - Start with MVP that provides immediate value - Build foundation that supports future features diff --git a/docs/design/roadmap.md b/docs/design/roadmap.md index 8a14ca1..93b552b 100644 --- a/docs/design/roadmap.md +++ b/docs/design/roadmap.md @@ -6,15 +6,9 @@ This roadmap may occasionally drift out of date. Please review [Issues](https:// ## Current Status -> [!NOTE] -> **The phase labelling below is out of date as of 2026-08-10.** The registry launched in preview on -> 2025-09-08 and the v0.1 API entered a freeze on 2025-10-24, so "Go-Live" has already happened. The -> phases are retained for historical context. See -> [Issues](https://github.com/modelcontextprotocol/registry/issues) for current work. - The initial version of the MCP Registry is actively being developed. The initial focus is on delivering a REST API to which server creators can publish, and aggregator/marketplace consumers can ETL. -## Phase 1: MVP/Go-Live +## Phase 1: MVP/Go-Live (Current Focus) See the [go-live blocker issues](https://github.com/modelcontextprotocol/registry/issues?q=is%3Aissue%20state%3Aopen%20label%3A%22go-live%20blocker%22). diff --git a/docs/design/tech-architecture.md b/docs/design/tech-architecture.md index f7fab72..03097f7 100644 --- a/docs/design/tech-architecture.md +++ b/docs/design/tech-architecture.md @@ -1,26 +1,5 @@ # MCP Registry Technical Architecture -> [!WARNING] -> **This document has drifted from the shipped system and is kept as a design record.** -> For the architecture as deployed, see [deploy/README.md](../../deploy/README.md); for the API as -> implemented, see the [API reference](../reference/api/official-registry-api.md). -> -> Known inaccuracies below, as of 2026-08-10: -> - The registry is not deployed via a Helm chart. It is a plain Kubernetes `Deployment` created by -> Pulumi; Helm is used only for third-party components (ingress-nginx, cert-manager, -> cloudnative-pg, k8up, monitoring). -> - The database diagram shows a `StatefulSet` on port `27017` (MongoDB). The database is PostgreSQL -> on `5432`, provisioned by the CloudNativePG operator. -> - The DNS verification sequence (`mcp verify-domain`, `POST /verify-domain`, -> `POST /verify-domain/check`, server-issued challenge tokens) describes a design that was never -> built. The shipped flow signs a timestamp with the operator's key and posts it to -> `POST /v0/auth/dns`, with the public key published in a `v=MCPv1; k=...; p=...` TXT record. -> - No `/admin/*` routes exist. Admin actions use the regular server endpoints with an -> admin-permissioned token. -> - The CLI is `mcp-publisher`, not `mcp`, and publishing posts to `/v0/publish`. -> - The database stores servers and server extensions only; it holds no user authentication state -> and no DNS verification records. - This document describes the technical architecture of the MCP Registry, including system components, deployment strategies, and data flows. ## System Overview diff --git a/docs/modelcontextprotocol-io/authentication.mdx b/docs/modelcontextprotocol-io/authentication.mdx index 59d7218..9812fcc 100644 --- a/docs/modelcontextprotocol-io/authentication.mdx +++ b/docs/modelcontextprotocol-io/authentication.mdx @@ -174,7 +174,7 @@ mcp-publisher login dns --domain "${MY_DOMAIN}" --private-key "${PRIVATE_KEY}" MY_DOMAIN="example.com" PRIVATE_KEY="$(openssl ec -in key.pem -noout -text | grep -A4 "priv:" | tail -n +2 | tr -d ' :\n')" -mcp-publisher login dns --algorithm ecdsap384 --domain "${MY_DOMAIN}" --private-key "${PRIVATE_KEY}" +mcp-publisher login dns --domain "${MY_DOMAIN}" --private-key "${PRIVATE_KEY}" ``` ```bash Google KMS @@ -298,7 +298,7 @@ mcp-publisher login http --domain "${MY_DOMAIN}" --private-key "${PRIVATE_KEY}" ```bash ECDSA P-384 MY_DOMAIN="example.com" PRIVATE_KEY="$(openssl ec -in key.pem -noout -text | grep -A4 "priv:" | tail -n +2 | tr -d ' :\n')" -mcp-publisher login http --algorithm ecdsap384 --domain "${MY_DOMAIN}" --private-key "${PRIVATE_KEY}" +mcp-publisher login http --domain "${MY_DOMAIN}" --private-key "${PRIVATE_KEY}" ``` ```bash Google KMS diff --git a/docs/modelcontextprotocol-io/faq.mdx b/docs/modelcontextprotocol-io/faq.mdx index d6c8aab..078ae45 100644 --- a/docs/modelcontextprotocol-io/faq.mdx +++ b/docs/modelcontextprotocol-io/faq.mdx @@ -52,7 +52,7 @@ There is a 4KB size limit (4096 bytes of JSON). Publishing will fail if this lim ### What if I need to report a spam or malicious server? -1. Report it as abuse to the underlying package registry (e.g. NPM, PyPI, DockerHub, etc.); and +1. Report it as abuse to the underlying package registry (e.g. NPM, PyPi, DockerHub, etc.); and 2. Raise a GitHub issue on the registry repo with a title beginning `Abuse report: ` ### What if I need to report a security vulnerability in the registry itself? diff --git a/docs/modelcontextprotocol-io/quickstart.mdx b/docs/modelcontextprotocol-io/quickstart.mdx index 6988689..41bc8fc 100644 --- a/docs/modelcontextprotocol-io/quickstart.mdx +++ b/docs/modelcontextprotocol-io/quickstart.mdx @@ -135,10 +135,6 @@ Commands: login Authenticate with the registry logout Clear saved authentication publish Publish server.json to the registry - status Update the status of a server version - validate Validate server.json without publishing - -Use 'mcp-publisher --help' for more information about a command. ``` ## Step 4: Create `server.json` diff --git a/docs/modelcontextprotocol-io/remote-servers.mdx b/docs/modelcontextprotocol-io/remote-servers.mdx index eecad51..be2bdc5 100644 --- a/docs/modelcontextprotocol-io/remote-servers.mdx +++ b/docs/modelcontextprotocol-io/remote-servers.mdx @@ -29,7 +29,7 @@ A remote server **MUST** be publicly accessible at its specified URL. ## Transport Type -Remote servers should use the Streamable HTTP transport. The SSE transport is [deprecated](/specification/draft/deprecated), so publish an `"sse"` remote only to support existing clients. Remote servers can also support both transports simultaneously at different URLs. +Remote servers can use the Streamable HTTP transport (recommended) or the SSE transport. Remote servers can also support both transports simultaneously at different URLs. Specify the transport by setting the `type` property of the `remotes` entry to either `"streamable-http"` or `"sse"`: diff --git a/docs/reference/README.md b/docs/reference/README.md index 5e5b0b0..ea77b30 100644 --- a/docs/reference/README.md +++ b/docs/reference/README.md @@ -7,17 +7,11 @@ Technical specifications and quick lookups for the MCP Registry. - [Generic Registry API](./api/generic-registry-api.md) - [Registry Authorization](./api/registry-authorization.md) - [Official Registry API](./api/official-registry-api.md) -- [API Extensions](./api/extensions.md) - The `_meta` extension namespaces -- [OpenAPI Specification](./api/openapi.yaml) -- [API Changelog](./api/CHANGELOG.md) ## server.json Reference - [Generic server.json Format](./server-json/generic-server-json.md) - [Official Registry Requirements](./server-json/official-registry-requirements.md) -- [Schema Changelog](./server-json/CHANGELOG.md) -- [Schema Change Process](./server-json/CONTRIBUTING.md) - How to propose a schema change -- [Draft Schema](./server-json/draft/) - The in-progress next schema version ## CLI Reference diff --git a/docs/reference/api/generic-registry-api.md b/docs/reference/api/generic-registry-api.md index a4476bd..f351021 100644 --- a/docs/reference/api/generic-registry-api.md +++ b/docs/reference/api/generic-registry-api.md @@ -18,7 +18,7 @@ The official registry has some more endpoints and restrictions on top of this. S - **`GET /v0.1/servers/{serverName}/versions`** - List all versions of a server - **`GET /v0.1/servers/{serverName}/versions/{version}`** - Get specific version of server. Use the special version `latest` to get the latest version. - **`POST /v0.1/publish`** - Publish new server (optional, registry-specific authentication) -- **`PUT /v0.1/servers/{serverName}/versions/{version}`** - Update specific server version (optional; the official registry implements this as an admin endpoint) +- **`PUT /v0.1/servers/{serverName}/versions/{version}`** - Update specific server version (optional, not implemented by official registry) - **`DELETE /v0.1/servers/{serverName}/versions/{version}`** - Delete specific server version (optional, not implemented by official registry) - **`PATCH /v0.1/servers/{serverName}/versions/{version}/status`** - Update server version status (optional) - **`PATCH /v0.1/servers/{serverName}/status`** - Update status for all versions (optional) diff --git a/docs/reference/api/official-registry-api.md b/docs/reference/api/official-registry-api.md index 47e461d..2012885 100644 --- a/docs/reference/api/official-registry-api.md +++ b/docs/reference/api/official-registry-api.md @@ -109,17 +109,7 @@ The `GET /v0.1/servers/{serverName}/versions` endpoint returns all versions of a **Authentication:** Requires `publish` or `edit` permission for the server namespace. -#### Validation endpoint -- POST `/v0.1/validate` - Validate a `server.json` without publishing it. Used by `mcp-publisher validate`. - -#### Service endpoints -- GET `/v0.1/ping` - Liveness check -- GET `/v0.1/version` - Registry version information - #### Admin endpoints - GET `/metrics` - Prometheus metrics endpoint - GET `/v0.1/health` - Basic health check endpoint - PUT `/v0.1/servers/{serverName}/versions/{version}` - Edit specific server version - -Note that `/v0.1/validate`, `/v0.1/ping`, `/v0.1/version` and `/v0.1/health` are not described in -[openapi.yaml](./openapi.yaml), which covers the server and publish endpoints only. diff --git a/docs/reference/cli/commands.md b/docs/reference/cli/commands.md index 690a7f4..e077019 100644 --- a/docs/reference/cli/commands.md +++ b/docs/reference/cli/commands.md @@ -16,10 +16,7 @@ $ brew install mcp-publisher All commands support: - `--help`, `-h` - Show command help - -`--registry` is a flag on `login` only (default: `https://registry.modelcontextprotocol.io`). The -other commands read the registry URL from the stored login token, so passing `--registry` to -`publish` would be interpreted as the `server.json` path. +- `--registry` - Registry URL (default: `https://registry.modelcontextprotocol.io`) ## Commands @@ -29,14 +26,14 @@ Generate a `server.json` template with automatic detection. **Usage:** ```bash -mcp-publisher init +mcp-publisher init [options] ``` **Behavior:** - Creates `server.json` in current directory - Auto-detects package managers (`package.json`, `setup.py`, etc.) - Pre-fills fields where possible -- Writes `TODO:` placeholders for fields it cannot detect โ€” it is non-interactive and takes no flags +- Prompts for missing required fields **Example output:** ```json @@ -62,17 +59,10 @@ Authenticate with the registry. #### GitHub Interactive ```bash -mcp-publisher login github [--token=PAT] [--registry=URL] +mcp-publisher login github [--registry=URL] ``` - Opens browser for GitHub OAuth flow - Grants access to `io.github.{username}/*` and `io.github.{org}/*` namespaces -- `--token` supplies a GitHub Personal Access Token instead of the interactive flow, which is how - [publishing from GitHub Actions](../../modelcontextprotocol-io/github-actions.mdx) authenticates - without a browser. This flag is accepted by `login github` only. - -Interactive login handles retryable OAuth errors in both HTTP 200 and HTTP 400 responses. -Access denial, expired codes, and unrecognized OAuth errors still stop polling; an -`incorrect_device_code` error receives at most two additional attempts per login. #### GitHub OIDC (CI/CD) ```bash @@ -93,13 +83,12 @@ Also see [the guide to publishing from GitHub Actions](../../modelcontextprotoco #### DNS Verification ```bash -mcp-publisher login dns --domain=example.com --private-key=HEX_KEY [--algorithm=ed25519|ecdsap384] [--registry=URL] +mcp-publisher login dns --domain=example.com --private-key=HEX_KEY [--registry=URL] ``` - Verifies domain ownership via DNS TXT record - Grants access to `com.example.*` namespaces - Requires Ed25519 private key (64-character hex) or ECDSA P-384 private key (96-character hex) - - `--algorithm` defaults to `ed25519`. **For an ECDSA P-384 key you must pass `--algorithm ecdsap384`**, otherwise the key is rejected with `invalid seed length: expected 32 bytes, got 48`. - - The private key can be stored in a cloud signing provider like Google KMS or Azure Key Vault. Cloud providers derive the algorithm from the key itself, so `--algorithm` does not apply to them. + - The private key can be stored in a cloud signing provider like Google KMS or Azure Key Vault. **Setup:** (for Ed25519, recommended) ```bash @@ -129,9 +118,6 @@ openssl ec -in key.pem -text -noout -conv_form compressed | grep -A4 "pub:" | ta # Extract private key for login openssl ec -in -noout -text | grep -A4 "priv:" | tail -n +2 | tr -d ' :\n' - -# Log in, selecting the ECDSA P-384 algorithm explicitly -mcp-publisher login dns --algorithm ecdsap384 --domain=example.com --private-key=HEX_KEY ``` **Setup:** (for Google KMS signing) @@ -192,13 +178,12 @@ mcp-publisher login dns azure-key-vault --domain=example.com --vault MyKeyVault #### HTTP Verification ```bash -mcp-publisher login http --domain=example.com --private-key=HEX_KEY [--algorithm=ed25519|ecdsap384] [--registry=URL] +mcp-publisher login http --domain=example.com --private-key=HEX_KEY [--registry=URL] ``` - Verifies domain ownership via HTTPS endpoint - Grants access to `com.example.*` namespaces - Requires Ed25519 private key (64-character hex) or ECDSA P-384 private key (96-character hex) - - `--algorithm` defaults to `ed25519`. **For an ECDSA P-384 key you must pass `--algorithm ecdsap384`**. - - The private key can be stored in a cloud signing provider like Google KMS or Azure Key Vault. Cloud providers derive the algorithm from the key itself, so `--algorithm` does not apply to them. + - The private key can be stored in a cloud signing provider like Google KMS or Azure Key Vault. **Setup:** (for Ed25519, recommended) ```bash @@ -218,9 +203,6 @@ openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:secp384r1 -out key.pem # Host public key at: # https://example.com/.well-known/mcp-registry-auth # Content: v=MCPv1; k=ecdsap384; p=PUBLIC_KEY - -# Log in, selecting the ECDSA P-384 algorithm explicitly -mcp-publisher login http --algorithm ecdsap384 --domain=example.com --private-key=HEX_KEY ``` Cloud signing is also supported for HTTP authentication, similar to the DNS examples above. Just swap out the `dns` positional argument for `http`. diff --git a/docs/reference/server-json/official-registry-requirements.md b/docs/reference/server-json/official-registry-requirements.md index ac87d85..886aee0 100644 --- a/docs/reference/server-json/official-registry-requirements.md +++ b/docs/reference/server-json/official-registry-requirements.md @@ -23,7 +23,7 @@ See the [publishing guide](../../modelcontextprotocol-io/quickstart.mdx) for aut All packages must include metadata proving the publisher owns them. This prevents impersonation and ensures authenticity (see more reasoning in [#96](https://github.com/modelcontextprotocol/registry/issues/96)). -For detailed verification requirements for each registry type, see [package types](../../modelcontextprotocol-io/package-types.mdx), which has an "Ownership Verification" section per registry. +For detailed verification requirements for each registry type, see the [publishing guide](../../modelcontextprotocol-io/quickstart.mdx). ## Restricted Registry Base URLs diff --git a/go.mod b/go.mod index b482a15..ce6ad8a 100644 --- a/go.mod +++ b/go.mod @@ -1,28 +1,28 @@ module github.com/modelcontextprotocol/registry -go 1.26.0 +go 1.26 require ( cloud.google.com/go/kms v1.33.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0 github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.5.0 github.com/caarlos0/env/v11 v11.4.1 - github.com/coreos/go-oidc/v3 v3.21.0 + github.com/coreos/go-oidc/v3 v3.20.0 github.com/danielgtaylor/huma/v2 v2.39.1 github.com/golang-jwt/jwt/v5 v5.3.1 - github.com/google/go-containerregistry v0.22.1 + github.com/google/go-containerregistry v0.21.8 github.com/jackc/pgx/v5 v5.10.0 github.com/prometheus/client_golang v1.24.1 github.com/rs/cors v1.11.1 github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 - github.com/stretchr/testify v1.12.1 - go.opentelemetry.io/contrib/instrumentation/runtime v0.71.0 - go.opentelemetry.io/otel v1.46.0 - go.opentelemetry.io/otel/exporters/prometheus v0.68.0 - go.opentelemetry.io/otel/metric v1.46.0 - go.opentelemetry.io/otel/sdk v1.46.0 - go.opentelemetry.io/otel/sdk/metric v1.46.0 - golang.org/x/mod v0.41.0 + github.com/stretchr/testify v1.11.1 + go.opentelemetry.io/contrib/instrumentation/runtime v0.69.0 + go.opentelemetry.io/otel v1.44.0 + go.opentelemetry.io/otel/exporters/prometheus v0.66.0 + go.opentelemetry.io/otel/metric v1.44.0 + go.opentelemetry.io/otel/sdk v1.44.0 + go.opentelemetry.io/otel/sdk/metric v1.44.0 + golang.org/x/mod v0.38.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -33,17 +33,18 @@ require ( cloud.google.com/go/compute/metadata v0.9.0 // indirect cloud.google.com/go/iam v1.11.0 // indirect cloud.google.com/go/longrunning v1.2.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.1 // indirect + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.8.0 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/docker/cli v29.7.2+incompatible // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/docker/cli v29.6.2+incompatible // indirect github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/go-jose/go-jose/v4 v4.1.4 // indirect - github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/s2a-go v0.1.9 // indirect github.com/google/uuid v1.6.0 // indirect @@ -52,13 +53,13 @@ require ( github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect github.com/jackc/puddle/v2 v2.2.2 // indirect - github.com/klauspost/compress v1.19.2 // indirect - github.com/kr/text v0.2.0 // indirect + github.com/klauspost/compress v1.19.1 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect + github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_model v0.6.2 // indirect github.com/prometheus/common v0.70.1 // indirect github.com/prometheus/otlptranslator v1.0.0 // indirect @@ -67,20 +68,19 @@ require ( go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 // indirect - go.opentelemetry.io/otel/trace v1.46.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/crypto v0.55.0 // indirect - golang.org/x/net v0.58.0 // indirect + go.opentelemetry.io/otel/trace v1.44.0 // indirect + golang.org/x/crypto v0.54.0 // indirect + golang.org/x/net v0.57.0 // indirect golang.org/x/oauth2 v0.36.0 // indirect golang.org/x/sync v0.22.0 // indirect golang.org/x/sys v0.47.0 // indirect - golang.org/x/text v0.41.0 // indirect + golang.org/x/text v0.40.0 // indirect golang.org/x/time v0.15.0 // indirect google.golang.org/api v0.287.1 // indirect google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7 // indirect - google.golang.org/grpc v1.83.1 // indirect - google.golang.org/protobuf v1.36.12 // indirect + google.golang.org/grpc v1.82.1 // indirect + google.golang.org/protobuf v1.36.11 // indirect gotest.tools/v3 v3.5.2 // indirect ) diff --git a/go.sum b/go.sum index 2a677e7..3c731e5 100644 --- a/go.sum +++ b/go.sum @@ -12,10 +12,10 @@ cloud.google.com/go/kms v1.33.0 h1:pG0X78m212b2pv9N4fdMoUO69LuZGQ9kSvn8sHBOFAo= cloud.google.com/go/kms v1.33.0/go.mod h1:CSGvW6GnMQbY+1nOHcIzhMtHSbExXlOmCKjWtYVjcpA= cloud.google.com/go/longrunning v1.2.0 h1:WjYH3YHBGCxGJP9M4dWGHBfXr/cFIjMkNgWcJj7/iMM= cloud.google.com/go/longrunning v1.2.0/go.mod h1:5KMQALFGOCtFoi2xSOA1u3H7WKlhmckgiyFw7+LGQp0= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.1 h1:zvXfGJCWvywnCA814d8ZiVyt+fm9nnTE8xSb99zRyfo= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.1/go.mod h1:iptorS+VYKFL2N6PnebpS91dubG35eAOEERnT4PJbQU= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1 h1:u93s+zU2JD62im61Bm5CZIc1ZrOJaIAWEg0WOrMVkEo= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1/go.mod h1:oXtinPO4OLj9d1DOTrqrL1oRwGhcqadvAmrl6wTeGlk= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0 h1:aokoqcHvaGjiM3VpjKDfMMnF/8epJ+Q1HLJ7CudztqE= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.22.0/go.mod h1:/WYEx9pcM9Y+Dd/APJaNlSvVSvzl54rrMdZT5+Oi2LM= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0 h1:CU4+EJeJi3TKYWEcYuSdWsjzw0nVsK/H0MSQOiPcymU= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.0/go.mod h1:q0+UTSRvShwUCrR/s5HtyInYphN7Wvxb7snFM3u+SLA= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.4.0 h1:xFaZZ+IubdftrDHnGGwZ6QvQ3KHTtWl2MCK+GMt2vxs= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.4.0/go.mod h1:mCBhUhlMjLLJKr5aqw2TNS/VqJOie8MzWq3DAMJeKso= github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 h1:fhqpLE3UEXi9lPaBRpQ6XuRW0nU7hgg4zlmZZa+a9q4= @@ -26,8 +26,8 @@ github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0 h1:nCYfg github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.2.0/go.mod h1:ucUjca2JtSZboY8IoUqyQyuuXvwbMBVwFOm0vdQPNhA= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.8.0 h1:Nljr4q1GRA/5vCrMONS+g4u4LRHNgOXVSh3O43J2CnI= -github.com/AzureAD/microsoft-authentication-library-for-go v1.8.0/go.mod h1:Y33QHnf0FfdVewFFISOGe20mkZbxX4H839o955/PoeI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2 h1:RHK7bS+HQMslb1sZpAokUt+zTVmue0hKSs2C791hhzU= +github.com/AzureAD/microsoft-authentication-library-for-go v1.7.2/go.mod h1:HKpQxkWaGLJ+D/5H8QRpyQXA1eKjxkFlOMwck5+33Jk= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/caarlos0/env/v11 v11.4.1 h1:fYwH0sWEsBSMPG7t4e/PEfTFzrWrpjyygXyUnWiSwEw= @@ -36,14 +36,15 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 h1:aBangftG7EVZoUb69Os8IaYg++6uMOdKK83QtkkvJik= github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2/go.mod h1:qwXFYgsP6T7XnJtbKlf1HP8AjxZZyzxMmc+Lq5GjlU4= -github.com/coreos/go-oidc/v3 v3.21.0 h1:wZo4Q9Pum8dYEj0eMUPrqR+kvuGkeUplbLpNCkBqoWM= -github.com/coreos/go-oidc/v3 v3.21.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/coreos/go-oidc/v3 v3.20.0 h1:EtE0WIBHk03N+DqGkY4+UONzzZHk7amKt6IyNd7OsZE= +github.com/coreos/go-oidc/v3 v3.20.0/go.mod h1:DYCf24+ncYi+XkIH97GY1+dqoRlbaSI26KVTCI9SrY4= github.com/danielgtaylor/huma/v2 v2.39.1 h1:0kwF4ltQoYZ+IU55VPy+BcGekzgF44R64daTGde1H+g= github.com/danielgtaylor/huma/v2 v2.39.1/go.mod h1:zcnQ38duIJ3VUHwFaBoZ6x8T+KN/mr33oyqxcj0HTug= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/cli v29.7.2+incompatible h1:dlkwallR8XqfeVnA2ELEhdwvb4lsSwuB4IgsG8Q9cLY= -github.com/docker/cli v29.7.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/docker/cli v29.6.2+incompatible h1:/bjePvcbbFTnRrMfWJBY7AjfICdsiLVgHn6LwTVOcqw= +github.com/docker/cli v29.6.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/envoyproxy/go-control-plane v0.14.0 h1:hbG2kr4RuFj222B6+7T83thSPqLjwBIfQawTkC++2HA= @@ -60,8 +61,8 @@ github.com/go-chi/chi/v5 v5.3.1/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutV github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= -github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= @@ -70,8 +71,8 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-containerregistry v0.22.1 h1:RZuuSYhTvlDvtsK+NkutoCZ//C0X2ebLK8X8l3ULs84= -github.com/google/go-containerregistry v0.22.1/go.mod h1:bJR35SK8XgisYmhg/FMQ/5RK0S/XrOAqLBV5/LR2XE0= +github.com/google/go-containerregistry v0.21.8 h1:Ig/zIsnztdCUNaiNNczE+MoP5xcyUMfvpvfOr1xyMLE= +github.com/google/go-containerregistry v0.21.8/go.mod h1:dP5XNKcL7kMFF/TB3LfvWmVhAcv7iqkHb3oDK8aauTo= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -90,8 +91,8 @@ github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU= github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k= -github.com/klauspost/compress v1.19.2 h1:hMRETovs/pu/dVWN7zIT1PGG8t509MwT6bO7XSi26R8= -github.com/klauspost/compress v1.19.2/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/klauspost/compress v1.19.1 h1:VsB4HPswih7mmZ8WleSFQ75c/Ui1M4trX5oAsJnhSlk= +github.com/klauspost/compress v1.19.1/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -109,6 +110,8 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjL github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v1.24.1 h1:JnJkREXzWxUdCuPFpIWZiPispT9xVV59uiuyR2bPlnU= github.com/prometheus/client_golang v1.24.1/go.mod h1:F+oSRECHg4sse5ucfYpYDeIv/hu68Zo0uoHKetWnzcE= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= @@ -130,8 +133,8 @@ github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC4 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= -github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= @@ -140,34 +143,32 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.6 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.67.0/go.mod h1:NoUCKYWK+3ecatC4HjkRktREheMeEtrXoQxrqYFeHSc= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0 h1:OyrsyzuttWTSur2qN/Lm0m2a8yqyIjUVBZcxFPuXq2o= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.67.0/go.mod h1:C2NGBr+kAB4bk3xtMXfZ94gqFDtg/GkI7e9zqGh5Beg= -go.opentelemetry.io/contrib/instrumentation/runtime v0.71.0 h1:v4KkRLVvE1cWqTJDfZZkTCG+Z4aolsa6RVos0FX7vqE= -go.opentelemetry.io/contrib/instrumentation/runtime v0.71.0/go.mod h1:g/xbuPC0XbgwMdKuyF5sKOUUEsorSkN6APydyFP/H9E= -go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= -go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= -go.opentelemetry.io/otel/exporters/prometheus v0.68.0 h1:QOf2IftqQwITVRJpnn0M7M9ZCbgWfxz4P7i9C9yc2N4= -go.opentelemetry.io/otel/exporters/prometheus v0.68.0/go.mod h1:bgSvqu2TWGXiz7yr5UTMfObH8oqxJWHTnubQ3ef9BO4= -go.opentelemetry.io/otel/metric v1.46.0 h1:yBnkXvgV7AXFILZc5K6IZe/CBFF3OS7BJ8ov6/lj0K8= -go.opentelemetry.io/otel/metric v1.46.0/go.mod h1:iPmdWqifKUdzziPkvvzIJXITl56fQx2mGM/DHLB3/2o= -go.opentelemetry.io/otel/metric/x v0.68.0 h1:TA/cBT23D3MnxYPwHL7YFOdYGdx0A0v+s7Mzotpd1dU= -go.opentelemetry.io/otel/metric/x v0.68.0/go.mod h1:agudOmvWhwUTjgibWDzxD2PoWYnpw5Ht5jISYOD2Hd4= -go.opentelemetry.io/otel/sdk v1.46.0 h1:h5CNQQjEbuQXY/JfZtgt3i7HVFV3aHPO2OAwO2eTYPI= -go.opentelemetry.io/otel/sdk v1.46.0/go.mod h1:GAERFXFt5SYCEB+YiKUbMBeza6UaDH7GmGOZEfh2gSM= -go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE= -go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= -go.opentelemetry.io/otel/trace v1.46.0 h1:OULy7ccdJnZtJ0UDYFOIGaCmiWzJ8Vi2G/Rsu60qs1c= -go.opentelemetry.io/otel/trace v1.46.0/go.mod h1:J7GAXweO77XSFkB/rmAqk9D6ihszhFjLU+d9WuUxDLI= +go.opentelemetry.io/contrib/instrumentation/runtime v0.69.0 h1:MtkMsuRo3zEXTTMALfyrszwCDZTkB6wolyPjbwFAdq0= +go.opentelemetry.io/contrib/instrumentation/runtime v0.69.0/go.mod h1:FYTxnpsm+UPD0erZNq20GvnM8T2YQHiHtT2vokdpoac= +go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= +go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= +go.opentelemetry.io/otel/exporters/prometheus v0.66.0 h1:vkrK8PAznv2NKt2r+kdu252ccGzkEqLc2aSXbQIALYQ= +go.opentelemetry.io/otel/exporters/prometheus v0.66.0/go.mod h1:V/UB6D3vMF/UBOL5igAsAYnk1nG/bzYYTzvsB16cy7o= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/metric/x v0.66.0 h1:YkCrx1zLOChi9ZcZ6euupOcsgzbVlec7D/xoEU1+cTA= +go.opentelemetry.io/otel/metric/x v0.66.0/go.mod h1:d1+BDj9t96do0/1LoU1ayfCv79ZgNE41qbhBvnMOBZk= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= +go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.yaml.in/yaml/v2 v2.4.4 h1:tuyd0P+2Ont/d6e2rl3be67goVK4R6deVxCUX5vyPaQ= go.yaml.in/yaml/v2 v2.4.4/go.mod h1:gMZqIpDtDqOfM0uNfy0SkpRhvUryYH0Z6wdMYcacYXQ= -go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= -go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= -golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= -golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= -golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= -golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= -golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= -golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= +golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw= +golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= +golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk= +golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40= +golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= +golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= @@ -175,8 +176,8 @@ golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= -golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= +golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= +golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= @@ -189,10 +190,10 @@ google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7 h1: google.golang.org/genproto/googleapis/api v0.0.0-20260630182238-925bb5da69e7/go.mod h1:KqHwBx2upmfa1XSi1WuRvC+2VGCLtooKkfmyvRbUmqA= google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7 h1:eM/YSd5bBFagF51o1E745Ta7RwzpW0h+z+QDNZOgmQ8= google.golang.org/genproto/googleapis/rpc v0.0.0-20260630182238-925bb5da69e7/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= -google.golang.org/grpc v1.83.1 h1:HIO0+BEtBP6soyqvqC8sNUjZ7bTs+0hFQuFF+RAy++Y= -google.golang.org/grpc v1.83.1/go.mod h1:kDyl6SKsiHKt0uylY5gtn5cEjkrIOhQOGDgIc4JGwzQ= -google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= -google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= +google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE= +google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/internal/api/handlers/v0/auth/common.go b/internal/api/handlers/v0/auth/common.go index f1665e4..4c79bfc 100644 --- a/internal/api/handlers/v0/auth/common.go +++ b/internal/api/handlers/v0/auth/common.go @@ -372,7 +372,7 @@ func ParsePublicKey(algorithm, publicKey string) (*PublicKeyInfo, error) { } return &PublicKeyInfo{ Algorithm: AlgorithmECDSAP384, - Key: ecdsa.PublicKey{Curve: curve, X: x, Y: y}, //nolint:staticcheck // SA1019: needs crypto/ecdh refactor + Key: ecdsa.PublicKey{Curve: curve, X: x, Y: y}, }, nil } diff --git a/internal/api/handlers/v0/auth/dns.go b/internal/api/handlers/v0/auth/dns.go index 73508c9..cc18082 100644 --- a/internal/api/handlers/v0/auth/dns.go +++ b/internal/api/handlers/v0/auth/dns.go @@ -62,7 +62,7 @@ func RegisterDNSEndpoint(api huma.API, pathPrefix string, cfg *config.Config) { Path: pathPrefix + "/auth/dns", Summary: "Exchange DNS signature for Registry JWT", Description: "Authenticate using DNS TXT record public key and signed timestamp", - Tags: []string{tagAuth}, + Tags: []string{"auth"}, }, func(ctx context.Context, input *DNSTokenExchangeInput) (*v0.Response[auth.TokenResponse], error) { response, err := handler.ExchangeToken(ctx, input.Body.Domain, input.Body.Timestamp, input.Body.SignedTimestamp) if err != nil { diff --git a/internal/api/handlers/v0/auth/github_at.go b/internal/api/handlers/v0/auth/github_at.go index e11d4f0..868ea8e 100644 --- a/internal/api/handlers/v0/auth/github_at.go +++ b/internal/api/handlers/v0/auth/github_at.go @@ -54,7 +54,7 @@ func RegisterGitHubATEndpoint(api huma.API, pathPrefix string, cfg *config.Confi Path: pathPrefix + "/auth/github-at", Summary: "Exchange GitHub OAuth access token for Registry JWT", Description: "Exchange a GitHub OAuth access token for a short-lived Registry JWT token", - Tags: []string{tagAuth}, + Tags: []string{"auth"}, }, func(ctx context.Context, input *GitHubTokenExchangeInput) (*v0.Response[auth.TokenResponse], error) { response, err := handler.ExchangeToken(ctx, input.Body.GitHubToken) if err != nil { diff --git a/internal/api/handlers/v0/auth/github_oidc.go b/internal/api/handlers/v0/auth/github_oidc.go index de95c67..5ce38ac 100644 --- a/internal/api/handlers/v0/auth/github_oidc.go +++ b/internal/api/handlers/v0/auth/github_oidc.go @@ -235,7 +235,7 @@ func RegisterGitHubOIDCEndpoint(api huma.API, pathPrefix string, cfg *config.Con Path: pathPrefix + "/auth/github-oidc", Summary: "Exchange GitHub OIDC token for Registry JWT", Description: "Exchange a GitHub Actions OIDC token for a short-lived Registry JWT token", - Tags: []string{tagAuth}, + Tags: []string{"auth"}, }, func(ctx context.Context, input *GitHubOIDCTokenExchangeInput) (*v0.Response[auth.TokenResponse], error) { response, err := handler.ExchangeToken(ctx, input.Body.OIDCToken) if err != nil { diff --git a/internal/api/handlers/v0/auth/http.go b/internal/api/handlers/v0/auth/http.go index 5392762..8f438b7 100644 --- a/internal/api/handlers/v0/auth/http.go +++ b/internal/api/handlers/v0/auth/http.go @@ -242,7 +242,7 @@ func RegisterHTTPEndpoint(api huma.API, pathPrefix string, cfg *config.Config) { Path: pathPrefix + "/auth/http", Summary: "Exchange HTTP signature for Registry JWT", Description: "Authenticate using HTTP-hosted public key and signed timestamp", - Tags: []string{tagAuth}, + Tags: []string{"auth"}, }, func(ctx context.Context, input *HTTPTokenExchangeInput) (*v0.Response[auth.TokenResponse], error) { response, err := handler.ExchangeToken(ctx, input.Body.Domain, input.Body.Timestamp, input.Body.SignedTimestamp) if err != nil { diff --git a/internal/api/handlers/v0/auth/main.go b/internal/api/handlers/v0/auth/main.go index 62d9883..26a566b 100644 --- a/internal/api/handlers/v0/auth/main.go +++ b/internal/api/handlers/v0/auth/main.go @@ -5,9 +5,6 @@ import ( "github.com/modelcontextprotocol/registry/internal/config" ) -// tagAuth is the OpenAPI tag grouping all token exchange operations. -const tagAuth = "auth" - // RegisterAuthEndpoints registers all authentication endpoints with a custom path prefix func RegisterAuthEndpoints(api huma.API, pathPrefix string, cfg *config.Config) { // Register GitHub access token authentication endpoint diff --git a/internal/api/handlers/v0/auth/none.go b/internal/api/handlers/v0/auth/none.go index 2549208..9f373c1 100644 --- a/internal/api/handlers/v0/auth/none.go +++ b/internal/api/handlers/v0/auth/none.go @@ -43,7 +43,7 @@ func RegisterNoneEndpoint(api huma.API, pathPrefix string, cfg *config.Config) { Path: pathPrefix + "/auth/none", Summary: "Get anonymous Registry JWT (Development/Testing Only)", Description: "Get a short-lived Registry JWT token for publishing and editing servers in the io.modelcontextprotocol.anonymous/* namespace. This endpoint is intended for local development and automated testing only.", - Tags: []string{tagAuth}, + Tags: []string{"auth"}, }, func(ctx context.Context, _ *struct{}) (*v0.Response[auth.TokenResponse], error) { response, err := handler.GetAnonymousToken(ctx) if err != nil { diff --git a/internal/api/handlers/v0/auth/oidc.go b/internal/api/handlers/v0/auth/oidc.go index 1b63daf..98526e1 100644 --- a/internal/api/handlers/v0/auth/oidc.go +++ b/internal/api/handlers/v0/auth/oidc.go @@ -159,7 +159,7 @@ func RegisterOIDCEndpoints(api huma.API, pathPrefix string, cfg *config.Config) Path: pathPrefix + "/auth/oidc", Summary: "Exchange OIDC ID token for Registry JWT", Description: "Exchange an OIDC ID token from any configured provider for a short-lived Registry JWT token", - Tags: []string{tagAuth}, + Tags: []string{"auth"}, }, func(ctx context.Context, input *OIDCTokenExchangeInput) (*v0.Response[auth.TokenResponse], error) { response, err := handler.ExchangeToken(ctx, input.Body.OIDCToken) if err != nil { diff --git a/internal/api/handlers/v0/edit.go b/internal/api/handlers/v0/edit.go index e552bbe..a927e7b 100644 --- a/internal/api/handlers/v0/edit.go +++ b/internal/api/handlers/v0/edit.go @@ -37,9 +37,9 @@ func RegisterEditEndpoints(api huma.API, pathPrefix string, registry service.Reg Path: pathPrefix + "/servers/{serverName}/versions/{version}", Summary: "Edit MCP server", Description: "Update the configuration of a specific version of an existing MCP server. Requires edit permission for the server. Use PATCH /servers/{serverName}/versions/{version}/status to update status metadata.", - Tags: []string{tagServers}, + Tags: []string{"servers"}, Security: []map[string][]string{ - {securitySchemeBearer: {}}, + {"bearer": {}}, }, }, func(ctx context.Context, input *EditServerInput) (*Response[apiv0.ServerResponse], error) { // Extract bearer token diff --git a/internal/api/handlers/v0/openapi.go b/internal/api/handlers/v0/openapi.go deleted file mode 100644 index 2dee9fd..0000000 --- a/internal/api/handlers/v0/openapi.go +++ /dev/null @@ -1,12 +0,0 @@ -package v0 - -// Shared OpenAPI operation metadata, kept in one place so the generated spec -// groups operations consistently. -const ( - // tagServers groups the server CRUD and status operations. - tagServers = "servers" - - // securitySchemeBearer is the name of the Registry JWT bearer security - // scheme declared in the OpenAPI spec. - securitySchemeBearer = "bearer" -) diff --git a/internal/api/handlers/v0/publish.go b/internal/api/handlers/v0/publish.go index bc01591..5bd371e 100644 --- a/internal/api/handlers/v0/publish.go +++ b/internal/api/handlers/v0/publish.go @@ -32,7 +32,7 @@ func RegisterPublishEndpoint(api huma.API, pathPrefix string, registry service.R Description: "Publish a new MCP server to the registry or update an existing one", Tags: []string{"publish"}, Security: []map[string][]string{ - {securitySchemeBearer: {}}, + {"bearer": {}}, }, }, func(ctx context.Context, input *PublishServerInput) (*Response[apiv0.ServerResponse], error) { // Extract bearer token diff --git a/internal/api/handlers/v0/publish_test.go b/internal/api/handlers/v0/publish_test.go index 6b5c68c..94502be 100644 --- a/internal/api/handlers/v0/publish_test.go +++ b/internal/api/handlers/v0/publish_test.go @@ -168,7 +168,7 @@ func TestPublishEndpoint(t *testing.T) { expectedError: "You do not have permission to publish this server", }, { - name: "duplicate version includes submitted server identity", + name: "registry service error", requestBody: apiv0.ServerJSON{ Schema: model.CurrentSchemaURL, Name: "example/test-server", @@ -202,7 +202,7 @@ func TestPublishEndpoint(t *testing.T) { _, _ = registry.CreateServer(context.Background(), &existingServer) }, expectedStatus: http.StatusBadRequest, - expectedError: "invalid version: cannot publish duplicate version: example/test-server@1.0.0 already exists", + expectedError: "invalid version: cannot publish duplicate version", }, { name: "package validation success - MCPB package", diff --git a/internal/api/handlers/v0/servers.go b/internal/api/handlers/v0/servers.go index 7b14452..059095d 100644 --- a/internal/api/handlers/v0/servers.go +++ b/internal/api/handlers/v0/servers.go @@ -90,7 +90,7 @@ func RegisterServersEndpoints(api huma.API, pathPrefix string, registry service. Path: pathPrefix + "/servers", Summary: "List MCP servers", Description: "Get a paginated list of MCP servers from the registry", - Tags: []string{tagServers}, + Tags: []string{"servers"}, }, func(ctx context.Context, input *ListServersInput) (*Response[apiv0.ServerListResponse], error) { // Build filter from input parameters filter := &database.ServerFilter{} @@ -159,7 +159,7 @@ func RegisterServersEndpoints(api huma.API, pathPrefix string, registry service. Path: pathPrefix + "/servers/{serverName}/versions/{version}", Summary: "Get specific MCP server version", Description: "Get detailed information about a specific version of an MCP server. Use the special version 'latest' to get the latest version.", - Tags: []string{tagServers}, + Tags: []string{"servers"}, }, func(ctx context.Context, input *ServerVersionDetailInput) (*Response[apiv0.ServerResponse], error) { // URL-decode the server name serverName, err := url.PathUnescape(input.ServerName) @@ -201,7 +201,7 @@ func RegisterServersEndpoints(api huma.API, pathPrefix string, registry service. Path: pathPrefix + "/servers/{serverName}/versions", Summary: "Get all versions of an MCP server", Description: "Get all available versions for a specific MCP server", - Tags: []string{tagServers}, + Tags: []string{"servers"}, }, func(ctx context.Context, input *ServerVersionsInput) (*Response[apiv0.ServerListResponse], error) { // URL-decode the server name serverName, err := url.PathUnescape(input.ServerName) diff --git a/internal/api/handlers/v0/status.go b/internal/api/handlers/v0/status.go index f3cca85..3f03fc2 100644 --- a/internal/api/handlers/v0/status.go +++ b/internal/api/handlers/v0/status.go @@ -83,9 +83,9 @@ func RegisterStatusEndpoints(api huma.API, pathPrefix string, registry service.R Path: pathPrefix + "/servers/{serverName}/versions/{version}/status", Summary: "Update MCP server status", Description: "Update the status metadata of a specific version of an MCP server. Requires publish or edit permission for the server. This endpoint allows changing status and status message without requiring the full server configuration.", - Tags: []string{tagServers}, + Tags: []string{"servers"}, Security: []map[string][]string{ - {securitySchemeBearer: {}}, + {"bearer": {}}, }, }, func(ctx context.Context, input *UpdateServerStatusInput) (*Response[apiv0.ServerResponse], error) { // Extract bearer token @@ -198,9 +198,9 @@ func RegisterAllVersionsStatusEndpoints(api huma.API, pathPrefix string, registr Path: pathPrefix + "/servers/{serverName}/status", Summary: "Update status for all versions of an MCP server", Description: "Update the status metadata of all versions of an MCP server in a single transaction. Requires publish or edit permission for the server. Either all versions are updated or none on failure.", - Tags: []string{tagServers}, + Tags: []string{"servers"}, Security: []map[string][]string{ - {securitySchemeBearer: {}}, + {"bearer": {}}, }, }, func(ctx context.Context, input *UpdateAllVersionsStatusInput) (*Response[UpdateAllVersionsStatusResponse], error) { // Extract bearer token diff --git a/internal/api/server.go b/internal/api/server.go index c8ce97c..3cb8a7f 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -5,7 +5,6 @@ import ( "encoding/json" "log" "net/http" - "net/url" "path" "strings" "time" @@ -73,18 +72,11 @@ func TrailingSlashMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Only redirect if the path is not "/" and ends with a "/" if r.URL.Path != "/" && strings.HasSuffix(r.URL.Path, "/") { - // Build the target from the path and query alone, dropping any - // scheme/host the client may have supplied in an absolute-form - // request URI ("GET http://evil.com/foo/ HTTP/1.1"), which would - // otherwise be echoed back as an off-site redirect. - // // path.Clean both removes the trailing slash and collapses any // leading "//" to "/", which prevents an open-redirect via a // protocol-relative path like "//evil.com/" (GHSA-v8vw-gw5j-w7m6). - newURL := url.URL{ - Path: path.Clean(r.URL.Path), - RawQuery: r.URL.RawQuery, - } + newURL := *r.URL + newURL.Path = path.Clean(r.URL.Path) // Use 308 Permanent Redirect to preserve the request method http.Redirect(w, r, newURL.String(), http.StatusPermanentRedirect) diff --git a/internal/importer/importer_test.go b/internal/importer/importer_test.go index ed5ed05..db0cc2a 100644 --- a/internal/importer/importer_test.go +++ b/internal/importer/importer_test.go @@ -20,7 +20,8 @@ import ( ) func TestImportService_LocalFile(t *testing.T) { - tempFile := filepath.Join(t.TempDir(), "test_import_seed.json") + // Create a temporary seed file + tempFile := filepath.Join(os.TempDir(), "test_import_seed.json") seedData := []*apiv0.ServerJSON{ { Schema: model.CurrentSchemaURL, @@ -40,6 +41,7 @@ func TestImportService_LocalFile(t *testing.T) { err = os.WriteFile(tempFile, jsonData, 0600) require.NoError(t, err) + defer os.Remove(tempFile) // Create registry service testDB := database.NewTestDB(t) @@ -185,14 +187,6 @@ func TestImportService_ErrorHandling(t *testing.T) { registryService := service.NewRegistryService(testDB, &config.Config{EnableRegistryValidation: false}) importerService := importer.NewService(registryService) - errorDir := t.TempDir() - missingFile := filepath.Join(errorDir, "non-existent-file.json") - invalidFile := filepath.Join(errorDir, "invalid.json") - - invalidJSON := []byte("{invalid json}") - err := os.WriteFile(invalidFile, invalidJSON, 0600) - require.NoError(t, err) - tests := []struct { name string path string @@ -201,13 +195,13 @@ func TestImportService_ErrorHandling(t *testing.T) { }{ { name: "non-existent local file", - path: missingFile, + path: "/tmp/non-existent-file.json", expectError: true, errorMsg: "failed to read seed data", }, { name: "invalid JSON file", - path: invalidFile, + path: "/tmp/invalid.json", expectError: true, errorMsg: "failed to read seed data", }, @@ -219,6 +213,22 @@ func TestImportService_ErrorHandling(t *testing.T) { }, } + // Create invalid JSON file for testing + invalidJSON := []byte("{invalid json}") + tempFile, err := os.CreateTemp("", "invalid-*.json") + require.NoError(t, err) + defer os.Remove(tempFile.Name()) + err = os.WriteFile(tempFile.Name(), invalidJSON, 0600) + require.NoError(t, err) + + // Update test case to use temp file + for i := range tests { + if tests[i].path == "/tmp/invalid.json" { + tests[i].path = tempFile.Name() + break + } + } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { err := importerService.ImportFromPath(context.Background(), tt.path) diff --git a/internal/service/registry_service.go b/internal/service/registry_service.go index 4bf6e19..16a9100 100644 --- a/internal/service/registry_service.go +++ b/internal/service/registry_service.go @@ -190,7 +190,7 @@ func (s *registryServiceImpl) createServerInTransaction(ctx context.Context, tx return e } if versionExists { - return fmt.Errorf("%w: %s@%s already exists", database.ErrInvalidVersion, serverJSON.Name, serverJSON.Version) + return database.ErrInvalidVersion } currentLatest, e = s.db.GetCurrentLatestVersion(ctx, tx, serverJSON.Name) if e != nil && !errors.Is(e, database.ErrNotFound) { diff --git a/internal/validators/schemas/2025-12-11.json b/internal/validators/schemas/2025-12-11.json index 718aaca..70902ed 100644 --- a/internal/validators/schemas/2025-12-11.json +++ b/internal/validators/schemas/2025-12-11.json @@ -239,7 +239,6 @@ "examples": [ "https://registry.npmjs.org", "https://pypi.org", - "https://crates.io", "https://docker.io", "https://api.nuget.org/v3/index.json", "https://github.com", @@ -253,7 +252,6 @@ "examples": [ "npm", "pypi", - "cargo", "oci", "nuget", "mcpb" diff --git a/internal/validators/utils.go b/internal/validators/utils.go index 2e1aea7..035132d 100644 --- a/internal/validators/utils.go +++ b/internal/validators/utils.go @@ -6,11 +6,6 @@ import ( "strings" ) -const ( - schemeHTTP = "http" - schemeHTTPS = "https" -) - var ( // Regular expressions for validating repository URLs // These regex patterns ensure the URL is in the format of a valid GitHub or GitLab repository @@ -57,8 +52,8 @@ func replaceTemplateVariables(rawURL string) string { "{host}": "example.com", "{port}": "8080", "{path}": "api", - "{protocol}": schemeHTTP, - "{scheme}": schemeHTTP, + "{protocol}": "http", + "{scheme}": "http", } result := rawURL @@ -91,7 +86,7 @@ func IsValidURL(rawURL string) bool { } // Check if scheme is present (http or https) - if u.Scheme != schemeHTTP && u.Scheme != schemeHTTPS { + if u.Scheme != "http" && u.Scheme != "https" { return false } @@ -158,7 +153,7 @@ func IsValidRemoteURL(rawURL string) bool { return false } - if u.Scheme != schemeHTTPS { + if u.Scheme != "https" { return false } diff --git a/scripts/mirror_data/README.md b/scripts/mirror_data/README.md index 2cc3a87..3237211 100644 --- a/scripts/mirror_data/README.md +++ b/scripts/mirror_data/README.md @@ -14,7 +14,7 @@ These scripts help you: ## Prerequisites -- Go โ€” see the [prerequisites in the root README](../../README.md#pre-requisites) for the required version +- Go 1.24.x - PostgreSQL (via Docker or local installation) - Required Go packages: ```bash @@ -31,7 +31,7 @@ go run scripts/mirror_data/fetch_production_data.go ``` This will: -- Fetch all servers from https://registry.modelcontextprotocol.io/v0/servers +- Fetch all servers from https://registry.modelcontextprotocol.io/v0.1/servers - Handle pagination automatically - Save data to `scripts/mirror_data/production_servers.json` - Be respectful to the API with rate limiting @@ -71,7 +71,7 @@ This will: 4. Analyze the data and report statistics 5. Show sample servers with NULL status values -To test a different migration, edit `maxMigration` in `load_production_data.go` +To test a different migration, edit `maxMigration` in the script (line 24) ### 4. Test Migrations @@ -80,8 +80,8 @@ After loading the data, you can test migrations against real production data. #### Testing a Single Migration ```bash -# Test the separate_official_metadata migration -cat internal/database/migrations/009_separate_official_metadata.sql | \ +# Test migration 008 +cat internal/database/migrations/008_separate_official_metadata.sql | \ docker exec -i test-postgres psql -U postgres -d registry_test ``` @@ -90,7 +90,7 @@ cat internal/database/migrations/009_separate_official_metadata.sql | \ 1. **Check the error output:** ```bash # Run migration and capture all output -cat internal/database/migrations/009_separate_official_metadata.sql | \ +cat internal/database/migrations/008_separate_official_metadata.sql | \ docker exec -i test-postgres psql -U postgres -d registry_test 2>&1 | \ grep -E "(ERROR|NOTICE|WARNING)" ``` @@ -126,7 +126,7 @@ EOF # Start a transaction to test and rollback docker exec test-postgres psql -U postgres -d registry_test < /dev/null; then @@ -13,23 +11,19 @@ fi OIDC_TOKEN=$(gcloud auth print-identity-token) # Exchange for registry token -RESPONSE=$(curl -sS -X POST "${REGISTRY_URL}/v0/auth/oidc" \ +RESPONSE=$(curl -s -X POST "${REGISTRY_URL}/v0/auth/oidc" \ -H "Content-Type: application/json" \ -d "{\"oidc_token\": \"${OIDC_TOKEN}\"}") # Check if successful -if ! REGISTRY_TOKEN=$(printf '%s\n' "$RESPONSE" | jq -r '.registry_token // empty' 2>/dev/null); then - REGISTRY_TOKEN="" -fi +REGISTRY_TOKEN=$(echo "$RESPONSE" | jq -r '.registry_token // empty') if [ -z "$REGISTRY_TOKEN" ]; then echo "Error: Authentication failed" >&2 - if ! printf '%s\n' "$RESPONSE" | jq '.' >&2 2>/dev/null; then - printf '%s\n' "$RESPONSE" >&2 - fi + echo "$RESPONSE" | jq '.' >&2 exit 1 fi # Output the export command echo "# Successfully authenticated! Now run this to use your token:" >&2 -echo "export REGISTRY_TOKEN='${REGISTRY_TOKEN}'" +echo "export REGISTRY_TOKEN='${REGISTRY_TOKEN}'" \ No newline at end of file diff --git a/tools/admin/takedown.sh b/tools/admin/takedown.sh index f9fceed..d53babf 100755 --- a/tools/admin/takedown.sh +++ b/tools/admin/takedown.sh @@ -1,87 +1,30 @@ #!/bin/bash -# Set the lifecycle status of an MCP server, either for one version or for every version. - -set -euo pipefail +# Simple takedown script REGISTRY_URL="${REGISTRY_URL:-https://registry.modelcontextprotocol.io}" -STATUS="${STATUS:-deleted}" -SERVER_NAME="${SERVER_NAME:-}" -VERSION="${VERSION:-}" -ALL_VERSIONS="${ALL_VERSIONS:-}" -STATUS_MESSAGE="${STATUS_MESSAGE:-}" -usage() { - cat <<'EOF' -Usage: - REGISTRY_TOKEN= SERVER_NAME= VERSION= ./takedown.sh - REGISTRY_TOKEN= SERVER_NAME= ALL_VERSIONS=true ./takedown.sh - -Examples: - REGISTRY_TOKEN=token SERVER_NAME=com.example/my-server VERSION=1.0.0 ./takedown.sh - REGISTRY_TOKEN=token SERVER_NAME=com.example/my-server ALL_VERSIONS=true ./takedown.sh - -Optional environment variables: - STATUS active | deprecated | deleted (default: deleted) - STATUS_MESSAGE reason recorded alongside the status change (max 500 characters) - REGISTRY_URL registry base URL (default: https://registry.modelcontextprotocol.io) -EOF -} - -if [ -z "$SERVER_NAME" ] || [ -z "${REGISTRY_TOKEN:-}" ]; then - usage +if [ -z "$SERVER_NAME" ] || [ -z "$REGISTRY_TOKEN" ]; then + echo "Usage: REGISTRY_TOKEN= SERVER_NAME= [VERSION=] $0" + echo "Example: REGISTRY_TOKEN=token SERVER_NAME=com.example/my-server ./takedown.sh" + echo "Example: REGISTRY_TOKEN=token SERVER_NAME=com.example/my-server VERSION=1.0.0 ./takedown.sh" exit 1 fi -# Require an explicit choice, so that a forgotten VERSION cannot silently take -# down every version of a server. -if [ -n "$ALL_VERSIONS" ] && [ "$ALL_VERSIONS" != "true" ]; then - echo "Error: ALL_VERSIONS must be exactly true when set." >&2 - exit 1 -fi -if [ -n "$VERSION" ] && [ -n "$ALL_VERSIONS" ]; then - echo "Error: set either VERSION or ALL_VERSIONS, not both." >&2 - exit 1 -fi -if [ -z "$VERSION" ] && [ -z "$ALL_VERSIONS" ]; then - echo "Error: set VERSION= for a single version, or ALL_VERSIONS=true for every version." >&2 - echo >&2 - usage - exit 1 -fi - -# URL encode the server name and version (replace / with %2F) -ENCODED_SERVER_NAME="${SERVER_NAME//\//%2F}" +# URL encode the server name (replace / with %2F) +ENCODED_SERVER_NAME=$(echo "$SERVER_NAME" | sed 's|/|%2F|g') +# Determine the endpoint based on whether VERSION is provided if [ -n "$VERSION" ]; then - ENCODED_VERSION="${VERSION//\//%2F}" - ENDPOINT="${REGISTRY_URL}/v0/servers/${ENCODED_SERVER_NAME}/versions/${ENCODED_VERSION}/status" - echo "Setting version ${VERSION} of ${SERVER_NAME} to '${STATUS}'..." + # Mark specific version as deleted + ENDPOINT="${REGISTRY_URL}/v0/servers/${ENCODED_SERVER_NAME}/versions/${VERSION}?status=deleted" + echo "Marking version $VERSION of server $SERVER_NAME as deleted..." else - ENDPOINT="${REGISTRY_URL}/v0/servers/${ENCODED_SERVER_NAME}/status" - echo "Setting ALL versions of ${SERVER_NAME} to '${STATUS}'..." + # Mark entire server as deleted (latest version) + ENDPOINT="${REGISTRY_URL}/v0/servers/${ENCODED_SERVER_NAME}?status=deleted" + echo "Marking server $SERVER_NAME as deleted..." fi -if [ -n "$STATUS_MESSAGE" ]; then - BODY=$(jq -n --arg status "$STATUS" --arg message "$STATUS_MESSAGE" \ - '{status: $status, statusMessage: $message}') -else - BODY=$(jq -n --arg status "$STATUS" '{status: $status}') -fi - -RESPONSE_BODY=$(mktemp) -trap 'rm -f "$RESPONSE_BODY"' EXIT - -HTTP_CODE=$(curl -sS -X PATCH "$ENDPOINT" \ +# Update server status to deleted +curl -X PUT "$ENDPOINT" \ -H "Authorization: Bearer ${REGISTRY_TOKEN}" \ - -H "Content-Type: application/json" \ - -d "$BODY" \ - -o "$RESPONSE_BODY" \ - -w '%{http_code}') - -cat "$RESPONSE_BODY" -echo - -if [ "$HTTP_CODE" -lt 200 ] || [ "$HTTP_CODE" -ge 300 ]; then - echo "Request failed with HTTP ${HTTP_CODE}" >&2 - exit 1 -fi + -H "Content-Type: application/json" \ No newline at end of file diff --git a/tools/extract-server-schema/main.go b/tools/extract-server-schema/main.go index e7e5bd1..a90aa2d 100644 --- a/tools/extract-server-schema/main.go +++ b/tools/extract-server-schema/main.go @@ -14,9 +14,6 @@ import ( const ( openAPIPath = "docs/reference/api/openapi.yaml" schemaOutputDir = "docs/reference/server-json/draft" - - // refKey is the JSON Schema reference key. - refKey = "$ref" ) func main() { @@ -102,7 +99,7 @@ func main() { "$schema": "http://json-schema.org/draft-07/schema#", "$id": schemaID, "title": "server.json defining a Model Context Protocol (MCP) server", - refKey: "#/definitions/ServerDetail", + "$ref": "#/definitions/ServerDetail", "definitions": definitions, } @@ -151,7 +148,7 @@ func findReferencedSchemas(obj interface{}, found map[string]bool) { switch v := obj.(type) { case map[string]interface{}: for key, value := range v { - if key == refKey { + if key == "$ref" { if ref, ok := value.(string); ok { // Extract schema name from #/components/schemas/SchemaName if strings.HasPrefix(ref, "#/components/schemas/") { @@ -176,7 +173,7 @@ func replaceComponentRefs(obj interface{}) interface{} { case map[string]interface{}: result := make(map[string]interface{}) for key, value := range v { - if key == refKey { + if key == "$ref" { if ref, ok := value.(string); ok { // Replace the reference path result[key] = strings.ReplaceAll(ref, "#/components/schemas/", "#/definitions/")