Publishing an Internal MCP Server to the MCP Registry: A Step-by-Step Guide

Server and network equipment being installed in a computer room

You publish an MCP server to the official MCP Registry by publishing its underlying package to a public registry like npm first, then using the official mcp-publisher CLI to authenticate, generate a server.json metadata file, and run mcp-publisher publish. The registry only stores metadata, not code, and — critically for anyone planning to list a genuinely internal tool — it will not accept a server that isn’t publicly installable or publicly reachable.

First, check whether your “internal” server can actually go here

Read this section before you do anything else, because it changes what “publishing an internal tool” means. The MCP Registry’s own documentation states the relationship plainly: the registry supports both open-source and closed-source servers, but only “as long as the server’s installation method is publicly available (e.g., an npm package or a Docker image on a public registry) or the server itself is publicly accessible.” It then draws the line explicitly: a server “published on a private network (like mcp.acme-corp.internal) or on private package registries (e.g. npx -y @acme/mcp --registry https://artifactory.acme-corp.internal/npm)” does not qualify, and the registry maintainers’ recommendation for that case is to run your own private MCP registry instead, using the same OpenAPI spec the official one publishes.

So “internal tool” in this guide means a server that started life for internal use but is now being pushed to a public npm (or other supported) package and a public listing — source-closed is fine, network-closed is not. If your server genuinely cannot leave your private network or private artifact store, this guide isn’t the right tool for the job; what follows won’t work for it, and no configuration trick changes that, because the registry’s design assumes downstream aggregators and MCP clients can reach whatever you list.

What you need before you start

Three things have to be true before the publish step will work at all. You need a package registry account for wherever your server’s code will live — the official walkthrough uses npm, so you’ll want an npm account if that’s your path; other package types (PyPI, Docker Hub images, and more) are supported too, with details in the registry’s package-types documentation, though npm is the most thoroughly documented path today. You need a way to prove you own the namespace you want to publish under — either a GitHub account (the simplest route) or a domain you control (for DNS- or HTTP-based verification, covered below). And you need the mcp-publisher CLI itself, distributed as a prebuilt binary for macOS, Linux, and Windows, or installable via Homebrew.

Step 1: Tell the registry which package metadata to trust

The registry cross-checks your server’s listing against the actual package you publish, and for npm packages that check runs through a field called mcpName. Add it to your package.json:

{
  "name": "@my-org/internal-mcp-tool",
  "version": "1.0.1",
  "mcpName": "io.github.my-org/internal-tool",
  "repository": {
    "type": "git",
    "url": "https://github.com/my-org/internal-mcp-tool.git"
  }
}

That mcpName value becomes your server’s name inside the registry, and its format is not optional — it’s dictated by which authentication method you choose in Step 5. If you authenticate with GitHub, the name must start with io.github.your-username/ or io.github.your-orgname/; there’s no way around this with GitHub-based auth, and setting it to anything else will fail at the permissions stage, not at validation.

Step 2: Publish the actual package first

The registry has nothing to point to until your package exists somewhere public, so this step has to happen before you touch mcp-publisher at all. For an npm package:

# build your distributable files first
npm run build

# authenticate to npm if you haven't already
npm adduser

# publish — scoped packages need --access public
npm publish --access public

Confirm it actually landed by visiting the package’s npm URL directly rather than trusting the publish command’s exit code alone — a silent auth or scoping mistake here is easier to catch visually than by re-reading CLI output.

Step 3: Install the mcp-publisher CLI

On macOS or Linux, the official install command downloads the right prebuilt binary for your architecture automatically:

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/

# or, with Homebrew
brew install mcp-publisher

Run mcp-publisher --help afterward. You should see four subcommands: init, login, logout, and publish. If any are missing, the binary didn’t install correctly — don’t proceed to authentication on a broken install, because the failure mode there is confusing rather than obvious.

Step 4: Generate and fill in server.json

Run mcp-publisher init inside your project directory, and it generates a starter server.json using details it can infer from your project. A complete, real example — annotated field by field — looks like this:

{
  "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
  "name": "io.github.my-org/internal-tool",
  "description": "An MCP server that exposes our internal build-status API.",
  "repository": {
    "url": "https://github.com/my-org/internal-mcp-tool",
    "source": "github"
  },
  "version": "1.0.1",
  "packages": [
    {
      "registryType": "npm",
      "identifier": "@my-org/internal-mcp-tool",
      "version": "1.0.1",
      "transport": { "type": "stdio" },
      "environmentVariables": [
        {
          "name": "BUILD_API_KEY",
          "description": "API key for the internal build-status service",
          "isRequired": true,
          "isSecret": true,
          "format": "string"
        }
      ]
    }
  ]
}

Each field does a specific job, and getting one wrong is the single most common reason a first publish fails. name must exactly match the mcpName you set in package.json in Step 1 — a mismatch here, not a missing field, is the usual cause of validation errors. repository.source tells the registry which provider to check for ownership signals; github is the value for a GitHub-hosted repo. Inside packages, registryType says which package registry hosts the actual code (npm here; other registry types are supported for other ecosystems), identifier is the exact package name as published, and version must match a version you’ve actually published — not a version you’re about to publish, and not a version number bumped only in server.json without a matching npm release. transport.type describes how a client talks to the server once installed (stdio for a locally-spawned process); remote servers use a different transport shape, documented separately in the registry’s remote-servers guide. The environmentVariables array exists so installers know what to configure before running your server — mark anything like an API key with "isSecret": true so client UIs can mask it.

Step 5: Authenticate — and understand what your choice locks in

Your authentication method and your namespace are the same decision, not two separate ones. The registry ties server names to verified identities using a reverse-DNS-style format specifically so that only the actual owner of a GitHub account or domain can publish under that name — this is the registry’s core anti-spam and anti-impersonation mechanism, not an arbitrary naming convention.

Authentication methodRequired name formatExample
GitHub-basedio.github.username/* or io.github.orgname/*io.github.alice/weather-server
Domain-based (DNS or HTTP)com.example.*/* (reverse-DNS of your domain)io.modelcontextprotocol/everything

GitHub authentication is the fastest path for most teams, and it’s a standard OAuth device flow:

mcp-publisher login github

# Output:
# Logging in with github...
# To authenticate, please:
# 1. Go to: https://github.com/login/device
# 2. Enter code: ABCD-1234
# 3. Authorize this application
# Waiting for authorization...

Domain-based authentication exists for teams that want a custom namespace prefix instead of io.github.*, and it proves ownership through a DNS TXT record or a file hosted at /.well-known/mcp-registry-auth on your domain, backed by a public/private keypair (Ed25519 or ECDSA P-384, generated with openssl, or managed through Google Cloud KMS or Azure Key Vault if you’d rather not hold the private key yourself). The exact key-generation and record-publishing commands are long enough that reproducing them here invites copy-paste drift from whatever the registry’s current schema version expects — the official authentication guide keeps them current, and that’s the version to run from directly rather than a snapshot of it.

Step 6: Publish, then verify it actually resolves

With authentication done and server.json saved, publishing is one command:

mcp-publisher publish

# Output:
# Publishing to https://registry.modelcontextprotocol.io...
# ✓ Successfully published
# ✓ Server io.github.my-org/internal-tool version 1.0.1

A success message is not the same as confirmation your listing is live and correctly formed — query the public search API directly before you consider this done:

curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.my-org/internal-tool"

You should get back a JSON object containing a servers array with your server’s metadata inside it. If the array is empty, don’t assume the publish silently failed somewhere upstream — re-check that the name in your query exactly matches the name field in the server.json you published, since a trailing slash or case mismatch is a more likely cause than registry downtime.

The three failures you’ll actually hit

These are the documented, real error messages the registry returns, not a guessed list — and each one has a single specific fix rather than a general “double-check everything” shrug.

Error messageFix
“Registry validation failed for package”Your package is missing the verification info the registry checks for — for npm, confirm the mcpName property is actually present in the published package.json, not just your local working copy.
“Invalid or expired Registry JWT token”Re-run mcp-publisher login github (or your domain-auth equivalent) — your session token expired between login and publish.
“You do not have permission to publish this server”Your name format doesn’t match your authentication method. GitHub auth requires io.github.your-username/* exactly — a mismatched namespace is rejected at the permissions layer, not caught earlier as a validation warning.

Worth noting directly: the registry itself states it’s currently in preview, and that “breaking changes or data resets may occur before general availability.” That’s not filler caution — it means a server.json schema URL or CLI flag that’s accurate today could shift, so if a command in this guide stops matching what you see, the official quickstart and authentication pages are the ones to trust over a cached copy of either.

What the registry deliberately doesn’t do for you

Publishing metadata is not the same as vetting your server’s security, and the registry says so explicitly: it delegates security scanning to the underlying package registries (npm, PyPI, Docker Hub) and to downstream aggregators, while the registry itself focuses narrowly on namespace authentication and metadata hosting. If you’re listing an internal tool that’s now public, that’s your cue to actually review what surface area you’re exposing before anyone installs it — our companion checklist on hardening an MCP server’s network exposure before you take it off localhost walks through exactly that, and pairs naturally with this guide since both describe the same server at the two different moments — before and after it becomes reachable by strangers.

It’s also worth reviewing what permissions your server actually requests once it’s installable by anyone — our guide to reviewing an MCP server’s permissions before connecting it to Claude Code covers that from the installer’s side, which is the perspective your new public listing is about to be seen from.

FAQ

Can I publish a server that only works inside our VPN? No — the registry explicitly excludes servers on private networks or private package registries, and recommends running your own private registry instance of the same open spec instead.

Does publishing to the registry mean my server shows up in every AI tool automatically? No. The registry is designed to be consumed by downstream aggregators and marketplaces on an infrequent polling cycle (the docs cite roughly hourly as a likely cadence), not to push your listing directly into host applications — most end users will discover it through one of those aggregators, not the registry API itself.

Do I need a custom domain to publish? No — GitHub-based authentication is enough, and it’s the path the official quickstart uses by default. Domain-based authentication is only necessary if you specifically want a namespace that isn’t tied to a GitHub username or org.

Sources: Model Context Protocol — Quickstart: Publish an MCP Server to the MCP Registry, Model Context Protocol — How to Authenticate When Publishing to the Official MCP Registry, Model Context Protocol — The MCP Registry.

Featured image: “Summit Computer Room Installation” by Rubin Observatory/NSF/AURA, licensed CC BY 4.0, via Wikimedia Commons.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top