Skip to content

feat(targets): Add mcp-registry target for the official MCP Registry - #945

Merged
BYK merged 3 commits into
masterfrom
feat/mcp-registry-target
Oct 31, 2026
Merged

BYK merged 3 commits into
masterfrom
feat/mcp-registry-target

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Adds an mcp-registry target that publishes an MCP server's server.json to the MCP Registry. It does in Craft what getsentry/toolkit's .github/workflows/mcp-registry.yml does today.

targets:
  - name: npm
  - name: mcp-registry
    manifest: server.json # default, relative to the repository root
    # registryUrl: https://registry.modelcontextprotocol.io  # default

For the release version, the target:

  1. Sets version and every packages[].version in the manifest to the release version, in memory only.
  2. For each npm package, checks that npm serves that exact version and that its mcpName equals the manifest name. When listed after npm, this is a short readiness check (at most 12 tries, 10s apart) to cover propagation lag, not the old 10-minute poll.
  3. Looks up /v0.1/servers/<name>/versions/<version>. A 404 means publish. A 200 that matches the manifest (ignoring $schema) is a no-op success, so re-running a release is safe. A 200 that differs is an error, because registry versions are immutable. Any other status is an error.
  4. Authenticates and POSTs to /v0/publish, then checks that the listing matches and its status is active.

Auth: It calls the registry's HTTP API directly instead of downloading mcp-publisher. These are the same calls mcp-publisher makes: by default, it gets a GitHub Actions OIDC token whose audience is the registry origin (the registry checks this) and exchanges it at /v0/auth/github-oidc. Without OIDC, it exchanges MCP_GITHUB_TOKEN, the same env var mcp-publisher reads, at /v0/auth/github-at. The registry gives OIDC tokens publish access to io.github.<repository owner>/*. Craft's other targets already use plain fetch, so there's no binary to pin or verify by checksum.

Dry run: It still runs the read-only npm and listing checks. It doesn't wait for npm, authenticate, or publish.

Follow-ups outside this repo:

Closes #944

Co-Authored-By: BYK burak.kaya@sentry.io

via BYK.

--

View Session in Sentry

Publish an MCP server's server.json to the MCP Registry through its HTTP
API. The target sets the manifest version to the release version, checks
that each npm package is published with a matching mcpName, skips versions
that are already listed and match, publishes with GitHub Actions OIDC or a
MCP_GITHUB_TOKEN fallback, and verifies the new listing.

Closes #944

Co-Authored-By: BYK <burak.kaya@sentry.io>
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-10-31 14:18 UTC

Comment thread src/targets/mcpRegistry.ts Fixed
Address CodeQL findings: escape every character of the npm package name
(keeping the leading @ like npm does) instead of only the first slash, and
match the OIDC endpoint in tests by URL origin instead of a string prefix.
Comment thread src/targets/mcpRegistry.ts Resolved
The registry already checks, on publish, that each npm package version
exists and that its mcpName matches the server name, and it returns a
specific error when a fresh version has not reached npm yet. Drop the
duplicate npm polling and mcpName check instead of guessing how long npm
takes to serve a new version. If npm is still behind, the publish fails
with the registry's message and a re-run resumes at this target.
@BYK
BYK merged commit f876000 into master Oct 31, 2026
29 checks passed
@BYK
BYK deleted the feat/mcp-registry-target branch October 31, 2026 14:18
BYK added a commit to getsentry/publish that referenced this pull request Oct 31, 2026
Craft's new `mcp-registry` target (getsentry/craft#945) logs in to the
MCP Registry with GitHub Actions OIDC. Without that, it falls back to a
long-lived `MCP_GITHUB_TOKEN` secret, which we'd rather not add. For
OIDC to work, the workflow that runs Craft needs `id-token: write`.

**Change:** add `id-token: write` to the existing workflow-level
`permissions`. I didn't use a job-level block because it would replace
the workflow-level permissions instead of merging with them, so the job
would have to restate the rest. As a result, `waiting-for-ci` can also
request OIDC tokens. It only runs this repo's own scripts and already
holds `packages: write`.

**Why it works in the Craft container:** Craft runs as a
`docker://getsentry/craft:latest` step. The runner's
`ContainerActionHandler` passes `ACTIONS_ID_TOKEN_REQUEST_URL` /
`ACTIONS_ID_TOKEN_REQUEST_TOKEN` into container steps when the job has
`id-token: write`, and those are the variables the target reads.

**Namespace:** the registry grants OIDC tokens the `io.github.<owner>/*`
namespace of the repo that runs the workflow. That's `getsentry` here,
which matches `io.github.getsentry/sentry-mcp`. I haven't tested this
end to end yet. The first release that includes the target will be the
real test.

**Things to note:** this lets any step in this workflow request an OIDC
token for `getsentry/publish`. That only matters if some cloud account
trusts tokens from this repo. Publishing still runs in the `production`
environment behind the `accepted` + `ci-ready` gates.

`pnpm test` and `pnpm lint` pass.

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A0ab4fc2bd5a2e23f2c25efcf -->

--

[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A0ab4fc2bd5a2e23f2c25efcf/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <126780+BYK@users.noreply.github.com>
sentry-junior Bot added a commit to getsentry/toolkit that referenced this pull request Nov 1, 2026
Craft 3.5.0 ships the `mcp-registry` target (getsentry/craft#945), and
getsentry/publish now grants `id-token: write`, so the target can use
GitHub Actions OIDC. Add it to the `packages/cli` workspace after the
npm targets, require Craft 3.5.0, and remove the Publish MCP Registry
workflow it replaces.

This branch was previously deployed

1 inactive deployment
false — a1b55d52 Deployed Oct 31, 2026 by sentry-junior[bot] via Build #3257
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an mcp-registry target that publishes to the official MCP Registry

2 participants