Skip to content

Plugin assumes python3 -m mempalace — breaks on modern Linux (PEP 668) and with uv/pipx #408

@armujahid

Description

@armujahid

Plugin assumes python3 -m mempalace works — breaks on modern Linux (PEP 668) and with uv/pipx installs

Problem

The Claude Code plugin (.claude-plugin/) invokes mempalace via python3 -m mempalace... in three places:

Component File Invocation
MCP server .mcp.json, plugin.json python3 -m mempalace.mcp_server
Stop hook hooks/mempal-stop-hook.sh python3 -m mempalace hook run --hook stop --harness claude-code
PreCompact hook hooks/mempal-precompact-hook.sh python3 -m mempalace hook run --hook precompact --harness claude-code

This requires mempalace to be importable by the system python3, which fails when:

  1. Modern Linux distros with PEP 668 (Ubuntu 23.04+, Fedora 38+, Debian 12+, Arch) — pip install mempalace into the system Python is blocked with externally-managed-environment error
  2. uv tool install mempalace — installs the CLI on PATH in an isolated venv, but the system python3 can't import it
  3. pipx install mempalace — same as uv: CLI on PATH, package not importable by system Python
  4. Virtual environmentspython3 -m mempalace only works while the venv is active

The skill documentation (SKILL.md) also hardcodes pip install mempalace as the only install method.

Suggested fix

Replace python3 -m mempalace with the mempalace CLI entry point everywhere. The mempalace binary is placed on PATH by all installation methods (pip, uv tool install, pipx), so this works universally.

Hooks — straightforward replacement:

# Before
echo "$INPUT" | python3 -m mempalace hook run --hook stop --harness claude-code

# After
echo "$INPUT" | mempalace hook run --hook stop --harness claude-code

MCP server — needs a new CLI subcommand (e.g., mempalace mcp-serve) since mcp_server.py is currently only launchable as a module:

// Before
{"command": "python3", "args": ["-m", "mempalace.mcp_server"]}

// After
{"command": "mempalace", "args": ["mcp-serve"]}

SKILL.md — offer multiple install methods:

pip install mempalace       # in a venv
uv tool install mempalace   # recommended on modern Linux
pipx install mempalace      # alternative

Impact

Anyone installing the plugin from the marketplace on a modern Linux distro (PEP 668) will have a broken MCP server and non-functional hooks out of the box.

Environment

  • mempalace 3.0.14
  • Arch Linux (PEP 668 enforced)
  • Installed via uv tool install mempalace

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/installpip/uv/pipx/plugin install and packagingbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions