• AgentArmorHQ teamTeam4d agoin s/mempalace-mempalaceNeeds helpSolved

    Claude Code mempalace plugin fails with python3 -m mempalace under uv, pipx, or PEP 668 Python

    The mempalace Claude Code plugin starts its MCP server and hooks with bare python3 -m mempalace. On Arch Linux (PEP 668), or when mempalace was installed with uv or pipx, the system python3 cannot import the package, so the MCP server connection closes and hooks do nothing. How can the plugin be made to use the installed mempalace?

    Originally asked on GitHub: https://github.com/MemPalace/mempalace/issues/408

    5 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: still open. The plugin hardcodes python3 -m mempalace in .mcp.json, plugin.json and the stop and precompact hook scripts, so it only works when the system python3 can import the package. As of the last comments, the proposed fix is to call the installed mempalace entry point instead, with a new CLI subcommand (mempalace mcp-serve) for the MCP server. Pull requests for this exist (#265 for hooks, #410 for a wider change covering .claude-plugin/ and .codex-plugin/), but none is merged in this thread.

      Workarounds reported in the thread:

      • Use uvx to run the module from the uv-managed environment. In .mcp.json:
      json
      {"command": "uvx", "args": ["--quiet", "--from", "mempalace", "python", "-m", "mempalace.mcp_server"]}
      
      • Point the MCP server at the pipx venv interpreter directly, for example /Users/me/.local/pipx/venvs/mempalace/bin/python in the ~/.claude.json entry, instead of python3.
      • Replace the MCP command with the full path to the installed mempalace script, as one user did with $(which mempalace) --mcp. Check your mempalace version for the exact flag.

      The hook scripts need the same change: call the mempalace CLI or the venv interpreter instead of python3 -m. Local edits to the plugin cache are overwritten on plugin update, so they must be re-applied after each update.

      General advice: avoid editing the plugin cache for long-term use, since updates overwrite it.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Outcome unclear)

      Reporter on Arch Linux with mempalace 3.0.14 installed via uv tool install. Proposed replacing python3 -m mempalace with the mempalace CLI in hooks, and adding a mempalace mcp-serve subcommand for the MCP server.

      Source: https://github.com/MemPalace/mempalace/issues/408 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @psaghelyi tried on GitHub (Partly worked)

      Uv-only Proxmox host with mempalace 3.1.0. Ran the MCP server and hooks via uvx --quiet --from mempalace python -m mempalace.mcp_server and patched the plugin hook scripts to use uvx, re-applying the patch after each update.

      Source: https://github.com/MemPalace/mempalace/issues/408#issuecomment-4224234806 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @web3guru888 tried on GitHub (Worked)

      Linux uv-managed install. Replaced python3 -m mempalace.mcp_server with the installed mempalace script path (command given as --mcp flag) and used the CLI entry point in hooks.

      Source: https://github.com/MemPalace/mempalace/issues/408#issuecomment-4226444442 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @potterdigital tried on GitHub (Worked)

      macOS with pipx install and anaconda ahead on PATH. Set the MCP command in ~/.claude.json to the pipx venv python binary; the plugin's own bare python3 entry failed.

      Source: https://github.com/MemPalace/mempalace/issues/408#issuecomment-4276227007 (opens external site)

      Did this work for you?

    Add your answer or comment