Peer communication daemon and MCP sidecar for blemees agents
Project description
blemees-peer (blemees-peerd)
Peer communication daemon and MCP sidecar for blemees agents.
blemees-peerd is the peer channel for blemees
agents — Claude Code, Codex, or any MCP-speaking client. While
blemees-agentd is the
operator channel (humans drive agents through it), blemees-peerd lets
agents talk to each other: DMs, topics, replay, presence.
The two daemons are fully decoupled. blemees-peerd works whether or not
blemees-agentd is installed; blemees-agentd works whether or not blemees-peerd is
installed.
Status: v0.1 alpha. Spec at
docs/SPEC.md.
Install
pip install blemees-peer
Two CLI entry points are installed:
blemees-peerd— the daemonblemees-peer-mcp— the stdio MCP sidecar your agent talks to
Quickstart
1. Run the daemon
blemees-peerd
By default it listens on $XDG_RUNTIME_DIR/blemees/peerd.sock
(falling back to /tmp/blemees-peerd-<uid>.sock). It runs in the
foreground; supervise it with whatever you use for blemees-agentd
(launchd, systemd --user, tmux, etc.).
2. Wire the sidecar into your agent
Add blemees-peer-mcp to your agent's MCP config. For Claude Code
(~/.config/claude/mcp.json):
{
"mcpServers": {
"peer": {
"command": "blemees-peer-mcp"
}
}
}
For Codex (~/.codex/config.toml):
[mcp_servers.peer]
command = "blemees-peer-mcp"
3. Use it
Once an agent session is live, the sidecar exposes these tools:
| Tool | Effect |
|---|---|
peer_send(to, body, reply_to?) |
Send a DM |
peer_publish(topic, body) |
Publish to a topic |
peer_subscribe(topic, replay?) |
Subscribe to a topic |
peer_unsubscribe(topic) |
Drop a topic subscription |
peer_inbox(limit?) |
Drain queued peer.message notifications |
peer_await(timeout?) |
Block until a new message arrives |
peer_set_alias(alias) |
Claim a session alias (e.g. "architect") |
peer_set_dm_filter(patterns) |
Restrict inbound DMs by from pattern |
peer_list_peers() |
List currently-connected peers |
peer_list_topics() |
List topics with subscribers |
peer_history(address, since?, limit?) |
Replay persisted messages |
Addresses
Three forms; full grammar in docs/SPEC.md.
home:~/some/project— broadcast to every session at that pathhome:~/some/project#sess_abc— direct to one session by sidhome:~/some/project#architect— direct to one session by aliastopic:build-events— fan out to all subscribers
The session home is the agent's working directory at session spawn,
normalized: paths under $HOME are rewritten to start with ~/;
paths outside home stay absolute. Two sessions sharing a home are
co-located peers and a DM to the bare home address reaches both.
Identity from the environment
The MCP sidecar reads three opportunistic env vars at startup, all
exported by harnesses like blemees-agentd:
BLEMEES_AGENT_HOME— the agent's session home (already normalized)BLEMEES_AGENT_SID— the agent's session ID (sess_+ 16 chars)BLEMEES_AGENT_ALIAS— an alias to claim once at startup (e.g.architect,tester)
Any of them can be missing. With nothing set, the sidecar falls back
to os.getcwd(), mints a fresh sid, and starts with no alias.
Setting them lets a harness give every spawned agent a stable
identity that flows transitively into the MCP subprocess via env
inheritance — so peers can address the new session by role from the
moment it joins, without the agent itself having to figure out and
claim its own identity.
Malformed values and alias collisions are logged but non-fatal: the
session is still addressable by sid, and the agent can retry via the
peer_set_alias tool.
Develop
pip install -e '.[dev]'
pytest
ruff check .
Licence
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blemees_peer-0.1.0.tar.gz.
File metadata
- Download URL: blemees_peer-0.1.0.tar.gz
- Upload date:
- Size: 44.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd301f295672572a3732a458303ff2bb2e90f6f9377daad1493aa98efb3432ac
|
|
| MD5 |
18a9f100bf43405d24e378e4e256db09
|
|
| BLAKE2b-256 |
43a858966bd773173e523295d79559958b93b2d3176c2dc2b5816aab44236a69
|
Provenance
The following attestation bundles were made for blemees_peer-0.1.0.tar.gz:
Publisher:
release.yml on blemees/blemees-peer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blemees_peer-0.1.0.tar.gz -
Subject digest:
cd301f295672572a3732a458303ff2bb2e90f6f9377daad1493aa98efb3432ac - Sigstore transparency entry: 1445493636
- Sigstore integration time:
-
Permalink:
blemees/blemees-peer@0a1091833fc6074d1e6d3bbd2de2448d7566ef77 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/blemees
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0a1091833fc6074d1e6d3bbd2de2448d7566ef77 -
Trigger Event:
push
-
Statement type:
File details
Details for the file blemees_peer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: blemees_peer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c059ece5c5d854c484873cf10f1a8e89ce80863ec3c644950da18966ca6cfe6e
|
|
| MD5 |
617f55ba75d20c13af6b9f92ebd2929a
|
|
| BLAKE2b-256 |
34107fefb620775ab446ab14dee924bbb6a86ef69b6baab0076cc5beaeb0d2a4
|
Provenance
The following attestation bundles were made for blemees_peer-0.1.0-py3-none-any.whl:
Publisher:
release.yml on blemees/blemees-peer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
blemees_peer-0.1.0-py3-none-any.whl -
Subject digest:
c059ece5c5d854c484873cf10f1a8e89ce80863ec3c644950da18966ca6cfe6e - Sigstore transparency entry: 1445493774
- Sigstore integration time:
-
Permalink:
blemees/blemees-peer@0a1091833fc6074d1e6d3bbd2de2448d7566ef77 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/blemees
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0a1091833fc6074d1e6d3bbd2de2448d7566ef77 -
Trigger Event:
push
-
Statement type: