Skip to content

Add read-only Claude Code marketplace.json compatibility endpoint - #602

Open
danielle-mustillo wants to merge 3 commits into
agentregistry-dev:mainfrom
danielle-mustillo:marketplace
Open

Add read-only Claude Code marketplace.json compatibility endpoint#602
danielle-mustillo wants to merge 3 commits into
agentregistry-dev:mainfrom
danielle-mustillo:marketplace

Conversation

@danielle-mustillo

Copy link
Copy Markdown

Description

Adds a read-only GET /plugin-marketplace/marketplace.json endpoint that re-exposes AgentRegistry's Plugin resources in the Claude Code marketplace.json shape (code.claude.com/docs/en/plugin-marketplaces), so a bare URL to this endpoint can be registered directly with claude plugin marketplace add.

  • Motivation: let AgentRegistry serve as a source for claude plugin marketplace add without a separate export step.
  • What changed:
    • pkg/pluginmarketplace: translates a resolved v1alpha1.Plugin source pin into the marketplace.json url/git-subdir source forms (phase 1 — no github shorthand form, since AgentRegistry always resolves to a concrete repository URL).
    • internal/registry/api/handlers/pluginmarketplace: the HTTP handler, walking every Plugin row across all namespaces (paginated internally) and skipping any not-yet-resolved or unsupported-source entries so the document never contains a partial/broken entry. Honors the same optional per-kind RBAC ListFilter as the native Plugin read path.
    • internal/registry/config / router wiring: new PLUGIN_MARKETPLACE_COMPAT_ENABLED flag (default false) and optional path prefix, since the endpoint flattens every namespace into one unscoped catalogue.
    • docs/plugin-marketplace-compatibility.md: usage docs.

Change Type

/kind feature

Changelog

Add optional read-only Claude Code marketplace.json compatibility endpoint (`PLUGIN_MARKETPLACE_COMPAT_ENABLED`), letting `claude plugin marketplace add` point directly at an AgentRegistry Plugin catalogue.

Additional Notes

Off by default. The endpoint flattens every namespace into a single catalogue with no built-in scoping in OSS (nil ListFilter) — enable only where a full, unscoped Plugin catalogue is acceptable to expose (a public OSS registry, or behind a trusted gateway).

gen-openapi force-enabled MCPRegistryCompatEnabled for spec generation
but not PluginMarketplaceCompatEnabled, so the new marketplace.json
endpoint was silently missing from openapi.yaml and the generated TS
client. Enable it the same way and regenerate.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment on lines +66 to +71
PluginMarketplaceCompatEnabled bool `env:"PLUGIN_MARKETPLACE_COMPAT_ENABLED" envDefault:"false"`
// PluginMarketplaceCompatPathPrefix optionally mounts the compatibility API
// under a base prefix (e.g. "/plugins"); empty serves the standard
// "/plugin-marketplace/marketplace.json" path at the root. Any prefix set
// here must match the base URL registered with the consuming agent.
PluginMarketplaceCompatPathPrefix string `env:"PLUGIN_MARKETPLACE_COMPAT_PATH_PREFIX" envDefault:""`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: should it be AGENT_REGISTRY_PLUGIN_MARKETPLACE_*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants