Speakeasy Logo
Skip to Content

Publish your Gram server on the MCP Registry

The official Model Context Protocol (MCP) Registry  is an open catalog and API for publicly available MCP servers. It’s like an app store for MCP servers – it provides MCP clients with a list of MCP servers. By publishing your Gram-hosted MCP server to the registry, you make it discoverable.

The registry is owned by the MCP open-source community and backed by major trusted contributors to the MCP ecosystem, such as Anthropic, GitHub, and Microsoft.

This guide shows you how to prepare your Gram MCP server and publish it to the MCP Registry. You’ll learn how to configure your server details, handle DNS authentication, and verify your publication.

To publish your MCP server to the MCP registry, you need to make your MCP server available using one of the following three methods:

  • Package deployment: Publish your MCP server as a package, such as an npm package, which can be run locally by MCP clients.
  • Remote deployment: Host your MCP server as a web service that clients connect to.
  • Hybrid deployment: Offer both a package and a remote deployment option.

This guide uses remote deployment.

:::note[Manual publishing] Future versions of Gram will automate this publishing process. These instructions are for manual publishing until that release, or if you prefer manual control. :::

Prerequisites

To follow the tutorial, you need:

  • A Gram Pro or Enterprise account : You need a custom domain to publish your MCP server to the registry.
  • A Gram-hosted MCP server: If you don’t have one, learn to create one in our quickstart guide.
  • Domain management access for a custom domain: You need to create a DNS TXT record.
  • A GitHub repository: This is where you need to store your MCP server source code.

Create a custom MCP server domain

MCP servers can be hosted through a custom subdomain such as {your_sub_domain}/mcp.

Contact Gram support to enable a custom subdomain for your account, then go to Settings in the Gram dashboard to complete the setup.

Create two DNS entries:

  • A CNAME record pointing to cname.getgram.ai
  • A TXT record named _gram.{your_sub_domain} with the value gram-domain-verify={your_sub_domain},{gram_organization_id}

Once you’ve created both DNS records, contact Gram to complete the domain linking process.

:::tip[NOTE] You can contact Gram using the chat support widget at the bottom right of your Gram dashboard . :::

Set up your MCP server

In the Gram dashboard , go to MCP in the sidebar and select your MCP server.

Click the Enable button at the top right of the page to allow the server to receive requests.

Under Hosted URL, you should see your custom domain.

Under Visibility, set the server to Public.

GramMCP server details page

Install the MCP publisher CLI

The MCP Registry uses an official CLI tool for publishing servers. The recommended way to install it is using Homebrew :

Create an MCP publisher server configuration file

Navigate to the local directory of your MCP server’s API. Make sure the Open API document is present in the root directory, then create a template server.json file using the MCP publisher CLI:

This creates a server.json file in your repository with auto-detected server details:

The name field determines authentication requirements. The com.yourcompany/* format requires DNS or HTTP domain verification.

For remote deployment, you need to add the remotes field to the server.json file:

In this code:

  • The url field is the URL of your MCP server.
  • The type field specifies the transport protocol, which can be either sse (server-sent events) or streamable-http.
  • The authentication field specifies the authentication method.
  • The optional header field configures the headers that clients should send to when connecting to the MCP server, which in this case includes the API key.

Verify your custom domain with DNS authentication

You need to verify that you own the domain before you can publish your MCP server to the MCP Registry.

First, create a private key for authentication in your server’s local directory:

Next, get the public key for the DNS record:

This command extracts the public key from your private key file, encodes it in Base64 format, and formats it as a DNS TXT record for MCP Registry verification.

The output shows what you need to add to your domain’s DNS configuration. For example:

Copy the value in quotation marks.

Add the DNS TXT record

In your domain registrar’s DNS management interface, do the following:

  • Create a new TXT record.
  • Set the host/name to your root domain using the @ symbol.
  • Set the value to the output you copied from the previous command.
  • Save the record and wait for DNS propagation (usually between five and 15 minutes).

You can check the status of the DNS propagation by using the Linux dig command and searching for the TXT record value:

When checking DNS propagation for your newly added TXT record, you initially see status: NXDOMAIN in your dig output, which means that the DNS resolver cannot find the domain or the specific record type you’re querying. Once DNS propagation is complete, the status changes to status: NOERROR.

In namecheap , a popular domain hosting provider, you can add a new TXT record in the Advanced DNS settings page:

Namecheap - adding a DNS TXT record

Authenticate with the registry

Once DNS propagation is complete, authenticate with the MCP Registry using DNS-based domain verification:

This command authenticates you with the MCP Registry by extracting the private key from your key.pem file and using it to prove domain ownership through the DNS TXT record you created.

Publish your server to the MCP Registry

Before publishing, ensure that you don’t commit sensitive files, such as the private key, to your repository:

Run the following command to publish your server to the MCP Registry:

You should see the following output:

Verify your publication

To check that your server appears in the registry, search for it using the curl command with your MCP server name:

You should see your server metadata returned in the JSON response:

Your MCP server can now be discovered and installed by MCP clients.

Next steps

You have now published your Gram MCP server on the official MCP Registry, making it discoverable to developers worldwide. To maintain and further improve your MCP server, you can:

Last updated on