From ace897fe74f46c15012534836336cb866c2818e5 Mon Sep 17 00:00:00 2001 From: Oliver Mee <102673257+oliver-mee@users.noreply.github.com> Date: Fri, 18 Sep 2026 13:26:10 +0800 Subject: [PATCH] fix(codex): use persistent CLI for MCP server Signed-off-by: Oliver Mee <102673257+oliver-mee@users.noreply.github.com> --- plugins/codex/.mcp.json | 8 ++------ plugins/codex/README.md | 4 ++++ scripts/validate_codex_plugin.py | 6 ++++-- tests/test_codex_plugin_package.py | 8 ++++++++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/plugins/codex/.mcp.json b/plugins/codex/.mcp.json index 0b8929fba..7279ad2d3 100644 --- a/plugins/codex/.mcp.json +++ b/plugins/codex/.mcp.json @@ -1,12 +1,8 @@ { "mcpServers": { "basic-memory": { - "command": "uvx", - "args": [ - "--prerelease=allow", - "basic-memory", - "mcp" - ] + "command": "basic-memory", + "args": ["mcp"] } } } diff --git a/plugins/codex/README.md b/plugins/codex/README.md index f78f6500c..f9ae3f724 100644 --- a/plugins/codex/README.md +++ b/plugins/codex/README.md @@ -87,6 +87,10 @@ ref. All refs are updated together with ## Requirements +- **[Basic Memory](https://docs.basicmemory.com/)** - required: install it with + `uv tool install basic-memory`. The persistent `basic-memory` executable runs + the MCP server, so an active Codex session does not depend on uv's removable + package cache. - **[uv](https://docs.astral.sh/uv/)** — required: the hooks are PEP 723 scripts executed via `uv run --script`, which installs their pinned Basic Memory revision. Install per platform: diff --git a/scripts/validate_codex_plugin.py b/scripts/validate_codex_plugin.py index 9195bc1ca..e7903e596 100755 --- a/scripts/validate_codex_plugin.py +++ b/scripts/validate_codex_plugin.py @@ -173,8 +173,10 @@ def validate_plugin(plugin_dir: Path) -> None: basic_memory = servers["basic-memory"] if not isinstance(basic_memory, dict): raise SystemExit(".mcp.json: basic-memory server must be an object") - if basic_memory.get("command") not in {"uvx", "basic-memory", "bm"}: - raise SystemExit(".mcp.json: basic-memory server uses an unexpected command") + if basic_memory.get("command") != "basic-memory": + raise SystemExit(".mcp.json: basic-memory server must use the persistent CLI") + if basic_memory.get("args") != ["mcp"]: + raise SystemExit(".mcp.json: basic-memory server must pass only the mcp command") # --- Hooks --- hooks_json = read_json(plugin_dir / "hooks" / "hooks.json") diff --git a/tests/test_codex_plugin_package.py b/tests/test_codex_plugin_package.py index d68df79c5..57360d69e 100644 --- a/tests/test_codex_plugin_package.py +++ b/tests/test_codex_plugin_package.py @@ -27,6 +27,14 @@ def test_codex_plugin_mcp_config_is_tracked_and_not_ignored() -> None: assert tracked.returncode == 0, tracked.stderr +def test_codex_plugin_mcp_uses_persistent_cli() -> None: + repo_root = Path(__file__).resolve().parents[1] + config = json.loads((repo_root / "plugins/codex/.mcp.json").read_text(encoding="utf-8")) + + server = config["mcpServers"]["basic-memory"] + assert server == {"command": "basic-memory", "args": ["mcp"]} + + def test_codex_plugin_hooks_are_zero_logic_uv_scripts() -> None: # The plugin ships configuration plus launchers only: the hook bodies live # in the basic-memory package behind `bm hook` (SPEC-55); each launcher is