KiroStats
KiroStats is a real-time credit usage and session tracking MCP server for Kiro IDE that reads directly from local execution files. It provides the following capabilities:
start_session: Initialize a new chat session, capturing a snapshot of current credits and time as a baseline for delta calculations.log_interaction: Record individual agent turns within a session, including optional thinking/processing time (thinking_seconds), to maintain cumulative metrics.get_session_stats: Retrieve live session metrics including credits consumed (delta from session start), cumulative agent thinking time (total_thinking_time), total wall-clock duration (wall_clock_time), and interaction count.get_plan_usage: View full billing-cycle plan data including credit limit, total credits used, remaining credits, overage details, and billing reset date.get_session_summary: Generate a pre-formatted session summary suitable for pasting into tools like Jira comments or PR descriptions.
Provides session summaries formatted for Jira tickets, allowing users to paste or auto-attach credit usage, thinking time, and other session metrics to issues.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@KiroStats What's my credit usage this session?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
KiroStats
Credit usage and session timing for Kiro IDE, as a local MCP server.
No auth, no network, no cloud. Reads Kiro's own session files on disk. Works with Kiro 1.0+ and pre-1.0.
Usage
Type /stats in any Kiro chat.
{
"credits_used": 84.7983,
"agent_time": "27m 4s",
"session_time": "49m 46s",
"turns": 4,
"source": "kiro-1.x",
"session_id": "sess_ec3ae179-3b53-4ee1-a6be-95c67922ebeb",
"last_turn_credits": 7.2263,
"last_turn_time": "1m 29s"
}Related MCP server: MCP Token Tracker
Install
git clone https://github.com/BrennanWebb/KiroStats.git
cd KiroStats
.\install.ps1The installer locates a Python 3.10+ interpreter, pip-installs the package,
registers the server in ~/.kiro/settings/mcp.json, and writes a /stats
steering file.
Kiro normally picks up the new server on its own. Restart it if /stats does not
respond.
Tool
get_session_stats(layout="auto", workspace_path=None)
Arg | Purpose |
|
|
| A workspace root path. Disambiguates concurrent sessions. 1.0+ only. |
Returns credits_used (session total), agent_time, session_time, turns,
source, and session_id, plus last_turn_credits / last_turn_time on 1.0+.
A note field appears when a caveat applies.
How It Works
Kiro moved session storage between 0.x and 1.0. KiroStats reads both and prefers
the newer layout, so a stale globalStorage tree left behind by an upgrade cannot
shadow live data.
Kiro 1.0+
An append-only event log under the user home:
~/.kiro/sessions/{workspace-key}/sess_{uuid}/session.json
~/.kiro/sessions/{workspace-key}/sess_{uuid}/messages.jsonlsession.json carries status, createdAt, modelId, and workspacePaths.
Credits arrive in messages.jsonl as a usage_summary record, appended when a
turn completes:
{"payload": {
"type": "usage_summary",
"promptTurnSummaries": [
{"unit": "credit", "unitPlural": "credits", "usage": 18.5044}
],
"elapsedTime": 387160,
"status": "success"
}}That record is what the chat footer renders: 18.5044 and 387160 ms display as
Est. Credits Used: 18.5 / Elapsed time: 6m 27s.
Pre-1.0
One JSON blob per agent execution under the extension's globalStorage:
{globalStorage}/kiro.kiroagent/{ws-hash}/{session-hash}/{execution-hash}Each carries chatSessionId, startTime/endTime, status, and a
usageSummary[] of per-response metering entries. KiroStats finds the execution
with status == "running" and aggregates its whole chat session.
Limits
Not real-time on 1.0+. Kiro holds the metering stream in memory during a turn
and flushes it only at turn completion, so a mid-turn reading covers through the
last completed turn. The response says as much in note. Pre-1.0 could see
in-flight usage, because the running execution file sat on disk with a partial
usageSummary.
Session detection is best-effort. With several Kiro windows mid-turn, more
than one session is genuinely in_progress. KiroStats prefers live sessions and
tiebreaks on recent activity; pass workspace_path to be exact. Heuristic picks
are flagged, and session_id always comes back so you can verify.
Manual Install
pip install -e .
python -c "import sys; print(sys.executable)"Add to ~/.kiro/settings/mcp.json, using that interpreter path:
{
"mcpServers": {
"kiro-stats": {
"command": "C:\\Path\\To\\python.exe",
"args": ["-m", "kiro_stats_mcp.server"],
"disabled": false,
"autoApprove": ["get_session_stats"]
}
}
}Copy .kiro/steering/stats.md to ~/.kiro/steering/, saved without a BOM —
a BOM ahead of the --- breaks front-matter parsing.
Use the absolute interpreter path and -m rather than the kiro-stats-mcp
console script. Kiro spawns MCP servers without a shell, and neither Scripts on
PATH nor a bare python is dependable there — on Windows 10/11 python often
resolves to the Microsoft Store alias stub.
Platforms
OS | Kiro 1.0+ | Pre-1.0 |
Windows |
|
|
macOS |
|
|
Linux |
|
|
The 1.0+ path is home-relative everywhere, matching the extension's own
path.join(os.homedir(), ".kiro", "sessions"). Only Windows has been tested.
Requires Python 3.10+ and Kiro opened at least once.
Sources
Kiro's storage layout is not publicly documented, and
kirodotdev/Kiro is docs and issue tracking
only — there is no source to read. These schemas were derived from the shipped
kiro.kiro-agent bundle and verified against live session data on 1.0.337.
Expect drift between releases.
Uninstall
pip uninstall kiro-stats-mcp
# remove "kiro-stats" from ~/.kiro/settings/mcp.json
# delete ~/.kiro/steering/stats.mdLicense
MIT
Available Tools
5 toolsget_plan_usageA
Get overall Kiro plan usage for the current billing cycle.
Returns plan limit, total credits used, remaining, overage details, and reset date. This is the full-cycle view (not session-specific).
Inputs: no named parameters. Returns: object
get_session_statsA
Get current metrics for a chat session.
Returns:
session_credits: Credits consumed during this session (delta from start)
total_thinking_time: Cumulative agent processing time
wall_clock_time: Total time since session started
interaction_count: Number of agent turns logged
Inputs: session_id. Returns: object
get_session_summaryB
Get a formatted summary suitable for pasting into Jira comments, PR descriptions, or other documentation.
Inputs: session_id. Returns: object
log_interactionA
Log an agent interaction (turn) within the session.
Call this after each agent turn to record thinking time. If thinking_seconds is not provided, records a zero-duration ping (useful for just updating the 'last activity' timestamp).
Inputs: session_id, thinking_seconds. Returns: object
start_sessionA
Start tracking a new chat session. Call this ONCE at the beginning of every chat session.
Captures a snapshot of current plan credits and wall-clock time so that subsequent calls to get_session_stats can calculate deltas.
Returns the session_id and starting credit balance.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
All tools have distinct purposes: plan-level usage, session metrics, session summary, interaction logging, and session initiation. No overlap or ambiguity.
All tool names follow a consistent verb_noun pattern using snake_case (get_plan_usage, get_session_stats, get_session_summary, log_interaction, start_session). No deviations.
5 tools is well-scoped for a session and usage tracking server. Each tool serves a clear need without redundancy or gaps.
Covers the full lifecycle: session start, per-turn logging, current stats, formatted summary, and plan-level usage. No obvious missing operations for the intended domain.
Maintenance
Related MCP Connectors
Track API spend, credit balances and runway across OpenAI, Anthropic, OpenRouter and 25 more.
Track billable time from your AI chat: timers, entries, reports, CSV export. All data stays local.
Track billable time from your AI chat: timers, entries, reports, CSV export. All data stays local.
Read your tracked time and projects, pause tracking or add a note, from Claude or ChatGPT.
Related MCP Servers
- AlicenseAqualityNot gradedmaintenanceProvides real-time visibility into Claude Pro and Max subscription usage limits directly within Claude Code by utilizing local OAuth tokens. It enables users to monitor session and weekly usage across different models and receive alerts regarding rate-limiting status.4-
- AlicenseNot gradedqualityDmaintenanceTracks token usage and records coding sessions for Claude Desktop users, supporting both local SQLite and cloud Cloudflare D1 databases.523 npmMIT
- AlicenseAqualityCmaintenanceReal-time Claude.ai subscription awareness for AI coding assistants. Surfaces live utilization, forecasts limits, gates expensive operations, and measures real per-task cost.516 npm6MIT
- FlicenseBqualityCmaintenanceEnables Cursor users to track local workflow state and receive contextual nudges, daily summaries, and Windows toast notifications for sessions, edits, MCP usage, and plans.5-