MCP Registry Documentation

repository·main·Indexed 27 days ago

https://github.com/modelcontextprotocol/registry

A centralized directory for Model Context Protocol (MCP) servers that enables clients to discover and connect to available servers. Includes documentation for the mcp-publisher CLI tool, API specifications for registry data, server.json metadata formats, and deployment guides for local Kubernetes, Docker, and GCP production environments.

Tokens
39K
Snippets
92
Records
215
Agent score
92%

What's inside MCP Registry

  1. Understand the MCP Registry Moderation Policy

    main

    The MCP Registry (registry.modelcontextprotocol.io) follows a permissive moderation policy. It primarily removes illegal content, malware, spam, and non-functioning servers. Consumers should assume minimal-to-no moderation and treat scraped data accordingly, as the registry relies heavily on upstream registries (NPM, PyPI, Docker) for in-depth moderation.

    Key Moderation Principles:

    • What is removed: Illegal content (obscene content, copyright violations, hacking tools), malware, spam (mass-created servers, marketing-only servers, description stuffing), and non-functioning servers.
    • What is NOT removed: Low-quality or buggy servers, servers with security vulnerabilities, duplicate functionality, or adult content.
    • Removal mechanism: When a server is removed, its status is set to "deleted". The metadata remains accessible via the API unless the metadata itself is unlawful, in which case it may be erased.
  2. Understand MCP Registry Design Principles

    main

    The MCP Registry is designed around several core principles that govern how server metadata is managed and consumed. When building tools or integrations that interact with the registry, keep these constraints in mind:

    • Single Source of Truth: The registry is the authoritative repository for MCP server metadata. Server creators publish once, and all consumers (clients, aggregators) reference this canonical data.
    • Minimal Operational Burden: The system is designed for low maintenance. It delegates complexity to existing services (like GitHub for auth or npm/PyPI for packages) and assumes a reasonable downtime tolerance (up to 24h), meaning consumers should implement caching.
    • Vendor Neutrality: The registry does not provide ranking, curation, or quality judgments. Curation decisions are left to the individual MCP clients and aggregators.
    • Security Standards: Security relies on existing package registries for source code and uses DNS verification and OAuth for authentication. The registry implements rate limiting, field validation, and blacklisting to prevent abuse.
    • Reusable Shapes over Infrastructure: The registry focuses on interface compatibility using reusable API shapes (like OpenAPI and server.json) rather than mandating specific infrastructure. This allows the same formats to be used for private or internal registries.
    • Progressive Enhancement: The project follows an MVP-first approach, ensuring each milestone provides independent value without over-engineering for hypothetical future needs.
  3. Understand the MCP Registry Ecosystem

    main

    The MCP Registry acts as a metaregistry (similar to an app store) that provides MCP clients with a list of available MCP servers. It does not host code or binaries directly; instead, it hosts metadata that points to actual package registries like NPM, PyPI, or Docker Hub.

    The ecosystem consists of two primary components:

    1. The MCP registry spec: An API specification that allows anyone to implement a registry.
    2. The Official MCP registry: Hosted at registry.modelcontextprotocol.io, this is the authoritative repository for publicly-available MCP servers. It is community-owned and serves as the canonical source for server creators to publish their metadata.

    Clients typically pull from subregistries (e.g., Smithery, PulseMCP) which curate data from the Official Registry and add extra metadata like ratings or specialized annotations.

  4. Understand the server.json Format Specification

    main

    The server.json file is a standardized format used to describe Model Context Protocol (MCP) servers. It is used for registry publishing, client discovery, and package management.

    To ensure your server is compatible with the registry, you should follow the schema definitions and be aware that the official registry may impose additional restrictions beyond the base schema.

  5. Understand the MCP Registry Terms of Service

    main

    The MCP Registry is a centralized repository for community-developed MCP servers. It is currently in preview, meaning breaking changes or data resets may occur. Use of the Registry is governed by the laws of the State of California.

    Key User Obligations:

    • Age Requirement: You must be at least 18 years old.
    • Compliance: You must comply with all applicable laws, including those regarding data import/export, privacy, and intellectual property.
    • Account Accuracy: Any information provided during registration must be accurate and up-to-date.
    • Evaluation: The Registry is provided "as is" without warranties. Users are responsible for evaluating the safety and suitability of any MCP server before use.
  6. Access the Official MCP Registry API

    main

    The Official MCP Registry API is hosted at registry.modelcontextprotocol.io. It is based on the Generic Registry API but includes specific authentication and extension endpoints.

    Base URLs:

    • Production: https://registry.modelcontextprotocol.io
    • Staging: https://staging.registry.modelcontextprotocol.io

    For interactive exploration, use the Live API Docs or the OpenAPI Spec.

  7. Understand the Three-Tier Validation System

    main

    The MCP Registry uses a three-tier validation system to ensure server.json data quality. This system categorizes issues into structural, logical, and quality-based tiers:

    1. Schema Validation (Primary): Ensures compliance with the official server.json schema. It provides exhaustive coverage of structural and format violations, including exact schema rule locations and full JSON paths to constraints.
    2. Semantic Validation (Secondary): Validates business logic and registry-specific constraints that cannot be expressed in JSON Schema (e.g., registry reference validity, logical consistency, and variable usage).
    3. Linter Validation (Tertiary): Provides non-blocking warnings and suggestions regarding security, style guidelines, and naming conventions to help developers follow MCP best practices.
  8. Understand Schema File Management and Usage

    main

    The internal/validators/schemas/ directory contains JSON Schema files used for runtime validation of server.json files. These schemas are embedded into the Go binary using the go:embed directive to allow for offline validation.

    Important: Do not manually edit files in this directory. They are automatically synchronized from the modelcontextprotocol/static repository via a GitHub Actions workflow. Any manual changes will be overwritten by the sync process.

  9. Understand the Registry Extensions Specification

    main
    The Registry Extensions Specification provides a standardized way for registries to offer experimental or community-driven features without modifying the core API. This allows for experimentation, community innovation, and gradual adoption of new features without causing breaking changes to the stable core API.
  10. Publish an MCP server using the CLI

    main

    Developers can publish MCP server metadata to the registry using the CLI tool. The workflow involves validating a server.json file, completing a GitHub OAuth flow to obtain an access token, and submitting the metadata via a POST /servers request to the Registry API. The API may also perform DNS verification if custom namespaces are used.

    mcp publish server.json
  11. Edit an Entire Server (All Versions)

    main

    To apply changes across all versions of a server (e.g., marking an entire server as deleted or performing content scrubbing), you must iterate through all available versions.

    1. List Versions: Fetch the list of all versions for the server.
    2. Extract Versions: Use jq to pull the version strings into a text file.
    3. Apply Changes: Loop through the version list and send a PUT request to each version's endpoint. For example, to mark all versions as deleted, append ?status=deleted to the URL.
    export SERVER_NAME="com.example/my-server"
    ENCODED_SERVER_NAME=$(echo "$SERVER_NAME" | sed 's|/|%2F|g')
    
    # Step 1: List All Versions
    curl -s "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions" > all_versions.json
    
    # Step 2: Extract Versions
    jq -r '.servers[].server.version' all_versions.json > versions.txt
    
    # Step 3: Apply Changes to All Versions
    while read VERSION; do
      echo "Processing version: $VERSION"
      curl -X PUT "https://registry.modelcontextprotocol.io/v0/servers/${ENCODED_SERVER_NAME}/versions/${VERSION}?status=deleted" \
        -H "Authorization: Bearer ${REGISTRY_TOKEN}" \
        -H "Content-Type: application/json"
    done < versions.txt
    
    rm versions.txt all_versions.json
  12. Configure HTTP Authentication using Google KMS

    main

    You can use Google Cloud KMS for asymmetric signing. This requires the gcloud CLI and setting up Application Default Credentials (ADC).

    1. Create a keyring and an Ed25519 signing key in your project.
    2. Run mcp-publisher login http google-kms to retrieve the expected public key.
    3. Copy the 'Expected proof record' to a file named mcp-registry-auth and host it at /.well-known/mcp-registry-auth on your domain.
    4. Complete the login using the mcp-publisher login http google-kms command with the full resource path.
    MY_DOMAIN="example.com"
    MY_PROJECT="myproject"
    MY_KEYRING="mykeyring"
    MY_KEY_NAME="mykey"
    
    # Setup Google KMS
    gcloud auth login
    gcloud config set project "${MY_PROJECT}"
    gcloud kms keyrings create "${MY_KEYRING}" --location global
    gcloud kms keys create "${MY_KEY_NAME}" --default-algorithm=ec-sign-ed25519 --purpose=asymmetric-signing --keyring="${MY_KEYRING}" --location=global
    gcloud auth application-default login
    
    # Retrieve public key for mcp-registry-auth
    mcp-publisher login http google-kms --domain="${MY_DOMAIN}" --resource="projects/${MY_PROJECT}/locations/global/keyRings/${MY_KEYRING}/cryptoKeys/${MY_KEY_NAME}/cryptoKeyVersions/1"
    
    # Final login command
    mcp-publisher login http google-kms --domain="${MY_DOMAIN}" --resource="projects/${MY_PROJECT}/locations/global/keyRings/${MY_KEYRING}/cryptoKeys/${MY_KEY_NAME}/cryptoKeyVersions/1"