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:
.claude/skills/mycelium/SKILL.md — Claude Code skill with MCP tool docs and CLI reference
.claude/settings.json — UserPromptSubmit hook that injects MCP usage guidance
.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
Technical Approach
- Define an
AgentAdapter interface in cmd/setup.go (or a new internal/agents/ package) with methods like WriteConfig(mctlPath string) error and Name() string
- Implement
ClaudeAdapter encapsulating the current skill + settings.json + .mcp.json logic
- Implement
GenericAdapter that only writes .mcp.json
- Add
--agent flag to setupCmd (default "claude" for backwards compatibility)
- Route
runSetup through the selected adapter
- 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
Summary
mctl setupcurrently hardcodes Claude Code–specific artifacts (.claude/skills/,.claude/settings.jsonhooks,.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 setupwas implemented as a Claude Code integration command. It writes three files:.claude/skills/mycelium/SKILL.md— Claude Code skill with MCP tool docs and CLI reference.claude/settings.json—UserPromptSubmithook that injects MCP usage guidance.mcp.json— MCP server config (this one is already agent-agnostic)The
.mcp.jsonoutput 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,mergeMCPJSONcmd/setup_test.go— tests for the setup commandAcceptance Criteria
mctl setupwith no flags retains current behavior (generates all Claude Code files +.mcp.json)--agentflag (or similar) selects the target integration (e.g.,claude,cursor,generic)mctl setup --agent genericwrites only.mcp.json(the universal MCP config)Technical Approach
AgentAdapterinterface incmd/setup.go(or a newinternal/agents/package) with methods likeWriteConfig(mctlPath string) errorandName() stringClaudeAdapterencapsulating the current skill + settings.json +.mcp.jsonlogicGenericAdapterthat only writes.mcp.json--agentflag tosetupCmd(default"claude"for backwards compatibility)runSetupthrough the selected adapterDependencies
None — this is a refactor of existing functionality.
Out of Scope
cmd/serve.go) — it's already protocol-compliant