Expand description
mushroomdb install / uninstall — wire the /mushroom skill, the MCP
server, the prompt hooks and the git hooks into an assistant.
§Design notes
- Idempotent: running install twice is a no-op (exit 0).
- Non-destructive: refuses to overwrite user files install didn’t create.
- Manifest-driven uninstall: tracks every file, key, hook, ignore line and external registration it wrote; removes exactly that.
- The only network access is the optional pre-warm, which is a best-effort warm cache and never fails the install.
§User-scope MCP config location (verified 2026-09-02 by live inspection)
Claude Code user-level MCP servers live in ~/.claude.json under the
top-level "mcpServers" key. This was verified empirically on a live
Claude Code install: ~/.claude/settings.json holds env/permissions/hooks
but NO mcpServers key. Cursor uses ~/.cursor/mcp.json (same format as
project-level .cursor/mcp.json). Codex keeps its own config and is
written through the codex CLI rather than by editing a file.
Structs§
- Externals
- The world outside the two directories install is given: the programs it
shells out to (
codex,npx) and how long it will wait for them. - Install
Opts - Options parsed from
mushroomdb install [flags]ormushroomdb uninstall [flags].
Enums§
- McpCommand
- How the MCP server entry (and the skill’s bootstrap commands) invoke mushroomdb.
- Platform
- Which assistant platform(s) to wire up.
- Scope
- Where the install lives: alongside one repository, or once for the user.
Constants§
- HOOK_
BEGIN - Opening marker of the region this module owns inside a git hook.
- HOOK_
END - Closing marker of that region.
Functions§
- classify_
mcp_ command - Pure classifier behind
detect_mcp_command: decide whether themushroomdbthat PATH resolves to is the executable now running. - default_
db - The store directory an install with no
--dbuses. - detect_
mcp_ command - Decide how the MCP entry should invoke mushroomdb, from the options and the real environment.
- git_
hook_ block - The block a git hook runs: one backgrounded, silenced
sync. - merge_
git_ hook - Put the sync block in
hook_file, creating the file (mode 755, with a#!/bin/shline) if it is not there. Returns whether anything changed. - remove_
git_ hook - Take the sync block back out of
hook_file. Returns whether anything changed. - run_
install - Install the /mushroom skill and MCP server entry for the resolved platforms.
- run_
install_ with - Like
run_install, but with the server command and the external environment supplied by the caller instead of detected. Tests use this to stay deterministic and offline;run_installis the real-environment wrapper. - run_
uninstall - Uninstall: remove exactly what install wrote. Reads the manifest.
- run_
uninstall_ with - Like
run_uninstall, with the external environment supplied by the caller (Codex removal shells out to thecodexCLI).