Quickstart: Publish an MCP Server to the MCP Registry
What the quickstart leaves out: names, checks, and a local registry
The reference below is pinned to the attributed upstream commit. It walks one path: a TypeScript server published to npm, GitHub login, publish, query. Four things it does not cover: the name/login coupling, what validate leaves to publish, the query side, and how the same loop runs against a self-hosted registry without touching the public one. The rules below were checked against the official registry documentation at commit 5c3de5c (2026-11-04).
The name and the login decide each other. The server name’s prefix is a namespace, and the token from login covers only the namespaces that login proved. The entries below are authentication-mode shorthands, not complete flows — each also requires its proof step and key handling:
| Server name | The login that can publish it |
|---|---|
io.github.<your-user>/* | login github (device flow; no organization roles) |
io.github.<org>/* | login github with a classic PAT with read:org, organization Owner only |
com.example/* | login dns (DNS proof record placement) or login http (a key file at a well-known URL) |
io.modelcontextprotocol.anonymous/* | login none — only on a registry that enables anonymous auth |
DNS and HTTP logins involve registry tokens signed with your private key or KMS; the full flow, including DNS proof record placement, is in the official authentication documentation and on Authentication. Registry tokens are short-lived; the CLI stores the token, not the credentials, so log in and publish in the same job.
validate is a pre-check, not publish. mcp-publisher validate sends the file to the registry’s structural and semantic validation and needs no login. A file can pass validate and still be refused by publish, which additionally verifies your identity and the package’s ownership. For npm, the package must exist, be public, and carry your server name in the mcpName field of package.json; PyPI and NuGet packages carry the mcp-name: marker in their README, and the other package types prove ownership their own way — see the official package-types documentation and Package types. A passing validate is not a published result.
The query side. The final curl reads GET /v0.1/servers?search=. That is the current endpoint, not a permanent promise: the registry is in preview, and breaking changes or data resets may occur. Clients and downstream registries consume the same endpoint — see Registry aggregators.
The same loop against a self-hosted registry. The registry server is open source (modelcontextprotocol/registry), and the CLI can point at any instance: mcp-publisher login none --registry http://localhost:8080 writes the registry URL into the saved token file, and validate and publish then follow that URL automatically. A self-hosted instance differs from the public one where it matters:
| Public registry | Self-hosted (local test) | |
|---|---|---|
| URL | https://registry.modelcontextprotocol.io | your own; the dev setup serves http://localhost:8080 |
| Anonymous publish | Off | MCP_REGISTRY_ENABLE_ANONYMOUS_AUTH=true enables login none |
| Namespace | Must prove io.github.<user> etc. | Anonymous publishes land under io.modelcontextprotocol.anonymous/* |
| Database and tooling | Operated upstream | PostgreSQL plus Docker (make dev-compose), or a prebuilt image with MCP_REGISTRY_DATABASE_URL |
For remotes[] entries, the publisher must keep the service publicly accessible at the declared URL. What it checks at registration is that the URL is unique, with no other server having claimed it; identity is proven through the namespace, not through ownership of the remote URL. The official remote-servers documentation and Remote servers have the details.
This site has not run a self-hosted registry end to end in its own environment; the loop above is what the CLI source (login.go, publish.go, auth/none.go) and the registry’s own documentation describe, not a verified trace. What the local path buys you is a publish-and-query cycle with no public name, no public npm package, and no moderation queue — keep the differences straight when you move to the public registry. For automating the public loop, see GitHub Actions.
This tutorial will show you how to publish an MCP server written in TypeScript to the MCP Registry using the official mcp-publisher CLI tool.
Prerequisites
- Node.js — This tutorial assumes the MCP server is written in TypeScript.
- npm account — The MCP Registry only hosts metadata, not artifacts. Before publishing to the MCP Registry, we will publish the MCP server’s package to npm, so you will need an npm account.
- GitHub account — The MCP Registry supports multiple authentication methods. For simplicity, this tutorial will use GitHub-based authentication, so you will need a GitHub account.
If you do not have an MCP server written in TypeScript, you can copy the weather-server-typescript server from the modelcontextprotocol/quickstart-resources repository to follow along with this tutorial:
git clone --depth 1 [email protected]:modelcontextprotocol/quickstart-resources.git
cp -r quickstart-resources/weather-server-typescript .
rm -rf quickstart-resources
cd weather-server-typescriptAnd edit package.json to reflect your information:
{
- "name": "mcp-quickstart-ts",
- "version": "1.0.0",
+ "name": "@my-username/mcp-weather-server",
+ "version": "1.0.1",
"main": "index.js",
"license": "ISC",
- "description": "",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/my-username/mcp-weather-server.git"
+ },
+ "description": "An MCP server for weather information.",
"devDependencies": {
Step 1: Add verification information to the package
The MCP Registry verifies that a server’s underlying package matches its metadata. For npm packages, this requires adding an mcpName property to package.json:
{
"name": "@my-username/mcp-weather-server",
"version": "1.0.1",
+ "mcpName": "io.github.my-username/weather",
"main": "index.js",
The value of mcpName will be your server’s name in the MCP Registry.
Because we will be using GitHub-based authentication, mcpName must start with io.github.my-username/.
Step 2: Publish the package
The MCP Registry only hosts metadata, not artifacts, so we must publish the package to npm before publishing the server to the MCP Registry.
Ensure the distribution files are built:
# Navigate to project directory
cd weather-server-typescript
# Install dependencies
npm install
# Build the distribution files
npm run buildThen follow npm’s publishing guide. In particular, you will probably need to run the following commands:
# If necessary, authenticate to npm
npm adduser
# Publish the package
npm publish --access publicYou can verify your package is published by visiting its npm URL, such as https://www.npmjs.com/package/@my-username/mcp-weather-server.
Step 3: Install mcp-publisher
Install the mcp-publisher CLI tool using a pre-built binary or Homebrew:
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/$arch = if ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq "Arm64") { "arm64" } else { "amd64" }; Invoke-WebRequest -Uri "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_windows_$arch.tar.gz" -OutFile "mcp-publisher.tar.gz"; tar xf mcp-publisher.tar.gz mcp-publisher.exe; rm mcp-publisher.tar.gz
# Move mcp-publisher.exe to a directory in your PATHbrew install mcp-publisherVerify that mcp-publisher is correctly installed by running:
mcp-publisher --helpYou should see output like:
MCP Registry Publisher Tool
Usage:
mcp-publisher <command> [arguments]
Commands:
init Create a server.json file template
login Authenticate with the registry
logout Clear saved authentication
publish Publish server.json to the registryStep 4: Create server.json
The mcp-publisher init command can generate a server.json template file with some information derived from your project.
In your server project directory, run mcp-publisher init:
mcp-publisher initOpen the generated server.json file, and you should see contents like:
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.github.my-username/weather",
"description": "An MCP server for weather information.",
"repository": {
"url": "https://github.com/my-username/mcp-weather-server",
"source": "github"
},
"version": "1.0.0",
"packages": [
{
"registryType": "npm",
"identifier": "@my-username/mcp-weather-server",
"version": "1.0.0",
"transport": {
"type": "stdio"
},
"environmentVariables": [
{
"description": "Your API key for the service",
"isRequired": true,
"format": "string",
"isSecret": true,
"name": "YOUR_API_KEY"
}
]
}
]
}Edit the contents as necessary:
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.github.my-username/weather",
"description": "An MCP server for weather information.",
"repository": {
"url": "https://github.com/my-username/mcp-weather-server",
"source": "github"
},
- "version": "1.0.0",
+ "version": "1.0.1",
"packages": [
{
"registryType": "npm",
"identifier": "@my-username/mcp-weather-server",
- "version": "1.0.0",
+ "version": "1.0.1",
"transport": {
"type": "stdio"
- },
- "environmentVariables": [
- {
- "description": "Your API key for the service",
- "isRequired": true,
- "format": "string",
- "isSecret": true,
- "name": "YOUR_API_KEY"
- }
- ]
+ }
}
]
}
The name property in server.json must match the mcpName property in package.json.
Step 5: Authenticate with the MCP Registry
For this tutorial, we will authenticate with the MCP Registry using GitHub-based authentication.
Run the mcp-publisher login command to initiate authentication:
mcp-publisher login githubYou should see output like:
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...Visit the link, follow the prompts, and enter the authorization code that was printed in the terminal (e.g., ABCD-1234 in the above output). Once complete, go back to the terminal, and you should see output like:
Successfully authenticated!
✓ Successfully logged inStep 6: Publish to the MCP Registry
Finally, publish your server to the MCP Registry using the mcp-publisher publish command:
mcp-publisher publishYou should see output like:
Publishing to https://registry.modelcontextprotocol.io...
✓ Successfully published
✓ Server io.github.my-username/weather version 1.0.1You can verify that your server is published by searching for it using the MCP Registry API:
curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.my-username/weather"You should see your server’s metadata in the search results JSON:
{"servers":[{ ... "name":"io.github.my-username/weather" ... }]}Troubleshooting
| Error Message | Action |
|---|---|
| “Registry validation failed for package” | Ensure your package includes the required validation information (e.g, mcpName property in package.json). |
| “Invalid or expired Registry JWT token” | Re-authenticate by running mcp-publisher login github. |
| “You do not have permission to publish this server” | Your authentication method doesn’t match your server’s namespace format. With GitHub auth, your server name must start with io.github.your-username/. |
Next Steps
- Learn about support for other package types.
- Learn about support for remote servers.
- Learn how to use other authentication methods, such as DNS authentication which enables custom domains for server name prefixes.
- Learn how to automate publishing with GitHub Actions.