-
Notifications
You must be signed in to change notification settings - Fork 3
Getting Started
This guide walks you through installing SLM Mesh and sending your first message between two AI coding sessions.
- Node.js 20 or later
- An MCP-compatible AI coding agent (Claude Code, Cursor, VS Code, Windsurf, Aider, or Codex)
npm install -g slm-meshOr use without installing:
npx slm-meshclaude mcp add --scope user slm-mesh -- npx slm-meshAdd to .cursor/mcp.json:
{
"mcpServers": {
"slm-mesh": {
"command": "npx",
"args": ["slm-mesh"]
}
}
}Add to your MCP configuration file:
{
"mcpServers": {
"slm-mesh": {
"command": "npx",
"args": ["slm-mesh"]
}
}
}Open two terminal windows with your AI coding agent. Both sessions automatically:
- Start the SLM Mesh broker (if not already running)
- Register as a peer with the broker
- Get 8 MCP tools for inter-session communication
In Session A, ask your agent:
"Use mesh_peers to see who else is working on this machine."
The agent will call mesh_peers with scope machine and show you Session B.
In Session A:
"Use mesh_send to tell the other session that I just refactored the auth module."
Session B receives the message in real-time via Unix Domain Socket push. The agent can check with mesh_inbox.
In Session A:
"Use mesh_state to set the database_version to 42."
In Session B:
"Use mesh_state to get the database_version."
Both sessions share a key-value scratchpad, namespaced by project.
Before editing a shared file:
"Use mesh_lock to lock src/auth.ts before I start refactoring it."
Other sessions will see the lock and know not to edit that file.
- The first MCP server to start checks if a broker is running on localhost:7899.
- If not, it spawns the broker as a detached background process.
- The broker creates a SQLite database at
~/.slm-mesh/mesh.dband generates a bearer token at~/.slm-mesh/broker.token. - Each MCP server registers with the broker and opens a Unix Domain Socket for real-time push notifications.
- When a session ends, the MCP server unregisters. The broker cleans up locks and notifies other peers.
- When no peers remain for 60 seconds, the broker auto-shuts down.
You can also interact with the mesh from the command line:
slm-mesh status # Check broker health
slm-mesh peers # List active sessions
slm-mesh send <id> "hello" # Send a message
slm-mesh broadcast "alert" # Broadcast to all
slm-mesh state set key val # Set shared state
slm-mesh lock list # Show active locks
slm-mesh events # Show recent eventsAdd --json to any command for machine-readable output.
- Architecture — Understand the system design
- API Reference — All 8 MCP tools and 12 broker endpoints
- CLI Reference — Every command with examples
- Configuration — Environment variables and tuning
- Security — Security model and authentication