mcp-registry-preflight

elfovo/mcp-registry-preflight Checked 2 days ago

Catch the causes of 'publish failed: status 400' before mcp-publisher publish — read-only, bash+curl+jq

A read-only check to run before mcp-publisher publish. It catches, against the live registries, the usual causes of that mcp-publisher validate cannot see, because it only checks the server.json schema. The rules were read from the registry source (internal/validators/registries/*.go). Other package types (OCI, NuGet, …) are reported as not checked.

Summary extracted from the README.

mcp-registry-preflight

A read-only check to run before mcp-publisher publish. It catches, against the live registries, the usual causes of

Error: publish failed: server returned status 400: {"title":"Bad Request","status":400,
"detail":"Failed to publish server", ... "registry validation failed for package 0" ...}

that mcp-publisher validate cannot see, because it only checks the server.json schema.

What it checks

Check Why it fails the publish
name + version already in the MCP registry published versions are immutable
packages[].version differs from version the registry validates packages[].version, not the top-level one
npm: that exact version is published the registry fetches it from npm
npm: mcpName in package.json equals name ownership check, case-sensitive
PyPI: that exact version is published reported as not found (status: 404)
PyPI: README contains mcp-name: <name> followed by a boundary ownership check; a pyproject keyword does not count
MCPB: URL contains mcp, is a public GitHub/GitLab release asset registry rules
MCPB: fileSha256 is present and matches the published asset the registry does not verify the hash — clients do, at install time
fileSha256 on a non-MCPB package rejected by the registry

The rules were read from the registry source (internal/validators/registries/*.go). Other package types (OCI, NuGet, …) are reported as not checked.

Usage

curl -fsSLO https://raw.githubusercontent.com/elfovo/mcp-registry-preflight/main/mcp-registry-preflight.sh
bash mcp-registry-preflight.sh server.json && mcp-publisher publish

Needs bash, curl, jq. Exit codes: 0 nothing found, 1 at least one problem, 2 usage error. MCP_REGISTRY_URL overrides the registry (default https://registry.modelcontextprotocol.io).

In GitHub Actions, add a step before the publish step:

- run: bash <(curl -fsSL https://raw.githubusercontent.com/elfovo/mcp-registry-preflight/main/mcp-registry-preflight.sh) server.json

Tests

test-preflight.sh runs 13 cases against the real npm, PyPI, GitHub and MCP registry (including two positive cases on immutable third-party versions). It needs network access.

Authorship

Written by an autonomous AI agent (Claude Code) — see NOTICE. Not affiliated with the Model Context Protocol project.