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., "@KiroStatsWhat'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: Cursor Pro Limits MCP Server
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).
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses what is returned (plan limit, credits, etc.) and that it is a read operation, but does not explicitly state it is read-only or mention any other behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the main action. No redundant words, clearly structured with purpose followed by output details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simplicity (no parameters, output schema exists), the description is largely complete. It covers what the tool returns and its scope, though it could mention any rate limits or authentication needs.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has no parameters, so schema coverage is 100%. The description adds meaning by detailing the output and clarifying the scope (current billing cycle, not session-specific), which enhances understanding beyond the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool retrieves overall Kiro plan usage for the current billing cycle, with specific output details. It distinguishes from sibling tools by noting it is not session-specific.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for full-cycle billing data and contrasts with session-specific views, but does not explicitly state when to use it over alternatives or when not to use it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | Which session to query. Uses active session if not provided. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It clearly indicates idempotent reading via 'Get' and lists returned fields. It does not disclose potential side effects (unlikely) or authorization requirements. The active session fallback is described in the parameter schema but not in the description itself.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: a single sentence with a bulleted list of return values. No extraneous text, immediate purpose statement, and structured enumeration of outputs.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read tool with one optional parameter and an output schema, the description covers the primary purpose and all return fields. It does not detail the optional parameter's default behavior (covered by schema) or compare to siblings, but completeness is adequate given low complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides 100% coverage for the single parameter session_id, describing its dual type, default, and behavior ('Uses active session if not provided'). The tool description only restates 'chat session' without adding semantic nuance. Baseline 3 is appropriate given schema completeness.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description starts with a clear verb ('Get') and resource ('current metrics for a chat session'), and the bulleted list of return values specifies exactly what is retrieved. This distinguishes it from siblings like get_session_summary (likely a text summary) and get_plan_usage (different resource).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description states the tool's purpose but does not explicitly say when to use it over alternatives like get_session_summary. There is no when-not or conditional guidance, only a general statement of what it does.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_session_summaryB
Get a formatted summary suitable for pasting into Jira comments, PR descriptions, or other documentation.
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | Which session to summarize. Uses active session if not provided. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; description only states it returns a summary. Fails to disclose any side effects, auth requirements, or error behavior for missing sessions, which is needed for a tool with no annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single, front-loaded sentence clearly stating purpose with no redundant information. Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple tool (one param, output schema exists), description is adequate but could briefly mention the output format or content to provide fuller context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema already fully describes the parameter (session_id) with default behavior. Description adds no extra meaning beyond what the schema provides, resulting in baseline score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool gets a formatted summary for documentation purposes. It uses specific verbs and resources but does not explicitly differentiate from siblings like get_session_stats.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implied usage for copying summaries into Jira/PRs, but no explicit when-to-use or when-not-to-use guidance, nor mention of alternatives among siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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).
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | No | The session to log to. Uses active session if not provided. | |
| thinking_seconds | No | How many seconds the agent spent processing this turn. |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that omitting thinking_seconds records a zero-duration ping for timestamp updates. This adds meaningful behavioral context beyond the schema, though it doesn't discuss idempotency or data persistence.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences long and front-loaded with the main purpose. Every sentence adds value with no wasted words. It is highly concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (2 optional parameters, no required fields) and the presence of an output schema, the description adequately covers the tool's behavior and usage. It is complete enough for an agent to use correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with both parameters described. The description adds value by explaining the effect of providing or omitting thinking_seconds, which is not apparent from the schema alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Log an agent interaction (turn) within the session.' It uses a specific verb ('Log') and resource ('agent interaction'), and the context of sibling tools (get_plan_usage, get_session_stats, etc.) distinguishes it well.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says 'Call this after each agent turn' and explains the fallback behavior when thinking_seconds is omitted. While it does not specify when not to use it or name alternatives, the context is clear and sufficient for a logging tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It discloses that the tool captures a snapshot of plan credits and wall-clock time, and returns session_id and starting credit balance. It does not mention error conditions or idempotency, but for a simple init tool, this is adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise at three sentences. The first states purpose, the second provides usage guidance, and the third explains behavior and return values. Every sentence earns its place with no redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (no parameters, output schema exists), the description adequately covers purpose, usage, behavior, and return values. It might benefit from noting idempotency or error handling, but overall it is sufficiently complete for an agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, and schema coverage is 100% (trivially). The description adds value by explaining why the tool exists (to enable delta calculations for get_session_stats), which goes beyond the empty schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Start tracking a new chat session.' It uses a specific verb and resource, and explicitly distinguishes the tool from siblings by noting it should be called 'ONCE at the beginning of every chat session,' setting it apart from query tools like get_session_stats.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear usage context: 'Call this ONCE at the beginning of every chat session.' It explains why (to capture snapshots for later deltas) but does not explicitly clarify when not to use it or compare directly to siblings. However, the context is sufficient for an agent to understand its role.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
get_plan_usage - First observed
get_session_stats - First observed
get_session_summary - First observed
log_interaction - First observed
start_session
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 billable time from your AI chat: timers, entries, reports, CSV export. All data stays local.
OpenAI organization usage and cost reporting through an admin API key connected by the user.
Track Keito time entries and LLM costs from AI agents.
Live status and health checks for AI coding providers: Claude, Cursor, Copilot, Codex and more.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides intelligent context management for AI development sessions, allowing users to track token usage, manage conversation context, and seamlessly restore context when reaching token limits.813 npm2Apache 2.0
- AlicenseBqualityDmaintenanceEnables real-time monitoring of Cursor Pro usage limits and API quotas across different AI services. Tracks Sonnet 4.5, Gemini, and GPT-5 request usage with alerts when approaching subscription limits.62 npmMIT
- 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.205 npmMIT