Skip to content

feat: fix plugin distribution as first-class alternate to npm+MCP #476

Closed

Description

@admarble

Problem

Sequant has three distribution mechanisms, but only one works end-to-end:

Path Status What works What's broken
npm install + sequant init ✅ Complete CLI, MCP server, skills, hooks, config —
Plugin install ⚠️ Partial Skills load, hooks load No MCP server, no config, no prerequisites check, stale marketplace build
MCP server only ✅ Complete sequant_status, sequant_run, sequant_logs No skills (by design)

The plugin should be a first-class alternate path where installing the plugin gives users both the interactive skills AND the MCP tools with zero additional configuration. Today, plugin users get skills but lose the MCP server, state configuration, and setup assurance that npm users get.

Acceptance Criteria

1. Plugin bundles MCP server (P0)

  • Plugin .mcp.json at plugin root launches the sequant MCP server automatically when the plugin is enabled
  • MCP server config uses npx sequant@latest serve (not tsx bin/cli.ts with hardcoded cwd)
  • Plugin users get sequant_status, sequant_run, sequant_logs tools and sequant://state, sequant://config resources without any manual MCP setup
  • Server starts via stdio transport (default, most compatible)

Target .mcp.json (at plugin root, NOT inside .claude-plugin/):

{
  "sequant": {
    "command": "npx",
    "args": ["-y", "sequant@latest", "serve"]
  }
}

Note: npx -y avoids install prompts. No cwd needed since the MCP server reads project context from the working directory Claude Code provides.

2. Plugin manifest follows best practices (P0)

  • plugin.json only contains metadata fields (name, description, version, author, homepage, repository, license, keywords) — NO component path overrides (Claude Code auto-discovers from default directories)
  • No "hooks" field in plugin.json — Claude Code v2.1+ auto-loads hooks/hooks.json; explicitly declaring it causes duplicate detection errors
  • Validate with claude plugin validate . passes clean

Current plugin.json is fine as-is — just verify no component path fields have been added.

3. Setup skill bridges the config gap (P1)

The /sequant:setup skill is the plugin user's equivalent of sequant init. It currently only creates worktrees + constitution. Extend it to also:

  • Check prerequisites: git, gh auth status, Node.js 20+ (for MCP server npx)
  • Create .sequant/ directory with default settings.json (quality loop config, default base branch)
  • Detect package manager and store PM_RUN token (used by /exec, /spec)
  • Detect dev server URL from stack (or prompt user) and store DEV_URL (used by /test)
  • Create .sequant-manifest.json with version + stack info
  • Print summary showing what was configured + which MCP tools are now available
  • Clearly indicate "You're all set — run /assess <issue> to start"

The setup skill should NOT duplicate sequant init logic — it should be lightweight and Claude-Code-native (shell commands, not TypeScript). It fills the same role for plugin users that init fills for npm users.

4. Marketplace build includes MCP config (P1)

  • scripts/prepare-marketplace.ts copies .mcp.json to output directory
  • Validate step checks .mcp.json exists in output
  • dist/marketplace/ output version matches package.json (currently stale at 1.17.0 vs 1.20.3)
  • Add npm run prepare:marketplace to release workflow so dist/ is never stale

5. Self-hosted marketplace.json is correct (P1)

Current .claude-plugin/marketplace.json uses:

{ "source": "./" }

This assumes the marketplace repo IS the plugin repo (monorepo style). Verify this is correct for the sequant-io/sequant GitHub repo layout, or update to:

{ "source": { "source": "github", "repo": "sequant-io/sequant", "ref": "v1.20.3" } }
  • Decide: is the sequant GitHub repo itself the marketplace, or is there a separate marketplace repo?
  • If self-hosted in same repo, "source": "./" is correct
  • If separate marketplace repo, use "source": { "source": "github", ... } format
  • Pin ref to release tags, not branches, for stability

6. Official marketplace submission (P2)

7. Plugin CI validates the full package (P1)

.github/workflows/plugin-install-test.yml currently has "does this command even exist?" guards around every claude plugin command. Now that the system is GA:

  • Remove fallback guards — claude plugin validate exists, use it directly
  • Add .mcp.json validation (exists, valid JSON, uses npx not hardcoded paths)
  • Add version sync check between package.json, plugin.json, marketplace.json, AND the dist/marketplace/ output
  • Test that claude --plugin-dir . loads the plugin successfully (loads skills, hooks, MCP config)

8. Hook scripts use portable paths (P2)

Current hooks hardcode /tmp/ for logs:

TIMING_LOG="/tmp/claude-timing.log"
QUALITY_LOG="/tmp/claude-quality.log"
  • Replace with ${TMPDIR:-/tmp} for macOS/Linux portability
  • Consider using ${CLAUDE_PLUGIN_DATA}/logs/ for persistent log storage that survives plugin updates
  • Ensure md5/md5sum fallback works (already has this, just verify)

9. Documentation covers both paths (P2)

  • README.md has two clear installation paths: npm (power users/CI) vs plugin (interactive users)
  • Plugin README (generated by prepare-marketplace.ts) includes: prerequisites, what you get (skills + MCP tools), quick start, and link to full docs
  • Each skill's SKILL.md works for both plugin users (${CLAUDE_PLUGIN_ROOT}) and npm users ($CLAUDE_PROJECT_DIR)

10. Remove dev-only .mcp.json from repo root (P0)

The current .mcp.json at repo root has a hardcoded path to /Users/tony/Projects/sequant and uses tsx bin/cli.ts (source, not dist). This is:

  • Developer-only (.gitignore already excludes it based on ?? status)

  • Conflicts with the plugin .mcp.json that needs to be at the root for distribution

  • Add .mcp.json to .gitignore (it's already untracked, make it explicit)

  • Create plugin-distribution .mcp.json at root that uses npx sequant@latest serve

  • sequant init should create .mcp.json in the TARGET project, not in the sequant repo itself

Design Notes

Plugin .mcp.json (for distribution)

{
  "sequant": {
    "command": "npx",
    "args": ["-y", "sequant@latest", "serve"]
  }
}

This works because:

  1. Claude Code starts MCP servers with the project directory as cwd
  2. npx -y auto-installs without prompting
  3. The MCP server reads .sequant/ config from cwd (project root)
  4. No hardcoded paths needed

User journey after plugin install

1. /plugin install sequant@sequant-io/sequant
   → Skills loaded (17 slash commands)
   → Hooks loaded (pre-tool, post-tool guardrails)  
   → MCP server auto-starts (sequant_status, sequant_run, sequant_logs)

2. /sequant:setup
   → Checks git, gh, node prerequisites
   → Creates .sequant/ config directory
   → Detects stack & package manager
   → Creates worktrees directory
   → Copies constitution template

3. /assess 123
   → Full workflow available

What stays npm-only

  • sequant run CLI (headless CI mode)
  • sequant init (full interactive setup wizard)
  • sequant doctor (diagnostics)
  • sequant status CLI
  • TypeScript library exports

These are power-user/CI features. Plugin users get the equivalent through MCP tools + skills.

Out of Scope

  • Converting the MCP server from npx to a bundled ${CLAUDE_PLUGIN_ROOT}/server.js — would require shipping compiled JS in the plugin, adding complexity. npx is the right pattern for command-based MCP servers (matches official plugins like context7).
  • Windows support for hook scripts — tracked separately if needed.
  • Auto-update mechanism — third-party marketplaces already handle this via autoUpdate: true in user settings.

References

Activity

  1. added
    enhancement
    roadmap
    on Mar 27, 2026
  2. admarble commented on Mar 27, 2026

    @admarble
    ContributorAuthor

    Spec Plan — #476 Plugin Distribution

    Scope Assessment

    ⚠️ SCOPE_WARNING — 10 AC groups, 34 items, 8+ directories. All items are coherent plugin infrastructure changes. Proceeding as single PR with quality loop enabled.

    AC Checklist

    • AC-1: Plugin .mcp.json bundles MCP server (npx -y sequant@latest serve)
    • AC-2: plugin.json metadata-only, no hooks field, passes claude plugin validate
    • AC-3: Setup skill checks prerequisites, creates .sequant/, detects PM/stack
    • AC-4: prepare-marketplace.ts copies .mcp.json, validates version sync
    • AC-5: marketplace.json uses correct source: "./", version synced
    • AC-6: Marketplace output matches external_plugins/<name>/ structure (P2)
    • AC-7: CI removes fallback guards, adds .mcp.json + version sync validation
    • AC-8: Hook scripts use ${TMPDIR:-/tmp} instead of hardcoded /tmp/
    • AC-9: README has dual installation paths (npm vs plugin) (P2)
    • AC-10: .mcp.json in .gitignore, distribution version at root

    Implementation Phases

    Phase 1: Foundation — .mcp.json + .gitignore (AC-1, AC-10)
    Phase 2: Marketplace — Build script + marketplace.json (AC-4, AC-5)
    Phase 3: Setup skill — Prerequisites, config, PM detection (AC-3)
    Phase 4: CI — Remove guards, add validations (AC-7)
    Phase 5: Hooks — Portable /tmp paths (AC-8)
    Phase 6: Docs — README + marketplace README (AC-9)

    Key Decisions

    1. .mcp.json format: {"mcpServers":{"sequant":{"command":"npx","args":["-y","sequant@latest","serve"]}}} — matches Claude Code plugin convention
    2. marketplace.json stays source: "./" — same-repo model is correct
    3. Setup skill is shell-only (no TypeScript dependency) — plugin users don't have npm package
    4. AC-6 (official submission) prepared but not submitted in this PR

    Non-Goals

    • Converting MCP server from npx to bundled JS
    • Windows hook support
    • Auto-update mechanism
  3. added a commit that references this issue on Mar 27, 2026
    6812d62
  4. admarble commented on Mar 27, 2026

    @admarble
    ContributorAuthor

    /fullsolve Complete

    Issue: #476
    Status: READY_FOR_MERGE
    PR: #477

    AC Coverage

    AC Description Status
    AC-1 Plugin .mcp.json bundles MCP server ✅ MET — templates/mcp.json with flat format, npx -y sequant@latest serve
    AC-2 Plugin manifest follows best practices ✅ MET — metadata-only, no component path overrides, no hooks field
    AC-3 Setup skill bridges config gap ✅ MET — v2.0: prereqs, .sequant/, PM detection, DEV_URL, manifest, summary
    AC-4 Marketplace build includes MCP config ✅ MET — copies .mcp.json, validates format, checks version sync
    AC-5 Self-hosted marketplace.json correct ✅ MET — source: "./" correct, version synced, description updated
    AC-6 Official marketplace submission ⚠️ PARTIAL — Output structure ready, submission is manual post-merge
    AC-7 Plugin CI validates full package ✅ MET — Removed guards, added .mcp.json + version sync + portable path checks
    AC-8 Hook scripts portable paths ✅ MET — All /tmp/ → ${TMPDIR:-/tmp}, hooks/templates in sync
    AC-9 Documentation covers both paths ✅ MET — README includes npm vs plugin paths, prerequisites, MCP tools
    AC-10 Remove dev-only .mcp.json ✅ MET — .gitignore added, distribution template created

    Coverage: 9/10 MET, 1 PARTIAL (AC-6 requires manual submission)

    Quality Metrics

    Metric Value
    Files changed 13
    Lines added +1,328
    Lines deleted -137
    Build ✅ Passed
    Lint ✅ Passed
    Tests ✅ 2334/2335 (1 pre-existing flaky timeout)
    Marketplace build ✅ Validated
    Hook syntax ✅ Passed

    Self-Evaluation

    • Verified working: Yes — marketplace build validates .mcp.json, hook syntax checks pass
    • Test coverage confidence: Medium — no new TypeScript runtime code, changes are infrastructure (JSON, YAML, shell, markdown)
    • Weakest part: AC-6 official submission prep — output matches expected structure but actual submission is untested
    • Honest assessment: Strong implementation for P0+P1 items. P2 items (AC-6 submission, AC-9 docs) are addressed at template level. The flat .mcp.json format was caught and fixed during QA review.

    Iterations

    Phase Iterations Status
    Spec 1/1 Complete
    Exec 1/1 Complete
    QA 1/2 Complete (caught .mcp.json format issue, fixed)

    Next Steps

    1. Review PR feat(plugin): first-class plugin distribution with MCP server (#476) #477
    2. After merge: submit to official marketplace via https://clau.de/plugin-directory-submission (AC-6)
    3. Test plugin install end-to-end: claude plugin install sequant@sequant-io/sequant
  5. admarble commented on Mar 27, 2026

    @admarble
    ContributorAuthor

    Documentation Generated

    File: docs/features/plugin-distribution.md

    Sections Included:

    • Prerequisites and setup (plugin install + /sequant:setup)
    • What you can do (skills, MCP tools)
    • What to expect (timing, behavior)
    • Plugin vs npm comparison table
    • Configuration reference (settings.json)
    • MCP server details
    • Log storage (CLAUDE_PLUGIN_DATA for plugin, TMPDIR for npm/CI)
    • Troubleshooting (4 common issues)

    Next Steps:

    1. Review generated documentation for accuracy
    2. Commit to main when ready

    Ready to merge!

  6. admarble commented on Aug 30, 2026

    @admarble
    ContributorAuthor

    AC-6 closed (2026-08-30): sequant submitted for plugin-directory review via the Console form (platform.claude.com/plugins/submit) — status "Submitted and pending review." Notes for the record: the process changed since this issue was filed — submissions now land in the community marketplace (anthropics/claude-plugins-community, nightly catalog sync, commit-SHA pinned with CI auto-bumps); the official marketplace is curated separately with no application process. Pre-submission: claude plugin validate . --strict passes clean (one marketplace-description warning found and fixed, ed116c2), and the submission copy went through an outsider clarity review (stale counts, jargon, and over-claims scrubbed; landing-page items filed as sequant-landing#125). Platform support claimed: Claude Code only — no Cowork test exists in the repo record.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementroadmap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions