Skip to content

fix(targets): Wait for npm before publishing to the MCP Registry - #963

Merged
BYK merged 1 commit into
masterfrom
fix/mcp-registry-wait-for-npm
Nov 5, 2026
Merged

BYK merged 1 commit into
masterfrom
fix/mcp-registry-wait-for-npm

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

The mcp-registry target runs right after npm, and the MCP Registry rejects a publish when npm doesn't serve the new package version yet. That's what broke getsentry/toolkit 0.48.0 (publish#10254, run): npm accepted @sentry/mcp-server@0.48.0 at 20:08:20, and the registry returned NPM package '@sentry/mcp-server' exists, but version '0.48.0' was not found (status: 404) at 20:08:21.

#945 removed the npm wait in a1b55d5 so the registry could do the check alone. This adds the wait back:

  • Before authenticating and publishing, the target polls https://registry.npmjs.org/<name>/<version> for each npm package in the manifest. This is the same URL the registry fetches in npm.go.
  • It waits up to about five minutes (30 tries, 10s apart). The old limit was 2 minutes. I raised it because npm can now take longer to serve new versions.
  • pollJson also retries 429 responses now, for npm and for the listing poll.
  • It only waits when it's about to publish. If the version is already listed, or in dry-run mode, it doesn't hit npm.
  • I didn't bring back the mcpName check. The registry already does it and returns a clear error.

Docs in targets/mcp-registry.md are updated to match.

Tests: I added mcpRegistry.test.ts cases for waiting through 404, 429, and 503 responses, giving up after the limit without publishing, and skipping non-npm packages. pnpm lint passes. In pnpm test, the only failures are the same 24 prepare-dry-run.e2e tests that fail on master in this sandbox.

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

via @BYK.

--

View Session in Sentry

The mcp-registry target runs right after the npm target, and the
registry rejects a publish when npm does not serve the new package
version yet. getsentry/toolkit 0.48.0 failed this way one second after
npm accepted @sentry/mcp-server@0.48.0.

Before authenticating, poll npm for each npm package version at the
same URL the registry validates, for up to about five minutes. Retry
429 responses as well. The registry still does the mcpName check.

Refs getsentry/publish#10254

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-11-05 20:32 UTC

@BYK
BYK merged commit bf47ce0 into master Nov 5, 2026
29 checks passed
@BYK
BYK deleted the fix/mcp-registry-wait-for-npm branch November 5, 2026 20:32
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.

1 participant