Core features
Observer Mode
A zero-config local dashboard that receives tool call records over Server-Sent Events and renders them in real time. No API key, no database, no configuration required. Start in seconds.
Starting Observer Mode
npx @businys/ops observeOpen http://localhost:3100. The dashboard shows:
- Live call feed — every tool call as it arrives, with tool name, agent, duration, and status
- Stats summary — total calls, error rate, average duration, calls per minute
- Top tools and top agents
- Anomaly feed — loops, bursts, and reputation changes
Programmatic usage
import { observe } from "@businys/ops"
const ops = await observe({
port: 3100, // default: 3100
hostname: "0.0.0.0", // default: localhost
token: process.env.OBS_TOKEN, // optional bearer token
})
console.log(ops.url) // http://localhost:3100
// Graceful shutdown
process.on("SIGINT", async () => {
await ops.close()
process.exit(0)
})Storage backends
By default, Observer Mode uses MemoryAdapter — data is lost on restart. For persistent local storage, pass a FileAdapter:
import { observe, FileAdapter } from "@businys/ops"
const storage = new FileAdapter({ path: ".ops-data.json" })
const ops = await observe({ storage })For production, use PostgresAdapter:
import { observe, PostgresAdapter } from "@businys/ops"
const storage = new PostgresAdapter({ connectionString: process.env.DATABASE_URL! })
const ops = await observe({ storage })Dashboard API
The Observer Mode server exposes a REST API at the same port:
| Endpoint | Method | Description |
|---|---|---|
/api/calls | GET | Paginated call history (?limit=50&offset=0&agentId=) |
/api/stats | GET | Aggregate stats — total calls, error rate, avg duration, top tools |
/api/calls/stream | GET | Server-Sent Events stream of live calls |
/api/reputation/:agentId | GET | Current reputation record for an agent |
Authentication
Pass --token to require a bearer token for all API and dashboard access:
npx @businys/ops observe --token mysecret
# All requests must include: Authorization: Bearer mysecretObserver Mode in CI
Run Observer Mode during your test suite to capture every tool call. Review the dashboard after tests complete to catch unexpected invocations.
- name: Start Observer Mode
run: npx @businys/ops observe --port 3100 &
- name: Run tests
run: npm test
env:
MCP_OPS_URL: http://localhost:3100
- name: Print call stats
run: npx @businys/ops status --port 3100Dev Mode (Observer + Bridge)
npx @businys/ops dev starts Observer Mode and optionally wraps a stdio server as a bridge at port+1. All bridge traffic appears in the Observer dashboard.
npx @businys/ops dev node ./server.js
# Observer: http://localhost:3100
# Bridge: http://localhost:3101