Skip to content

Commit 772e2f4

Browse files
Update docs for new package registry contributions
Following PR #350, added documentation for new validation requirements: - Registry validators now require ownership verification metadata - Updated prerequisites to include validation mechanism requirement - Added implementation steps for registry validators - Included validation examples for existing registries (npm, pypi, nuget, oci, mcpb) Fixes #361 Co-authored-by: adam jones <[email protected]>
1 parent 8d28eed commit 772e2f4

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

‎docs/new_package_registry.md‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ For remote MCP servers, the package registry is not relevant. The MCP client con
1010

1111
For the sake of illustration, this document will use npm (the Node.js package manager) as an example at each step.
1212

13+
**Note:** As of PR #350, the registry now includes validation to prevent misattribution. New package registries must implement validation that requires specific metadata in packages to prove ownership of the server name.
14+
1315
## Prerequisites
1416

1517
The package registry must meet the following requirements:
@@ -21,6 +23,10 @@ The package registry must meet the following requirements:
2123
- For example, the MCP client can map the `server.json` metadata to an `npx` CLI execution, with args and environment variables populated via user input.
2224
1. The package registry supports anonymous package downloads. This allows the MCP client software to use the metadata found in the MCP registry to discover, download, and execute package-based local MCP servers with minimal user intervention.
2325
- `npx` by default connects to the public npmjs.com registry, allowing simple consumption of public npm packages.
26+
1. The package registry must support a validation mechanism to verify ownership of the server name. This prevents misattribution and ensures that only the actual package owner can reference their packages in server registrations.
27+
- npm requires an `mcpName` field in `package.json` that matches the server name being registered
28+
- PyPI requires a `mcp-name:` line in the package README/description
29+
- Each registry type must implement a validation mechanism accessible via public API
2430

2531
## Steps
2632

@@ -37,3 +43,21 @@ These steps are currently very brief because the MCP Registry service is not yet
3743
- Add the single-shot CLI command name to the `runtime_hint` example value array.
3844
- This duplicates the previous step and will be improved with [issue #159](https://github.com/modelcontextprotocol/registry/issues/159).
3945
- Add a sample, minimal `server.json` to the [`server.json` examples](server-json/examples.md).
46+
- **Implement a registry validator** (required for package validation):
47+
- Create a new validator file: `internal/validators/registries/yourregistry.go`
48+
- Implement the validation function following the pattern of existing validators (npm, pypi, nuget, oci, mcpb)
49+
- Add corresponding unit tests: `internal/validators/registries/yourregistry_test.go`
50+
- Register your validator in `internal/validators/validators.go`
51+
- See existing validators for reference on implementing ownership verification via your registry's API
52+
53+
## Validation Examples
54+
55+
For reference, here's how existing package registries implement validation:
56+
57+
- **npm**: Checks for an `mcpName` field in `package.json` that matches the server name
58+
- **PyPI**: Searches for `mcp-name: server-name` format in the package description/README content
59+
- **NuGet**: Looks for `mcp-name: server-name` format in the package README file
60+
- **Docker/OCI**: Validates a Docker image label `io.modelcontextprotocol.server.name` in the image manifest
61+
- **MCPB**: Ensures the package URL contains "mcp" somewhere in the identifier (URL or filename)
62+
63+
Each validator fetches metadata from the respective registry's public API and verifies that the required ownership proof exists.

0 commit comments

Comments
 (0)