Skip to content
scphqPublic

About

The message layer for agent swarms. Any harness, any machine, awake or hibernated.

Topics

Resources

Stars

84 stars

Watchers

0 watching

Forks

Repository files navigation

SCP

Swarm Communication Protocol, the message layer for agents.

scp.dev · Specification

npm: @scp-dev/cli License: Apache-2.0 Protocol: scp/1

Coding agents in any harness message each other across machines and orgs, at turn-level fidelity.

  • Any harness. Claude Code, Codex, OpenCode, pi, Muse, Agy, Grok.
  • Turn-level delivery. Messages land after a tool call, on a prompt or at a stop, or they wake an idle session.
  • Orchestration. Spawn workers in any harness, steer them mid-run, get results back as handbacks.
  • Run anywhere. Orchestrate from any harness and place agents on any VM provider you like.
  • Sessions persist. Hibernated sessions wake on a message, months later, with full context. Ask the agent that built it.
  • Safe by default. Reach follows the process tree, accounts meet only through mutual consent, and an optional judge reviews what crosses a boundary.

Example

An orchestrator in Claude Code spawns three workers in three harnesses, steers one, and stops to wait.

An orchestrator spawns parser, docs and bench in Claude Code, Codex and agy, steers parser, which sees the steer after its next tool call, then gets parser's result back as a handback at its stop

Quickstart

npm i -g @scp-dev/cli
swarm up                         # sign in, link this machine, install hooks and MCP
swarm claude --name orch         # or swarm codex, swarm pi, swarm opencode, swarm agy, swarm grok, swarm muse
swarm spawn --name w1 -- codex exec "Fix the tests"

Already running? swarm join <name> from the session's shell. CI or cloud box? swarm up --token "$SCP_TOKEN" --machine runner-1 (ambient agents). Addresses: me/<machine>/<agent> for your devices, <org>/<machine>/<agent> for your org. Every verb: swarm help --all, or CLI verbs.

Architecture

flowchart LR
  harness["Harnesses<br/>Claude Code, Codex, OpenCode,<br/>pi, Muse, agy, Grok"]
  integ["hooks + MCP<br/>swarm hook, swarm mcp"]
  broker["Local broker<br/>one per machine"]
  bridge["Bridge<br/>WebSocket"]
  hub["Hub, app.scp.dev<br/>with the judge"]
  others["Other machines<br/>and orgs"]
  peer["Peer broker"]
  harness --> integ --> broker --> bridge --> hub --> others
  broker -.->|"mesh"| peer
Loading

Harness to local broker to the org's hub, and on to other machines and orgs. Full diagrams: scp.dev/architecture. Normative: spec section 4.

For harness authors

Pull with MCP or a shell, push with hooks. Bindings: harness bindings. Conformance: section 18.

Self-hosting

The relay in apps/relay deploys to your own Cloudflare account, or runs anywhere that holds one SQLite database per org. Guide: scp.dev/docs/self-host. Then swarm relay use https://relay.example.com && swarm up. The 🦀 Rust relay runs on SQLite or Postgres with docker run ghcr.io/scphq/scp-relay, npx @scp-dev/relay-server serve or cargo install scp-relay-server; see the guide.

Docs

Spec · Getting started · Harnesses · Providers · Ambient agents · Judge · Mesh · Self-hosting

Repository

packages/spec/     SPEC.md, the protocol source of truth; IMPLEMENTATION.md, the reference implementation
packages/core/     protocol types, scopes, rendering, the judge
packages/broker/   the local broker and its bridge to the hub
packages/hub/      the hub: machines, mirrored endpoints, deliveries, contacts
packages/mcp/      the scp MCP server
packages/mesh/     the experimental hubless mesh
packages/pi/       the pi extension
packages/cli/      the swarm command line tool
apps/relay/        the hosted relay at app.scp.dev (Cloudflare Worker, Durable Objects, D1)
apps/web/          the scp.dev site, which renders the docs, the spec and the architecture

From source, with Bun: git clone https://github.com/scphq/scp.git && cd scp && bun install && bun packages/cli/src/cli.ts help. Checks: bun run lint, bun run typecheck, bun run test, bun run build.

Contributing

PRs target main and are squash merged. Titles are conventional commits (feat(core): message envelope), and bodies follow the pull request template. Run bun run lint, bun run typecheck and bun test before opening a PR. A change to the wire format, addressing or semantics updates SPEC.md and the code in the same PR. See AGENTS.md for the full conventions.

License

Apache-2.0.

About

The message layer for agent swarms. Any harness, any machine, awake or hibernated.

Topics

Resources

Stars

84 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages