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
mcpNamemust match your GitHub username exactly, including case sensitivity. If your GitHub username isS2thend, useio.github.S2thend/, notio.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
| Error | Cause | Fix |
|---|---|---|
cannot unmarshal string into Go struct field ServerJSON.repository | repository is a string instead of an object | Use object format: {"url": "...", "source": "github"} |
cannot unmarshal object into Go struct field ServerJSON.packages | packages is an object instead of an array | Use array format: "packages": [{ ... }] |
You do not have permission to publish this server | Case mismatch in username | Match 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
- OIDC Authentication - Use
github-oidcinstead ofgithubfor CI. Requiresid-token: writepermission. - Version Sync - Use
jqto update both.versionand.packages[0].versionfrom the git tag. - 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:
repositorymust be an object withurlandsourcefieldspackagesmust be an array of package objects- Each package needs
registryType,identifier,version, andtransport
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
mcpNametopackage.jsonmatching your GitHub username case exactly - Create
server.jsonwith correct schema (repository as object, packages as array) - Publish to npm first
- Use
mcp-publisher login github(local) orgithub-oidc(CI) - Run
mcp-publisher publish
References
-
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
-
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
-
Model Context Protocol. (n.d.). MCP Registry Publisher CLI. GitHub. Retrieved January 11, 2026, from https://github.com/modelcontextprotocol/registry
-
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