Edit

Publish an MCP server on NuGet.org to the Official MCP Registry

In this quickstart, you publish your NuGet-based local MCP server to the Official MCP Registry.

The Official MCP Registry is an upstream data source for the MCP ecosystem. Other MCP registries, such as the GitHub MCP Registry, will soon use the Official MCP Registry as a source of MCP server listings.

Note

This guide focuses on publishing local MCP servers packaged with NuGet. The Official MCP Registry also supports remote MCP servers. While the server.json publishing process is similar for remote servers, their configuration requires a URL instead of a package manager reference. Remote servers can be implemented in any language. For an example, see an Azure Functions code sample for a .NET remote MCP server.

Prerequisites

Create a server.json manifest file

If you used the NuGet MCP server quickstart and mcpserver project template, you can skip this step.

  1. Navigate to your MCP server's source directory and create a new server.json file.

    cd path\my\project
    
    # create and open the server.json file
    code .mcp\server.json
    
    cd path/my/project
    
    # create and open the server.json file
    code .mcp/server.json
    
    cd path/my/project
    
    # create and open the server.json file
    code .mcp/server.json
    
  2. Use this content to start with and fill in the placeholders.

    {
      "$schema": "https://static.modelcontextprotocol.io/schemas/2025-10-17/server.schema.json",
      "name": "io.github.<your GitHub username here>/<your server name here>",
      "version": "<your package version here>",
      "description": "<your server description here>",
      "title": "<optional: human readable title>",
      "websiteUrl": "<optional: URL to a landing page or documentation site>",
      "packages": [
        {
          "registryType": "nuget",
          "identifier": "<your package ID here>",
          "version": "<your package version here>",
          "transport": {
            "type": "stdio"
          },
          "packageArguments": [],
          "environmentVariables": []
        }
      ],
      "repository": {
        "url": "https://github.com/<your GitHub username here>/<your repo name here>",
        "source": "github"
      }
    }
    
  3. Save the file.

Use this reference to understand more about the fields:

Property Example Purpose
name io.github.contoso/data-mcp Unique identifier for the MCP server, namespaced using reverse DNS names, case sensitive
version 0.1.0-beta Version of the MCP server listing
Consider using the same version as the MCP server package on NuGet.org
description Access Contoso data in your AI agent Description of your MCP server, up to 100 characters
title Contoso Data Optional: short human-readable title, up to 100 characters
websiteUrl https://contoso.com/docs/mcp Optional: URL to the server's homepage, documentation, or project website
packages identifier Contoso.Data.Mcp The ID of your MCP server package on NuGet.org
packages version 0.1.0-beta The version of your MCP server package on NuGet.org
repository url https://github.com/contoso/data-mcp Optional: GitHub repository URL

The name field has two parts, separated by a forward slash /. The first part is a namespace based off of a reverse DNS name. The authentication method you use in later steps will give you access to a specific namespace. For example, using GitHub-based authentication will give you access to io.github.<your GitHub username>/*. The second part, after the forward slash, is a custom identifier for your server within the namespace. Think of this much like a NuGet package ID. It should be unchanging and descriptive of your MCP server. Using your GitHub repository name is a reasonable option if you only have one MCP server published from that repository.

Update your package README

The Official MCP Registry verifies that your MCP server package references the name specified in your server.json file.

  1. If you haven't already, add a README.md to your MCP server NuGet package. See how to do this in your project file.

  2. Open the README.md used by your NuGet package.

    code path\to\README.md
    
    code path/to/README.md
    
    code path/to/README.md
    
  3. Add the following line to your README.md. Since it is enclosed in an HTML comment, it can be anywhere and won't be rendered.

    <!-- mcp-name: [name property from the server.json] -->
    

    Example:

    <!-- mcp-name: io.github.contoso/data-mcp -->
    
  4. Save the README.md file.

Publish your MCP server package to NuGet.org

Because your README.md now has an mcp-name declared in it, publish the latest package to NuGet.org.

  1. If needed, update your package version and the respective version strings in your server.json.

  2. Pack your project so the latest README.md version is contained.

    dotnet pack
    
  3. Push it to NuGet.org either via the website or using the CLI:

    dotnet push bin\Release\*.nupkg -k <API key here> -s https://api.nuget.org/v3/index.json
    
    dotnet push bin/Release/*.nupkg -k <API key here> -s https://api.nuget.org/v3/index.json
    
    dotnet push bin/Release/*.nupkg -k <API key here> -s https://api.nuget.org/v3/index.json
    

Wait for your package to become available

NuGet.org performs validations against your package before making it available so you must wait to publish your MCP server to the Official MCP Registry since it verifies that the package is accessible.

To wait for your package to become available, either continue to periodically refresh the package details page on NuGet.org until the validating message disappears, or use the following PowerShell script to poll for availability.

$id = "<your NuGet package ID here>".ToLowerInvariant()
$version = "<your NuGet package version here>".ToLowerInvariant()
$url = "https://api.nuget.org/v3-flatcontainer/$id/$version/readme"
$elapsed = 0; $interval = 10; $timeout = 300
Write-Host "Checking for package README of $id $version."
while ($true) {
    if ($elapsed -gt $timeout) {
        Write-Error "Package README is not available after $elapsed seconds. URL: $url"
        exit 1
    }
    try {
        Invoke-WebRequest -Uri $url -ErrorAction Stop | Out-Null
        Write-Host "Package README is now available."
        break
    } catch {
        Write-Host "Package README is not yet available. Elapsed time: $elapsed seconds."
        Start-Sleep -Seconds $interval; $elapsed += $interval
        continue
    }
}

This script can be leveraged in a CI/CD pipeline to ensure the next step (publishing to the Official MCP Registry) does not happen before the NuGet package is available.

Download the MCP Publisher tool

  1. Download the mcp-publisher-*.tar.gz file from the Official MCP Registry GitHub repository that matches your CPU architecture.

    See the full list of assets in the latest release.

  2. Extract the downloaded .tar.gz to the current directory.

    # For Windows x64
    tar xf 'mcp-publisher_windows_amd64.tar.gz'
    
    # For Windows ARM64
    tar xf 'mcp-publisher_windows_arm64.tar.gz'
    
    # For Linux x64
    tar xf 'mcp-publisher_linux_amd64.tar.gz'
    
    # For Linux ARM64
    tar xf 'mcp-publisher_linux_arm64.tar.gz'
    
    # For macOS x64
    tar xf 'mcp-publisher_darwin_amd64.tar.gz'
    
    # For macOS ARM64
    tar xf 'mcp-publisher_darwin_arm64.tar.gz'
    

Publish to the Official MCP Registry

The Official MCP Registry has different authentication mechanisms based on the namespace MCP server's name. In this guide, we are using a namespace based on GitHub (io.github.<your GitHub username>/*) so GitHub authentication must be used. See the registry documentation for information on other authentication modes, which unlock other namespaces.

  1. Log in using GitHub interactive authentication.

    .\mcp-publisher.exe login github
    
    ./mcp-publisher login github
    
    ./mcp-publisher login github
    

    Follow the instructions provided by the tool. You will provide a code to GitHub in your web browser to complete the flow.

    Once the flow is complete, you will be able to publish server.json files to the io.github.<your GitHub username>/* namespace.

  2. Publish your server.json file to the Official MCP Registry.

    .\mcp-publisher.exe publish path\to\.mcp\server.json
    
    ./mcp-publisher publish path/to/.mcp/server.json
    
    ./mcp-publisher publish path/to/.mcp/server.json
    
  3. When the command succeeds, you can verify that your MCP server is published by going to the registry home page and searching for your server name.