modelcontextprotocol / modelcontextprotocol/registry

Allow usage of validators (and authentication checks) as a library

Open
#1,394 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
7.3k
Forks
994
Avg merge
4d 12h
Merged PRs (30d)
19

Description

Is your feature request related to a problem? Please describe.
The registry contains a bunch of validators that make sure only valid entries make it into the registry:

  1. Authentication: Ensure that you are authenticated to publish servers on a given namespace
  2. Validation that packages and remotes match the given authentication permissions

Unfortunately, it is very hard to reuse this outside of running a full-blown registry. I would want to avoid maintaining the logic myself, because there a quite a few specifics here.

My goal is to have a small tool with which I can, given a serverName and packages/remotes locally validate if the server is valid. This tooling could be used as part of a private subregistry that is not based on this repository.

Describe the solution you'd like
For validation, I guess it might be enough to move the internal/validators package to pkg. Mostly, I'm interested in the registries validation: https://github.com/modelcontextprotocol/registry/tree/main/internal/validators

For authentication, it seems like this logic is currently tied up in the individual auth handlers (e.g. https://github.com/modelcontextprotocol/registry/blob/535941a30e92c88b5bc83ef4e951d4183ccf19db/internal/api/handlers/v0/auth/github_oidc.go#L293), making this a broader refactoring, it seems.

Describe alternatives you've considered

  1. Using the validation command of the publisher: https://github.com/modelcontextprotocol/registry/blob/main/cmd/publisher/commands/validate.go – unfortunately, it uses the /validate part of a deployed registry, making this non-optimal
  2. Reimplementing the relevant logic: This will soon become outdated, as other package registries are added or authentication schemes change, so I'd ideally avoid that

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading internal/validators and the authentication logic in internal/api/handlers/v0/auth/github_oidc.go, then compare it with cmd/publisher/commands/validate.go. Trace which validation and authentication checks are tied to the deployed registry or individual handlers. Done means the relevant checks can be reused by an external tool or private subregistry without reimplementing registry logic.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, authentication, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.