Skip to content

feat: Claude Code plugin for one-step install (hooks + MCP server) #187

@flound1129

Description

@flound1129

Summary

Currently, setting up MemPalace with Claude Code requires three separate manual steps:

  1. claude mcp add mempalace -- python -m mempalace.mcp_server
  2. Copy-paste hook JSON into settings.local.json for the save hook
  3. Copy-paste more hook JSON for the precompact hook

This could be a single plugin install:

claude plugin add mempalace@mempalace --marketplace github:milla-jovovich/mempalace

What this adds

  • Marketplace manifest (.claude-plugin/marketplace.json) so the repo can be used as a Claude Code plugin marketplace
  • Plugin (plugins/mempalace/) containing:
    • MCP server registration (19 tools, auto-configured)
    • Stop hook (auto-save every 15 messages)
    • PreCompact hook (emergency save before compaction)
  • Doc updates to README, hooks/README, and examples/mcp_setup.md showing the plugin method as recommended

Additional changes

The plugin hooks are rewritten in Python (the originals are bash). This fixes the shell injection issue noted in #110 — the SESSION_ID from JSON input was used unquoted in file paths, allowing potential path traversal. The Python versions sanitize with re.sub(r"[^a-zA-Z0-9_-]", "_", session_id).

The manual MCP and hook setup instructions remain as alternatives for non-Claude Code users.

Happy to open a PR if this looks good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions