You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(local-coord-mcp): per-window peer ID disambiguation via context field
Running 3 Claude Code windows on one box previously collided in peer IDs like
claude-7f3a / claude-b2c1 / claude-4e9d — readable but nothing said which
window was which. Adding an optional context disambiguator so peer_id becomes
claude-7f3a@007-lang / claude-b2c1@aerie / claude-4e9d@eclipse-repos.
Changes:
- ffi: Peer gains context [32]u8 + context_len. New exports
coord_set_context (alphanumeric/hyphen/underscore only, max 32, rollback
on bad input) and coord_read_peer_context. coord_register clears context
on slot reuse. Tests cover valid/invalid context + slot reuse cleanup +
coord_find_peer_by_suffix happy/miss paths.
- adapter: coord_register accepts optional `context` JSON field; on
validation failure the half-registered peer is deregistered so the caller
can retry cleanly. renderPeerId + extractSuffix helpers keep peer_id
format consistent across register/list/send. coord_list_peers returns
context as a separate field AND embedded in peer_id. coord_send target
parser handles both <kind>-<4hex> and <kind>-<4hex>@<context> forms.
- cartridge.ncl + cartridge.json: declare the new optional context field.
- mcp-bridge/lib/tools.js: surface context in coord_register input schema.
- version: 0.1.0 -> 0.2.0 (covers dispatch completion in 5d57daa + this).
Follows the supervision architecture in memory/project_coord_supervision_architecture.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: cartridges/local-coord-mcp/cartridge.json
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@
28
28
"tier": "Ayo",
29
29
"tools": [
30
30
{
31
-
"description": "Register this instance as a coordination peer. Returns a hybrid peer ID (e.g. claude-7f3a) and a session token for all subsequent calls.",
31
+
"description": "Register this instance as a coordination peer. Returns a peer ID and a session token for all subsequent calls. Optional `context` (alphanumeric + hyphen/underscore, max 32 bytes) disambiguates multiple windows of the same client_kind — peer_id becomes <kind>-<4hex>@<context>.",
Copy file name to clipboardExpand all lines: cartridges/local-coord-mcp/cartridge.ncl
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@
11
11
spdx="PMPL-1.0-or-later",
12
12
copyright="Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>",
13
13
name="local-coord-mcp",
14
-
version="0.1.0",
14
+
version="0.2.0",
15
15
description="Localhost multi-instance coordination — peer discovery, message passing, and task claiming for parallel AI sessions on the same machine",
16
16
domain="ai",
17
17
tier="Ayo",
@@ -35,7 +35,7 @@
35
35
tools= [
36
36
{
37
37
name="coord_register",
38
-
description="Register this instance as a coordination peer. Returns a hybrid peer ID (e.g. claude-7f3a) and a session token for all subsequent calls.",
38
+
description="Register this instance as a coordination peer. Returns a peer ID and a session token for all subsequent calls. Optional `context` (alphanumeric + hyphen/underscore, max 32 bytes) disambiguates multiple windows of the same client_kind — peer_id becomes <kind>-<4hex>@<context>.",
39
39
inputSchema= {
40
40
type="object",
41
41
properties= {
@@ -44,6 +44,10 @@
44
44
description="Client type: claude, gemini, copilot, or custom",
Copy file name to clipboardExpand all lines: mcp-bridge/lib/tools.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -267,11 +267,12 @@ function buildToolList() {
267
267
// Local coordination (localhost multi-instance AI coordination — local-coord-mcp cartridge)
268
268
tools.push({
269
269
name: "coord_register",
270
-
description: "Register this AI instance as a coordination peer on localhost. Returns a hybrid peer ID (e.g. claude-7f3a) and a session token for all subsequent calls. Loopback-only, never exposed beyond 127.0.0.1.",
270
+
description: "Register this AI instance as a coordination peer on localhost. Returns a peer ID and a session token for all subsequent calls. Loopback-only, never exposed beyond 127.0.0.1. Pass the optional `context` (repo name, tty tag, or similar) to disambiguate multiple windows of the same client_kind on one machine — peer_id becomes <kind>-<4hex>@<context> rather than just <kind>-<4hex>.",
271
271
inputSchema: {
272
272
type: "object",
273
273
properties: {
274
274
client_kind: {type: "string",enum: ["claude","gemini","copilot","custom"],description: "Client type prefix for the peer ID"},
275
+
context: {type: "string",description: "Optional disambiguator, e.g. current repo name. Alphanumeric + hyphen/underscore, max 32 bytes. Absent = old <kind>-<4hex> form.",maxLength: 32},
0 commit comments