@cubicecho/agent-router-worker
v0.4.0
Published
agent-router's worker program: runs a workspace's agent loops on another machine.
Readme
@cubicecho/agent-router-worker
The worker program of agent-router. It dials a router with a worker key and runs the agent loops of the workspaces placed on it, with its own MCP servers as their tools.
An agent's tools are often on another machine than its router. Run a worker where the files, repos and programs are, and the agents of a workspace use them there. It opens no port, and it keeps dialling when the router goes away. It is a command, and a library for a program that runs a worker with its own agent loop.
Install
npm install -g @cubicecho/agent-router-workerNode 22 or later. @cubicecho/agent-core is a peer dependency, which npm installs beside it.
Quick start
Make a worker on the router's /graphql, and keep its secret:
mutation { createWorker(name: "box") { secret worker { id } } }Then start it, on the machine with the tools:
cat > worker.json <<'JSON'
{ "servers": { "files": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "."] } } }
JSON
AGENT_ROUTER_URL=http://agent-router.lan:3100 \
AGENT_ROUTER_WORKER_KEY=aiw_... \
WORKER_CONFIG=./worker.json \
agent-router-workerIt prints the servers that started, and connected to once the router has answered. Place a workspace on it with
setWorkspaceWorker, and that workspace's runs go there.
Documentation
- Install and run: the command, its environment, the Docker image
- Local servers:
WORKER_CONFIG, and the built-inworkdirserver - A custom loop: the library
- Common mistakes
llms.txt, the index of these for agents- Changelog
