Multiple MCP clients on one host kill each other's bridge: make config path configurable (+ --help must not take the lock) #23
Labels
No labels
agent:felinus
agent:human
agent:maximus
merge-train
bounced
merge-train
now
merge-train
queued
merge-train
riding
priority:p0
priority:p1
priority:p2
priority:p3
status:blocked
status:needs-review
status:wip
type:chore
type:docs
type:feat
type:fix
type:perf
type:refactor
type:test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/matrix-bridge#23
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Several Claude Code sessions on the same host (rpi5) each start
matrix-bridge-mcpas theirmatrixMCP server. They all share one Matrix device and store, so they keep knocking each other offline.~/.matrix-bridge/config.json(src/config.rs:84,config_path()). That means onestore_path(~/.matrix-bridge/store) and one device (rpi5-0o3kuj3y).src/mcp/single_instance.rs) lets a newcomer take over.bridge.lockand SIGTERM/SIGKILL the holder (single-instance: superseding stale bridge pid … (-TERM))./mcpreconnect in one session kills Matrix in the other. Seen repeatedly on 2026-11-21 with two parallel sessions.--helpstarts the bridge: at 18:33:50 UTC,/usr/local/bin/matrix-bridge-mcp --helpdidn't print help. It acquired the lock, superseded the other session's bridge (pid 1102367), then panicked on stdin close (JoinError::Cancelledin deadpool-runtime, thenconnection closed: initialize request). The installed binary may predate the clap CLI insrc/main.rs; not checked.Workaround in place
One session owns the bridge. The others relay posts to it via Claude Code cross-session messages, and their
matrixserver is turned off in/mcp.Proposed fix
--config <path>flag and aMATRIX_BRIDGE_CONFIGenv var, defaulting to~/.matrix-bridge/config.json.store_pathanddevice_name, without aHOME=wrapper hack.--help/--versionexit before taking the lock: a help call must never supersede a running bridge.--no-takeover) under which a newcomer exits with a clear error instead of killing the holder. This is useful for a second, accidental start.Per-device cost if (1) is used without (4)
Each additional device needs its own login (
credentials.json) and cross-signing via the SSSS recovery key (MATRIX_BRIDGE_RECOVERY_KEY,f2c643e). Otherwise peers see an unverified device undertrust_mode: tofu.🤖 Generated with Claude Code
https://claude.ai/code/session_01XMf4EH67dMry1FyMPoDPQ1