Skip to content

Generalize mctl setup beyond Claude Code #26

@johnlanda

Description

@johnlanda

Summary

mctl setup currently hardcodes Claude Code–specific artifacts (.claude/skills/, .claude/settings.json hooks, .mcp.json). It should support other MCP-capable AI coding agents (e.g., Cursor, Windsurf, Copilot) so that Mycelium is useful regardless of which tool a developer uses.

Context

mctl setup was implemented as a Claude Code integration command. It writes three files:

  1. .claude/skills/mycelium/SKILL.md — Claude Code skill with MCP tool docs and CLI reference
  2. .claude/settings.jsonUserPromptSubmit hook that injects MCP usage guidance
  3. .mcp.json — MCP server config (this one is already agent-agnostic)

The .mcp.json output is already usable by any MCP client. The Claude Code–specific parts are the skill file and the settings.json hook.

Key files:

  • cmd/setup.go — all setup logic: writeSkillFile, mergeSettingsJSON, mergeMCPJSON
  • cmd/setup_test.go — tests for the setup command

Acceptance Criteria

  • mctl setup with no flags retains current behavior (generates all Claude Code files + .mcp.json)
  • A --agent flag (or similar) selects the target integration (e.g., claude, cursor, generic)
  • mctl setup --agent generic writes only .mcp.json (the universal MCP config)
  • Agent-specific adapters handle config paths and formats for each supported tool
  • Adapter interface is extensible so adding a new agent doesn't require modifying core setup logic
  • Existing tests still pass; new tests cover at least one non-Claude agent
  • Documentation (help text, README) reflects multi-agent support

Technical Approach

  1. Define an AgentAdapter interface in cmd/setup.go (or a new internal/agents/ package) with methods like WriteConfig(mctlPath string) error and Name() string
  2. Implement ClaudeAdapter encapsulating the current skill + settings.json + .mcp.json logic
  3. Implement GenericAdapter that only writes .mcp.json
  4. Add --agent flag to setupCmd (default "claude" for backwards compatibility)
  5. Route runSetup through the selected adapter
  6. Future adapters (Cursor, Windsurf, etc.) can be added as new implementations without changing the core command

Dependencies

None — this is a refactor of existing functionality.

Out of Scope

  • Implementing Cursor/Windsurf/Copilot adapters (this issue sets up the abstraction; specific agents can be separate issues)
  • Changing the MCP server itself (cmd/serve.go) — it's already protocol-compliant
  • Auto-detection of which agent is installed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions