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]. - Store
Ref - How the config an install writes names the store.
- Toggle
Opts - Options parsed from
mushroomdb enable [flags]ormushroomdb disable [flags].
Enums§
- Delivery
- Which door an install opens onto the graph.
- 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§
- AUTO_
ARG - The argument every written command uses in place of a store path when the store is to be resolved at run time.
- 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. - delivery_
for_ store - The door an install opened for the store at
db_dir. - detect_
mcp_ command - Decide how the MCP entry should invoke mushroomdb, from an explicit
--command(if any) 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. - render_
template - Substitute both template placeholders and keep only the delivery regions
this install wants.
bin_cmdis the pre-quoted shell form, so the templates carry{{BIN}}unquoted. - run_
disable - Turn an install off: remove the MCP entry, the three Claude Code hooks, the
git hook blocks and the Codex registration; leave the skill/rules file, the
store, and the
.gitignoreline untouched. Idempotent. - run_
disable_ with - Like
run_disable, with the external environment supplied by the caller (Codex removal shells out to thecodexCLI). - run_
enable - Turn a disabled install back on. Re-adds the MCP entry, the three Claude Code
hooks and the git hook blocks using the store a stashed entry named and the
command
installwould resolve right now — not a replay of whatdisabletook out, which may no longer be the fastest path to the published package. Idempotent, and a no-op (not an error) when the install is not disabled. - run_
enable_ with - Like
run_enable, with the server command and the external environment supplied by the caller. Tests use this to stay deterministic and offline. - 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).