# How to publish an MCP server to the official MCP Registry (and fix server.json errors)

By [Jonah Ease](https://manycp.com/about) Published 1 Oct 2026 Last checked 1 Oct 2026

Publishing to the official MCP Registry takes a proof inside your package, a `server.json`, and three commands. The registry stores metadata only, and points at a package you published elsewhere[8]. It says it is in preview, so breaking changes or data resets may occur[8]. If you only need this one listing, you can do all of it by hand: see when you don't need ManyCP.

## Put the proof inside the package

The registry checks that the package really belongs to the name in `server.json`. The marker has to be inside the version you publish[3].

| Package | Proof, with this guide's sample name |
| --- | --- |
| npm | `"mcpName": "io.github.example-user/weather-mcp"` in package.json |
| PyPI | `mcp-name: io.github.example-user/weather-mcp` in the README, which PyPI shows as the description |
| NuGet | `mcp-name: io.github.example-user/weather-mcp` in the package README |
| Cargo | `mcp-name: io.github.example-user/weather-mcp` as visible text in the README (crates.io removes HTML comments) |
| Docker / OCI | `LABEL io.modelcontextprotocol.server.name="io.github.example-user/weather-mcp"` in the Dockerfile |
| Remote server | No package, so no marker. The URL has to be publicly reachable[4]. |

With GitHub login the name must start with `io.github.<your-username>/`. A domain you own gives a name that starts with that domain, reversed[2].

## The steps

1. Publish the package first, so the proof is live: `npm publish --access public` [1].
2. Install the tool: `brew install mcp-publisher`, or the release download on the registry's GitHub page[1].
3. Write `server.json`. `mcp-publisher init` makes a template with `TODO:` placeholders[10]. The next section has a finished one.
4. Log in: `mcp-publisher login github`. It prints a code to enter at github.com/login/device[1].
5. Check it: `mcp-publisher validate` [10]. Then publish: `mcp-publisher publish`.

Terminal

```
mcp-publisher login github
mcp-publisher validate
mcp-publisher publish

# Is it live? (this search form is the quickstart's own check)
curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.example-user/weather-mcp"
```

The last command is the one in the quickstart[1].

## A server.json that validates

This file was built by `buildServerJson`, the function ManyCP publishes with, for a sample npm server. Posted to the registry's validation endpoint on 1 Oct 2026 it returned `{"valid":true,"issues":[]}` [11].

server.json (npm package)

```
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.example-user/weather-mcp",
  "description": "Weather forecasts and alerts for any city.",
  "version": "1.0.0",
  "title": "Weather",
  "repository": {
    "url": "https://github.com/example-user/weather-mcp",
    "source": "github"
  },
  "packages": [
    {
      "registryType": "npm",
      "identifier": "@example-user/weather-mcp",
      "version": "1.0.0",
      "runtimeHint": "npx",
      "transport": {
        "type": "stdio"
      }
    }
  ]
}
```

- `$schema` is `https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json`, which is required[9].
- `description` is 100 characters at most[9]. `version` is one exact version, never a range[5].
- The version in `packages[].version` must be a version that is on npm and carries the proof.

### A remote server has no package

server.json (remote)

```
{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.example-user/weather-mcp",
  "description": "Weather forecasts and alerts for any city.",
  "version": "1.0.0",
  "title": "Weather",
  "repository": {
    "url": "https://github.com/example-user/weather-mcp",
    "source": "github"
  },
  "remotes": [
    {
      "type": "streamable-http",
      "url": "https://weather.example.com/mcp"
    }
  ]
}
```

A remote entry uses `remotes` with a `streamable-http` or `sse` type and a public URL[4]. This one also returned valid on 1 Oct 2026.

## Publish from GitHub Actions

The registry's own workflow logs in with GitHub OIDC, so there is no stored secret, and it needs `id-token: write` [6]. This is the registry-only variant ManyCP puts in a pull request body: it leaves publishing the package to your own release job, waits for the version to appear on npm, and sets the version from the tag.

.github/workflows/publish-mcp.yml

```
# Publishes this server to the official MCP Registry when you push a tag like v1.2.3.
# Your own release pipeline publishes the package. This only tells the registry about it, with GitHub OIDC (no stored secret).
name: Publish to MCP Registry

on:
  push:
    tags: ["v*"]

jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      id-token: write # required for `mcp-publisher login github-oidc`
      contents: read

    steps:
      - name: Checkout
        uses: actions/checkout@v5

      # The package must be on npm before the registry can check it. Your own release job publishes it.
      - name: Wait for the package on npm
        run: |
          VERSION="${GITHUB_REF_NAME#v}"
          for i in $(seq 1 30); do
            curl -sfo /dev/null "https://registry.npmjs.org/@example-user%2Fweather-mcp/$VERSION" && exit 0
            sleep 10
          done
          echo "Version $VERSION is not on npm yet." && exit 1

      # Keep server.json and the git tag in lockstep (registry versions never change once published).
      - name: Sync version from tag
        run: |
          VERSION="${GITHUB_REF_NAME#v}"
          jq --arg v "$VERSION" '.version = $v | (.packages[]? | select(.registryType=="npm") | .version) = $v' \
            server.json > server.tmp && mv server.tmp server.json

      - 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: Authenticate to MCP Registry (GitHub OIDC)
        run: ./mcp-publisher login github-oidc

      - name: Validate server.json
        run: ./mcp-publisher validate

      - name: Publish server to MCP Registry
        run: ./mcp-publisher publish
```

## Errors and fixes

The texts below are the registry's own, with this guide's sample names in them. The ones that start with `expected`, `version must` and `invalid version` were returned by the registry's validator on 1 Oct 2026.

| Error text | Cause | Fix | Source |
| --- | --- | --- | --- |
| NPM package '@example-user/weather-mcp' is missing required 'mcpName' field. Add this to your package.json: "mcpName": "io.github.example-user/weather-mcp" | The npm version in server.json has no mcpName. The registry reads the published copy of that version, not your repo. | Add mcpName to package.json, publish a new npm version, and put that version in server.json. | [12] [3] |
| NPM package ownership validation failed. Expected mcpName 'io.github.example-user/weather-mcp', got 'weather-mcp' | mcpName is there but differs from the name in server.json. | Make them identical, character for character, and publish a new version. | [12] [1] |
| NPM package '@example-user/weather-mcp' exists, but version '1.0.0' was not found (status: 404). A newly published release can take a moment to appear on the registry. Wait and retry, or publish version '1.0.0' before registering it | The package version is not on npm yet, or has only just been published. | Check the version on npm, wait a minute and publish again. | [12] |
| PyPI package 'weather-mcp' ownership validation failed. The server name 'io.github.example-user/weather-mcp' must appear as 'mcp-name: io.github.example-user/weather-mcp' in the package README | The README that PyPI shows for this version has no mcp-name line. | Add the line mcp-name: io.github.example-user/weather-mcp to the README and publish a new PyPI version. | [13] [3] |
| PyPI package 'weather-mcp' ownership validation failed: found 'mcp-name: io.github.example-user/weather-mcp' in the README, but it is immediately followed by "." rather than a boundary. The token must be followed by a space, newline, an HTML tag, or a comment close ('-->') — put it on its own line and republish | Punctuation is glued to the end of the name. | Put the mcp-name line on its own line and publish a new version. | [13] |
| OCI image 'docker.io/example-user/weather-mcp:1.0.0' is missing required annotation. Add this to your Dockerfile: LABEL io.modelcontextprotocol.server.name="io.github.example-user/weather-mcp" | The image has no ownership label. | Add the LABEL line, rebuild, push a new tag and use that tag in the identifier. | [14] [3] |
| OCI packages must not have 'version' field - include version in 'identifier' instead (e.g., 'docker.io/owner/image:1.0.0') | An oci package carries its version in the image tag, not in a version field. | Delete the version field from the package and keep the tag in identifier. | [14] |
| expected length <= 100 (location: body.description) | The description is longer than 100 characters. | Cut it to 100 characters or fewer, at a word. | [9] [11] |
| version must be a specific version, not a range: "^1.0.0" | A version range (^, ~, >=, 1.x, 1.\*) was used where one exact version belongs. | Use one exact version such as 1.0.0, in server.json and in each package. | [5] [11] |
| expected string to match pattern ^[a-zA-Z0-9.-]+/[a-zA-Z0-9._-]+$ (location: body.name) | The name has no namespace, or more than one slash. | Use namespace/name, such as io.github.example-user/weather-mcp. | [9] [11] |
| invalid version: cannot publish duplicate version: io.github.example-user/weather-mcp@1.0.0 already exists | That name and version are already published, and published metadata does not change. | Raise the version in server.json and publish again. | [15] [16] [7] |
| Invalid or expired Registry JWT token | The login has run out, or you are not logged in. | Run mcp-publisher login github again, then publish. | [1] [17] |
| You do not have permission to publish this server | Your login does not match the name's namespace. With GitHub, the name must start with io.github.\<your-username>/. | Rename the server, or log in with the method that owns that namespace. | [1] [2] [17] |
| invalid audience | mcp-publisher login github-oidc from an older mcp-publisher. | Install the latest mcp-publisher in the workflow. | [10] |

A package that was published a moment ago can be missing for a short time; the registry's own message says to wait and retry[12].

## When you don't need ManyCP

- You have one server and one registry listing. Everything above is free to do by hand, and the quickstart has no payment step[1].
- You already ship releases from GitHub Actions. Add the workflow above and publish on every tag.
- You only want the registry. The registry is one of 26 directories, and [some of the others read it](https://manycp.com/guides/directories-that-copy-the-mcp-registry).

What ManyCP adds: ManyCP builds the server.json, checks it with the registry, and publishes with your GitHub sign-in. If your package is missing the mcpName proof, it opens a pull request on your own repo to add it. It does not publish your npm or PyPI package for you. A new package version, with the proof in it, is yours to release. For the rest of the list, see [all 26 directories compared](https://manycp.com/guides/mcp-server-directories), or run the [free checker](https://manycp.com/check) first.

## Sources

1. [MCP Registry: Quickstart, publish an MCP server](https://modelcontextprotocol.io/registry/quickstart) · checked 1 Oct 2026
2. [MCP Registry: How to authenticate when publishing](https://modelcontextprotocol.io/registry/authentication) · checked 1 Oct 2026
3. [MCP Registry: Supported package types and ownership checks](https://modelcontextprotocol.io/registry/package-types) · checked 1 Oct 2026
4. [MCP Registry: Publishing remote servers](https://modelcontextprotocol.io/registry/remote-servers) · checked 1 Oct 2026
5. [MCP Registry: Versioning published MCP servers](https://modelcontextprotocol.io/registry/versioning) · checked 1 Oct 2026
6. [MCP Registry: Automate publishing with GitHub Actions](https://modelcontextprotocol.io/registry/github-actions) · checked 1 Oct 2026
7. [MCP Registry: Frequently asked questions](https://modelcontextprotocol.io/registry/faq) · checked 1 Oct 2026
8. [The MCP Registry: about (preview status)](https://modelcontextprotocol.io/registry/about) · checked 1 Oct 2026
9. [server.json schema, 2025-12-11](https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json) · checked 1 Oct 2026
10. [mcp-publisher command reference](https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/cli/commands.md) · checked 1 Oct 2026
11. [Official registry API reference, including POST /v0.1/validate](https://github.com/modelcontextprotocol/registry/blob/main/docs/reference/api/official-registry-api.md) · checked 1 Oct 2026
12. [Registry source: npm ownership check (npm.go)](https://github.com/modelcontextprotocol/registry/blob/main/internal/validators/registries/npm.go) · checked 1 Oct 2026
13. [Registry source: PyPI ownership check (pypi.go)](https://github.com/modelcontextprotocol/registry/blob/main/internal/validators/registries/pypi.go) · checked 1 Oct 2026
14. [Registry source: Docker/OCI ownership check (oci.go)](https://github.com/modelcontextprotocol/registry/blob/main/internal/validators/registries/oci.go) · checked 1 Oct 2026
15. [Registry source: duplicate version error (database.go)](https://github.com/modelcontextprotocol/registry/blob/main/internal/database/database.go) · checked 1 Oct 2026
16. [Registry source: duplicate version check (registry_service.go)](https://github.com/modelcontextprotocol/registry/blob/main/internal/service/registry_service.go) · checked 1 Oct 2026
17. [Registry source: publish handler (publish.go)](https://github.com/modelcontextprotocol/registry/blob/main/internal/api/handlers/v0/publish.go) · checked 1 Oct 2026

ManyCP is not affiliated with, endorsed by or sponsored by any directory, Docker, OpenAI, Anthropic or GitHub named here. Names are used to say which service a fact is about.

---

Source: [ManyCP](https://manycp.com/guides/publish-to-the-mcp-registry)
