docs.businys.dev

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

Terminalsh
npx @businys/ops observe

Open 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

server.tsts
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:

server.tsts
import { observe, FileAdapter } from "@businys/ops"

const storage = new FileAdapter({ path: ".ops-data.json" })
const ops = await observe({ storage })

For production, use PostgresAdapter:

server.tsts
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:

EndpointMethodDescription
/api/callsGETPaginated call history (?limit=50&offset=0&agentId=)
/api/statsGETAggregate stats — total calls, error rate, avg duration, top tools
/api/calls/streamGETServer-Sent Events stream of live calls
/api/reputation/:agentIdGETCurrent reputation record for an agent

Authentication

Pass --token to require a bearer token for all API and dashboard access:

Terminalsh
npx @businys/ops observe --token mysecret
# All requests must include: Authorization: Bearer mysecret

Observer 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.

.github/workflows/test.ymlyaml
- 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 3100

Dev 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.

Terminalsh
npx @businys/ops dev node ./server.js
# Observer: http://localhost:3100
# Bridge:   http://localhost:3101