Skip to main content

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 daemon
  • blemees-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 path
  • home:~/some/project#sess_abc — direct to one session by sid
  • home:~/some/project#architect — direct to one session by alias
  • topic: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.

Metadata

Release files for blemees-peer 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for blemees-peer 0.1.0
File Size Uploaded
blemees_peer-0.1.0.tar.gz 44.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for blemees-peer 0.1.0
File Interpreter ABI Platform
blemees_peer-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 75.8 kB

Release files / blemees_peer-0.1.0.tar.gz

Download URL blemees_peer-0.1.0.tar.gz
Size 44.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cd301f295672572a3732a458303ff2bb2e90f6f9377daad1493aa98efb3432ac
BLAKE2b-256 checksum
How to use checksums
43a858966bd773173e523295d79559958b93b2d3176c2dc2b5816aab44236a69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 6, 2026.

Transparency log

Release files / blemees_peer-0.1.0-py3-none-any.whl

Download URL blemees_peer-0.1.0-py3-none-any.whl
Size 31.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c059ece5c5d854c484873cf10f1a8e89ce80863ec3c644950da18966ca6cfe6e
BLAKE2b-256 checksum
How to use checksums
34107fefb620775ab446ab14dee924bbb6a86ef69b6baab0076cc5beaeb0d2a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page