Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Add real-time web dashboard#8

Merged
ojongerius merged 4 commits intomainfrom
add-web-dashboard
Mar 27, 2026
Merged

Add real-time web dashboard#8
ojongerius merged 4 commits intomainfrom
add-web-dashboard

Conversation

@ojongerius
Copy link
Copy Markdown
Collaborator

Summary

  • Adds embedded web dashboard at :8080 — single HTML file, no build step, no external dependencies
  • Live tool call stream via Server-Sent Events (SSE) for real-time monitoring
  • Session sidebar with server name, tool call counts, and risk indicators
  • Tool call table with filters by policy action (flag/pause/block) and operation type (read/write/delete/execute)
  • Intent chain visualization showing temporal groupings of related tool calls
  • One-click hash chain verification from the browser
  • Approve/deny paused tool calls directly from the dashboard
  • Dashboard stats bar: sessions, active, tool calls, flagged, blocked, avg risk
  • Replaces the 3 inline HTTP handlers in main.go with the full internal/web package

Architecture

  • internal/web/server.go — HTTP handlers, SSE hub, go:embed static files
  • internal/web/static/index.html — dark-themed single-page dashboard (vanilla JS, no framework)
  • internal/audit/queries.go — query methods for ListSessions, ListToolCalls, ListIntents, GetStats
  • internal/proxy/proxy.go — broadcasts tool call events to SSE clients via Dashboard.Broadcast()

Test plan

  • make build succeeds
  • make test — all existing + new tests pass
  • make lint clean
  • Manual: start proxy, open http://localhost:8080, verify dashboard loads
  • Manual: trigger tool calls, verify they appear in real-time
  • Manual: verify intent chains tab shows temporal groupings
  • Manual: verify hash chain verification works from browser

Embedded single-page dashboard at :8080 with:
- Live tool call stream via Server-Sent Events
- Session sidebar with risk indicators
- Tool call table with policy/operation/risk filters
- Intent chain visualization (temporal grouping)
- One-click hash chain verification
- Approve/deny paused tool calls from browser

New files:
- internal/web/ — HTTP handlers, SSE hub, embedded static files
- internal/audit/queries.go — dashboard query methods (sessions, tool calls, intents, stats)

No external dependencies added (pure stdlib SSE, no WebSocket library).
- cmd/beacon-traffic/ generates realistic MCP audit data across
  github, filesystem, and postgres servers for demo purposes
- docs/dashboard.png captured from live dashboard with sample data
- README updated with screenshot and demo traffic instructions
Remove redundant newline in fmt.Println call.
Cancel context and wait for handler goroutine to finish before
reading ResponseRecorder, avoiding concurrent read/write race.
@ojongerius ojongerius merged commit d847c66 into main Mar 27, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant