Skip to content

feat: Add GitHub Container Registry (GHCR) support#442

Closed
rafaelescrich wants to merge 1 commit intomodelcontextprotocol:mainfrom
rafaelescrich:feature/add-ghcr-support
Closed

feat: Add GitHub Container Registry (GHCR) support#442
rafaelescrich wants to merge 1 commit intomodelcontextprotocol:mainfrom
rafaelescrich:feature/add-ghcr-support

Conversation

@rafaelescrich
Copy link

Description

This PR adds support for GitHub Container Registry (GHCR) as an OCI registry alongside Docker Hub, addressing issue #393.

Changes Made

  • ✅ Added GHCR (https://ghcr.io) as a supported OCI registry
  • ✅ Refactored OCI validator to use scalable registry configuration system
  • ✅ Replaced if-else chains with registry configuration map for better maintainability
  • ✅ Added support for both authenticated and anonymous access for GHCR public repositories
  • ✅ Updated official registry requirements documentation
  • ✅ Added comprehensive unit tests
  • ✅ Maintained 100% backward compatibility with existing Docker Hub packages

Testing

  • ✅ All existing tests pass
  • ✅ New unit tests for registry configuration system
  • ✅ Verified backward compatibility with existing packages
  • ✅ No linting errors

Breaking Changes

None - all existing packages continue to work unchanged.

Future Benefits

This refactoring makes it much easier to add additional OCI registries in the future (e.g., Quay.io, GCR, ACR) by simply adding entries to the registry configuration map.

Files Changed

  • pkg/model/constants.go - Added GHCR URL constant
  • internal/validators/registries/oci.go - Refactored with registry configuration system
  • internal/validators/registries/oci_test.go - Added comprehensive tests
  • docs/reference/server-json/official-registry-requirements.md - Updated supported registries

Closes #393

…alidator

- Add GHCR (https://ghcr.io) as a supported OCI registry alongside Docker Hub
- Refactor OCI validator to use scalable registry configuration system
- Replace if-else chains with registry configuration map for better maintainability
- Add RegistryConfig struct with auth functions, API URLs, and auth requirements
- Support both authenticated and anonymous access for GHCR public repositories
- Update official registry requirements documentation to include GHCR
- Add comprehensive unit tests for registry configuration system
- Maintain 100% backward compatibility with existing Docker Hub packages

This addresses issue modelcontextprotocol#393 and makes it easier to add additional OCI registries
in the future (e.g., Quay.io, GCR, ACR) by simply adding entries to the
registry configuration map.

Breaking changes: None - all existing packages continue to work unchanged.
@rdimitrov
Copy link
Member

Hey @rafaelescrich, thanks a lot for opening this PR! 🙌 It looks like there’s already a similar one though (#439) that was opened a few hours earlier so maybe we can align efforts there?

@rafaelescrich
Copy link
Author

Hey @rafaelescrich, thanks a lot for opening this PR! 🙌 It looks like there’s already a similar one though (#439) that was opened a few hours earlier so maybe we can align efforts there?

Sure, do you think I need to close this one?

@rdimitrov
Copy link
Member

Sure, do you think I need to close this one?

Let me do that 👍 And if you feel the other one missed anything you had in mind please feel free to comment/add it in. I think it’d be a great way to collaborate on this 👍

@rdimitrov rdimitrov closed this Sep 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ghrc as a docker registry

2 participants