Repository navigation
Description
Overview
Add plugin lifecycle management to ToolHive. A plugin is the "bundle of primitives" unit pioneered by Claude Code — a directory declared by a .claude-plugin/plugin.json manifest bundling slash commands, subagents, Agent Skills, hooks, MCP server configs, and LSP servers. ToolHive will let users build a plugin directory into a reproducible, content-addressable OCI artifact, push it to any OCI registry, install it (registry name, OCI reference, or git:// URL), and list/info/uninstall it — reusing the registry, OCI, groups, and storage infrastructure that already serves skills and MCP servers.
Two-layer split. The design splits cleanly into:
- a client-agnostic distribution layer (build → OCI → push → catalog → pull → verify → inventory) — the bulk of the value, identical for every client; and
- a per-client materialization layer (turning a verified, pulled bundle into something a specific client loads), behind a stable
MaterializationAdapterseam.
v1 scope. Materialization is implemented for the two clients that consume the .claude-plugin/plugin.json family: Claude Code (in-place skills-directory install, full component set, no config mutation) and Codex (cache install + ~/.codex/config.toml mutation, reduced component set — warns on dropped commands/agents). Cursor/Copilot/Gemini adapters are future work behind the seam. Bundled MCP execution is deferred: v1 packages .mcp.json verbatim but does not run/proxy/rewrite it, records dev.toolhive.plugins.requires (resolves nothing), and reports declared MCP servers as "declared; NOT managed by ToolHive." The managed model via requires references is a follow-up RFC.
RFC: THV-0077 — under review as stacklok/rfcs#77.
Cross-repo release gates (the bottleneck)
Every toolhive-core change is a separate Go module that must be merged → tagged → released before toolhive / toolhive-registry-server can bump go.mod and build against it. Three core release gates:
- GATE-C1 — tag
toolhive-coreafter shared OCI primitives (Phase 0); bumptoolhive. - GATE-C2 — tag
toolhive-coreafteroci/plugins(Phase 1); bumptoolhive. Nothing in Phase 2 compiles before this. - GATE-C3 — tag
toolhive-coreafterregistry/types.Plugin(Phase 5a); bump bothtoolhiveandtoolhive-registry-serverto the same tag. ✅types.Pluginis in every core tag ≥ v0.0.28; toolhive is on v0.0.35, registry-server still needs its bump (tracked in chore(deps): update ghcr.io/stacklok/toolhive docker tag to v0.0.48 #819).
Gate ordering
P0 → GATE-C1 → P1 → GATE-C2 → P2 → P3 → P4
P5a → GATE-C3 → P5b / P5d (P5c parallel, no core dep)
Serialized spine: P0 → C1 → P1 → C2 → P2 → P3.
Phase checklist
- Phase 0 — extract artifact-agnostic OCI primitives (
oci/artifact) — [plugins] Phase 0: extract artifact-agnostic OCI primitives (THV-0077) toolhive-core#130 (implementation complete; PR incoming) - Phase 1 —
oci/pluginspackage — [plugins] Phase 1: oci/plugins package (THV-0077) toolhive-core#131 - Phase 2 —
pkg/plugins+pluginsvcbuild/push/validate + storage migration — [plugins] Phase 2: pkg/plugins + pluginsvc build/push/validate + storage migration (THV-0077) #5526 - Phase 3 — install/list/info/uninstall + MaterializationAdapter (Claude Code + Codex) + groups — [plugins] Phase 3: install/list/info/uninstall + MaterializationAdapter (Claude Code + Codex) + groups (THV-0077) #5527
- Phase 4 — REST API +
thv pluginCLI + content preview — [plugins] Phase 4: REST API + thv plugin CLI + content preview (THV-0077) #5528 - Phase 5a —
registry/types.Plugin— [plugins] Phase 5a: registry/types.Plugin (THV-0077) toolhive-core#132 - Phase 5b — registry provider methods +
/v0.1/x/dev.toolhive/pluginsroutes + PluginsClient — [plugins] Phase 5b: registry provider methods + catalog routes + PluginsClient (THV-0077) #5529 - Phase 5c —
marketplace generate+ signing (cosign/Referrers) — [plugins] Phase 5c: marketplace generate + signing (THV-0077) #5530 (parallel, no core dep) - Phase 5d — serve plugin catalog surfacing
types.Plugin— [plugins] Phase 5d: serve plugin catalog surfacing types.Plugin (THV-0077) toolhive-registry-server#819
Gaps found in review (2026-07-29)
Items the phase issues originally missed — now folded into #5529 / #819 or listed here for tracking:
PluginLookupis dead code.pluginsvc.WithPluginLookupis never wired inpkg/api/server.go(createDefaultPluginManager), sothv ai-plugin install <plain-name>always 404s. Needs alazyPluginLookupmirroringlazySkillLookup— covered in [plugins] Phase 5b: registry provider methods + catalog routes + PluginsClient (THV-0077) #5529.types.Registryhas noPluginsfield. The remote provider's side-effect discovery can't see plugins; either extend core (UpstreamRegistry.Plugins— mini GATE-C4) or fetch viaPluginsClientlike the cached provider does for skills. Decision recorded in [plugins] Phase 5b: registry provider methods + catalog routes + PluginsClient (THV-0077) #5529.- Registry-server go.mod is behind (toolhive-core v0.0.26, predates
types.Plugin) — bump is a prerequisite, covered in chore(deps): update ghcr.io/stacklok/toolhive docker tag to v0.0.48 #819. - No follow-up tracking for post-v1 scope (needs issues/RFCs, not blocking v1):
- Managed bundled-MCP execution via
dev.toolhive.plugins.requires— deferred to "a follow-up RFC" that doesn't exist yet. - Cursor/Copilot/Gemini materialization adapters behind the
MaterializationAdapterseam. - Kubernetes operator / vMCP story for plugins — Phases 2–4 are local-mode only.
- Managed bundled-MCP execution via
Activity
oci/plugins: Phase 1 OCI artifact package for plugins (THV-0077) (#136)
Add plugin core service, validation, and storage (Phase 2, THV-0077) (#…
Regenerate swagger for SupportsPlugins and Group.Plugins (Phase 3, TH…
Add plugin Phase 3 foundation: MaterializationAdapter, groups, client…
Add plugin install/list/info/uninstall, MaterializationAdapter implem…
Add plugins system architecture doc (Phase 3, THV-0077)
Regenerate swagger for SupportsPlugins and Group.Plugins (Phase 3, TH…
Refactor adapter seam to DematerializeRequest and ScopeSupport
Mutate Claude Code settings.json and marketplace.json on install
Use Codex marketplace.json and enabled plugin table for install
Preserve exec bit, add git name check, dedup gitresolver
3 remaining items
Add plugin install/list/info/uninstall, MaterializationAdapter implem…
Add plugins system architecture doc (Phase 3, THV-0077)
Regenerate swagger for SupportsPlugins and Group.Plugins (Phase 3, TH…
Refactor adapter seam to DematerializeRequest and ScopeSupport
Mutate Claude Code settings.json and marketplace.json on install
Use Codex marketplace.json and enabled plugin table for install
Preserve exec bit, add git name check, dedup gitresolver
Wrap name validation as 400 and clean up service lock nolint
Fix exec bit preservation, Codex TOCTOU, and error inspection
Add plugin install/list/info/uninstall + MaterializationAdapter (Phas…
feat(registry/types): add Plugin catalog type (Phase 5a, THV-0077)
Serve plugin catalog surfacing `types.Plugin` (Phase 5d) (#859)