registry/tools/publisher
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Avinash Sridhar b6c141a721 Fixed linter errors and fixed tests
- Added error handling for JSON encoding in ServersHandler and ServersDetailHandler.
- Updated test cases to reflect changes in handler functions and improved mock expectations.
- Refactored server initialization to include ReadHeaderTimeout for better request handling.
- Modified GitHubDeviceAuth to accept context in ValidateToken and checkOrgMembership methods.
- Improved error messages in database import functions for better debugging.
- Updated memory and mongo database list functions to accept context and improved filtering logic.
- Enhanced logging in publisher tool for better visibility during execution.
- Cleaned up code formatting and comments for better readability and maintainability.
2025-05-27 19:13:51 -06:00
..
build.sh feat: add build script and update README for MCP Registry Publisher Tool 2025-05-05 14:38:45 -06:00
main.go Fixed linter errors and fixed tests 2025-05-27 19:13:51 -06:00
mcp.json docs: update readme and mcp.json with repository url (#76) 2025-05-26 08:35:21 -07:00
README.md fix(docs): update README to reflect automatic retrieval of GitHub Client ID and update example mscp json file 2025-05-26 07:10:07 -07:00

MCP Registry Publisher Tool

The MCP Registry Publisher Tool is designed to publish Model Context Protocol (MCP) server details to an MCP registry. This tool currently only handles GitHub authentication via device flow and manages the publishing process.

Building the Tool

You can build the publisher tool using the provided build script:

# Build for current platform
./build.sh

# Build for all supported platforms (optional)
./build.sh --all

The compiled binary will be placed in the bin directory.

Usage

# Basic usage
./bin/mcp-publisher --registry-url <REGISTRY_URL> --mcp-file <PATH_TO_MCP_FILE>

# Force a new login even if a token exists
./bin/mcp-publisher --registry-url <REGISTRY_URL> --mcp-file <PATH_TO_MCP_FILE> --login

Command-line Arguments

  • --registry-url: URL of the MCP registry (required)
  • --mcp-file: Path to the MCP configuration file (required)
  • --login: Force a new GitHub authentication even if a token already exists (overwrites existing token file)
  • --token: Use the provided token instead of GitHub authentication (bypasses the device flow)

Authentication

The tool uses GitHub device flow authentication:

  1. The tool automatically retrieves the GitHub Client ID from the registry's health endpoint
  2. When first run (or with --login flag), the tool will initiate the GitHub device flow
  3. You'll be provided with a URL and a code to enter
  4. After successful authentication, the tool saves the token locally for future use
  5. The token is sent in the HTTP Authorization header with the Bearer scheme

NOTE : Authentication is made on behalf of a OAuth App which you must authorize for respective resources (e.g org)

Example

  1. Prepare your mcp.json file with your server details:
{
  "name": "io.github.yourusername/your-repository",
  "description": "Your MCP server description",
  "version_detail": {
    "version": "1.0.0"
  },
  "packages": [
    {
      "registry_name": "npm",
      "name": "your-npm-package",
      "version": "1.0.0",
      "package_arguments": [
        {
          "description": "Specify services and permissions",
          "is_required": true,
          "format": "string",
          "value": "-s",
          "default": "-s",
          "type": "positional",
          "value_hint": "-s"
        }
      ],
      "environment_variables": [
        {
          "name": "API_KEY",
          "description": "API Key to access the server"
        }
      ]
    }
  ],
  "repository": {
    "url": "https://github.com/yourusername/your-repository",
    "source": "github"
  }
}
  1. Run the publisher tool:
./bin/mcp-publisher --registry-url "https://mcp-registry.example.com" --mcp-file "./mcp.json"
  1. Follow the authentication instructions in the terminal if prompted.

  2. Upon successful publication, you'll see a confirmation message.

Important Notes

  • The GitHub Client ID is automatically retrieved from the registry's health endpoint
  • The authentication token is saved in a file named .mcpregistry_token in the current directory
  • The tool requires an active internet connection to authenticate with GitHub and communicate with the registry
  • Make sure the repository and package mentioned in your mcp.json file exist and are accessible