From 9f5b8f5fd691c91b504d290d45273bbe532eaf7e Mon Sep 17 00:00:00 2001 From: Pim Messelink <274674234+messelink@users.noreply.github.com> Date: Thu, 9 Apr 2026 06:39:44 +0000 Subject: [PATCH] fix: add mempalace-mcp console entry point for pipx/uv compatibility The MCP server config used `python -m mempalace.mcp_server` which fails when mempalace is installed via pipx or uv, since the system python cannot find the module in the isolated venv. Adding a `mempalace-mcp` console_scripts entry point ensures the MCP server works regardless of installation method (pip, pipx, uv, conda). Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude-plugin/.mcp.json | 6 +----- .claude-plugin/plugin.json | 6 +----- .codex-plugin/plugin.json | 6 +----- examples/mcp_setup.md | 4 ++-- mempalace/instructions/init.md | 2 +- mempalace/mcp_server.py | 2 +- pyproject.toml | 1 + 7 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.claude-plugin/.mcp.json b/.claude-plugin/.mcp.json index b1e81ed..dd7d55d 100644 --- a/.claude-plugin/.mcp.json +++ b/.claude-plugin/.mcp.json @@ -1,9 +1,5 @@ { "mempalace": { - "command": "python3", - "args": [ - "-m", - "mempalace.mcp_server" - ] + "command": "mempalace-mcp" } } diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index ba5759a..1504314 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -9,11 +9,7 @@ "commands": [], "mcpServers": { "mempalace": { - "command": "python3", - "args": [ - "-m", - "mempalace.mcp_server" - ] + "command": "mempalace-mcp" } }, "keywords": [ diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 9017d9b..7a2278a 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -21,11 +21,7 @@ "hooks": "./hooks.json", "mcpServers": { "mempalace": { - "command": "python3", - "args": [ - "-m", - "mempalace.mcp_server" - ] + "command": "mempalace-mcp" } }, "interface": { diff --git a/examples/mcp_setup.md b/examples/mcp_setup.md index 9bc26dd..2b7e1c3 100644 --- a/examples/mcp_setup.md +++ b/examples/mcp_setup.md @@ -5,13 +5,13 @@ Run the MCP server: ```bash -python -m mempalace.mcp_server +mempalace-mcp ``` Or add it to Claude Code: ```bash -claude mcp add mempalace -- python -m mempalace.mcp_server +claude mcp add mempalace -- mempalace-mcp ``` ## Available Tools diff --git a/mempalace/instructions/init.md b/mempalace/instructions/init.md index 40f0c20..570a525 100644 --- a/mempalace/instructions/init.md +++ b/mempalace/instructions/init.md @@ -49,7 +49,7 @@ If this fails, report the error and stop. Run the following command to register the MemPalace MCP server with Claude: - claude mcp add mempalace -- python -m mempalace.mcp_server + claude mcp add mempalace -- mempalace-mcp If this fails, report the error but continue to the next step (MCP configuration can be done manually later). diff --git a/mempalace/mcp_server.py b/mempalace/mcp_server.py index 06355c4..6fe8225 100644 --- a/mempalace/mcp_server.py +++ b/mempalace/mcp_server.py @@ -2,7 +2,7 @@ """ MemPalace MCP Server — read/write palace access for Claude Code ================================================================ -Install: claude mcp add mempalace -- python -m mempalace.mcp_server [--palace /path/to/palace] +Install: claude mcp add mempalace -- mempalace-mcp [--palace /path/to/palace] Tools (read): mempalace_status — total drawers, wing/room breakdown diff --git a/pyproject.toml b/pyproject.toml index 1f60a2d..1935c32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ Repository = "https://github.com/MemPalace/mempalace" [project.scripts] mempalace = "mempalace.cli:main" +mempalace-mcp = "mempalace.mcp_server:main" [project.entry-points."mempalace.backends"] chroma = "mempalace.backends.chroma:ChromaBackend"