-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem Statement
Currently, token tracking data is only available via structured logs or audit files. While useful for post-hoc analysis, users often want a live, visual way to monitor their token consumption and estimated costs in real-time while using the MCP server or REST API.
Proposed Solution
Implement a "Token Tracking Card"—a live monitoring interface accessible via the HTTP server.
1. Real-time Metrics Aggregator
- Implement an internal aggregator that tracks cumulative input/output tokens and costs since server startup.
- Add a new API endpoint
GET /api/metrics/tokensthat returns:- Current session totals (Input, Output, Total).
- Estimated cost in USD.
- Efficiency metrics (Tokens per row, IO efficiency).
- Last 5 query token counts.
2. Visual Card / Monitoring UI
- Add an optional embedded monitoring UI (the "Card") that can be enabled via:
- CLI:
--token-card - Config:
features.token_card: true
- CLI:
- When enabled, the REST API root (
/api) or a dedicated (/status) page can show a live-updating dashboard with the usage statistics.
3. Live CLI View (Optional)
- Consider a CLI-based "live view" (similar to
top) that can be activated to show usage data in the terminal.
Feature Category
Configuration / Other
Priority
Important
Reactions are currently unavailable
Metadata
Metadata
Labels
enhancementNew feature or requestNew feature or request