Quickstart: Publish an MCP Server to the MCP Registry
Written by punkpeye on .
- Prerequisites
- Step 1: Add verification information to the package
- Step 2: Publish the package
- Step 3: Install mcp-publisher
- Step 4: Create server.json
- Step 5: Authenticate with the MCP Registry
- Step 6: Publish to the MCP Registry
- Troubleshooting
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.
This document is a mirror of theofficial reference.
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 to follow along with this tutorial:
And edit package.json to reflect your information:
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:
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:
Then follow npm's publishing guide. In particular, you will probably need to run the following commands:
You 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:
Verify that mcp-publisher is correctly installed by running:
You should see output like:
Step 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:
Open the generated server.json file, and you should see contents like:
Edit the contents as necessary:
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:
You should see output like:
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:
Step 6: Publish to the MCP Registry
Finally, publish your server to the MCP Registry using the mcp-publisher publish command:
You should see output like:
You can verify that your server is published by searching for it using the MCP Registry API:
You should see your server's metadata in the search results JSON:
Troubleshooting
Error Message | Action |
"Registry validation failed for package" | Ensure your package includes the required validation information (e.g, |
"Invalid or expired Registry JWT token" | Re-authenticate by running |
"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 |
Written by punkpeye (@punkpeye)