Publishing Your MCP Server to the Official Registry

January 11, 2026

This guide walks you through publishing an MCP (Model Context Protocol) server to the official MCP Registry. The registry hosts metadata for MCP servers, making them discoverable by AI clients like Claude Desktop.

Prerequisites

  • Node.js - For TypeScript/JavaScript MCP servers
  • npm account - The registry only hosts metadata; your package must be published to npm first
  • GitHub account - For authentication with the registry

Step 1: Add Verification Information to package.json

The MCP Registry requires an mcpName property in your package.json to verify ownership:

{
  "name": "your-mcp-server",
  "version": "1.0.0",
  "mcpName": "io.github.YourUsername/your-server-name",
  ...
}

Warning: The mcpName must match your GitHub username exactly, including case sensitivity. If your GitHub username is S2thend, use io.github.S2thend/, not io.github.s2thend/.

Step 2: Create server.json

Create a server.json file in your project root with the MCP Registry metadata:

{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.YourUsername/your-server-name",
  "description": "Description of your MCP server",
  "repository": {
    "url": "https://github.com/YourUsername/your-repo",
    "source": "github"
  },
  "version": "1.0.0",
  "packages": [
    {
      "registryType": "npm",
      "identifier": "your-mcp-server",
      "version": "1.0.0",
      "transport": {
        "type": "stdio"
      }
    }
  ]
}

Common Errors

ErrorCauseFix
cannot unmarshal string into Go struct field ServerJSON.repositoryrepository is a string instead of an objectUse object format: {"url": "...", "source": "github"}
cannot unmarshal object into Go struct field ServerJSON.packagespackages is an object instead of an arrayUse array format: "packages": [{ ... }]
You do not have permission to publish this serverCase mismatch in usernameMatch GitHub username case exactly (e.g., S2thend not s2thend)

Step 3: Publish to npm First

The MCP Registry only stores metadata. Your package must exist on npm:

npm install
npm run build
npm publish --access public

Step 4: Install mcp-publisher CLI

macOS/Linux

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/

Homebrew

brew install mcp-publisher

Step 5: Authenticate and Publish

# Authenticate with GitHub
mcp-publisher login github

# Follow the device code flow in your browser
# Then publish
mcp-publisher publish

Automating with GitHub Actions

Add MCP Registry publishing to your CI/CD pipeline:

name: Publish to npm and MCP Registry

on:
  release:
    types: [published]

jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write  # Required for OIDC authentication

    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 'lts/*'
          registry-url: 'https://registry.npmjs.org'

      - name: Install dependencies
        run: npm ci

      - name: Run tests
        run: npm run test --if-present

      - name: Build
        run: npm run build --if-present

      - name: Publish to npm
        run: npm publish --provenance --access public
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

      # Publish to MCP Registry
      - 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
        run: ./mcp-publisher login github-oidc

      - name: Set version in server.json
        run: |
          VERSION=${GITHUB_REF#refs/tags/v}
          jq --arg v "$VERSION" '.version = $v | .packages[0].version = $v' server.json > server.tmp && mv server.tmp server.json

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

Key Points for GitHub Actions

  1. OIDC Authentication - Use github-oidc instead of github for CI. Requires id-token: write permission.
  2. Version Sync - Use jq to update both .version and .packages[0].version from the git tag.
  3. npm First - The MCP Registry validates that your npm package exists before accepting metadata.

Troubleshooting

Error: 403 Forbidden - You do not have permission

You have permission to publish: io.github.S2thend/*.
Attempting to publish: io.github.s2thend/cursor-history.

Fix: GitHub usernames in MCP names are case-sensitive. Check your actual GitHub username and match it exactly.

Error: cannot unmarshal string/object

The server.json schema is strict:

  • repository must be an object with url and source fields
  • packages must be an array of package objects
  • Each package needs registryType, identifier, version, and transport

Error: 403 - Cannot publish over previously published versions

You already published this version to npm. Bump the version number:

npm version patch  # or minor/major

Then update both package.json and server.json to match.

Verification

After publishing, verify your server appears in the registry:

curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.YourUsername/your-server"

Summary Checklist

  • Add mcpName to package.json matching your GitHub username case exactly
  • Create server.json with correct schema (repository as object, packages as array)
  • Publish to npm first
  • Use mcp-publisher login github (local) or github-oidc (CI)
  • Run mcp-publisher publish

References

  1. Model Context Protocol. (n.d.). Quickstart: Publishing an MCP Server. GitHub. Retrieved January 11, 2026, from https://github.com/modelcontextprotocol/registry/blob/main/docs/modelcontextprotocol-io/quickstart.mdx

  2. Model Context Protocol. (n.d.). How to Automate Publishing with GitHub Actions. GitHub. Retrieved January 11, 2026, from https://github.com/modelcontextprotocol/registry/blob/main/docs/modelcontextprotocol-io/github-actions.mdx

  3. Model Context Protocol. (n.d.). MCP Registry Publisher CLI. GitHub. Retrieved January 11, 2026, from https://github.com/modelcontextprotocol/registry

  4. Model Context Protocol. (n.d.). Server.json Schema (2025-12-11). Retrieved January 11, 2026, from https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json

© 2026 borui. All rights reserved. This content may be freely reproduced, displayed, modified, or distributed with proper attribution to borui and a link to the article: borui (2026-01-11). Publishing Your MCP Server to the Official Registry. https://caiborui.com/blog/2026-01-11-en-publish-mcp-server-to-registry

@misc{borui2026-1b5d9c9b,
  author = {borui},
  title = {{Publishing Your MCP Server to the Official Registry}},
  year = {2026},
  publisher = {borui's blog},
  url = {https://caiborui.com/blog/2026-01-11-en-publish-mcp-server-to-registry}
}