Skip to content

Commit 47018e5

Browse files
jpheinclaude
andauthored
fix(opencode): disable repo-level MCP entry by default + venv-python fallback (#108)
* fix(opencode): use .venv/bin/python in repo MCP config so spawn doesn't fail Upstream PR MemPalace#1567's `.opencode/opencode.json` uses bare `python -m mempalace.mcp_server`. That only works if mempalace is installed in the python that resolves on PATH — which on JP's box (and any uv-managed clone) it isn't, because mempalace lives in the editable `./.venv/` and PATH-resolution finds system python instead. Result: opencode launched from the repo root tries to spawn the local MCP server, fails with `MCP error -32000: Connection closed` + a ModuleNotFoundError on mempalace, and logs ERROR every session. The user-level `~/.config/opencode/opencode.jsonc` wrapper still works in parallel, but the repo-level entry is noisy and broken. Switch to `.venv/bin/python` — relative path, resolves against the opencode cwd (the repo root), works for every contributor who ran `uv sync` (which the README already tells them to do). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(opencode): disable repo-level MCP entry by default — avoid double-server A user-level `~/.config/opencode/opencode.jsonc` with a daemon-routed wrapper is the canonical way to wire mempalace on this fork. When the repo-level `.opencode/opencode.json` is ALSO enabled and points at a local `mempalace.mcp_server` spawn, opencode connects to BOTH: - user wrapper → palace-daemon at disks.jphe.in:8085 (309K production drawers, healthy) - repo subprocess → `~/.mempalace/palace` (legacy katana store, 24K drawers, HNSW capacity divergence — 63% invisible to vector search) Result: opencode's UI surfaces 'HNSW capacity divergence' + 'routing to BM25 fallback' INFO-stderr lines that look like errors, and any mempalace_* tool call non-deterministically lands on whichever server opencode picked. Flip `enabled` to false on the repo entry so the user-level wrapper is the sole source of truth. Contributors who want a local-only spawn (no daemon set up) flip back to true; the previous commit already pointed the spawn at `.venv/bin/python` so it works for them when uv-managed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6ca0670 commit 47018e5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.opencode/opencode.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"$schema": "https://opencode.ai/config.json",
3+
"$comment": "Repo-level MCP entry disabled by default to avoid spawning a second mempalace-mcp against the legacy local palace when a user-level (daemon-routed) entry is also configured. Contributors without a daemon can flip enabled=true; their python with mempalace installed will be picked up from .venv/bin/python.",
34
"mcp": {
45
"mempalace": {
56
"type": "local",
6-
"command": ["python", "-m", "mempalace.mcp_server"],
7-
"enabled": true
7+
"command": [".venv/bin/python", "-m", "mempalace.mcp_server"],
8+
"enabled": false
89
}
910
}
1011
}

0 commit comments

Comments
 (0)