Nudge

v0.2.0
io.github.jwill824/nudge-mcp Checked 1 day ago Published 7 months ago

MCP server that nudges better AI session behavior through token usage and efficiency analysis

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

claude_session_report Claude Session Report

Show Claude Code session token usage and cost estimates. Filter by last N sessions, today, a specific month (YYYY-MM), or all time. Returns per-session metrics: cache hit %, estimated cost, tokens/turn, duration.

ParameterTypeDescription
lastintegerShow last N sessions (default: 20)
monthFilter to a specific month, e.g. '2026-04'
todaybooleanShow today's sessions only

claude_monthly_summary Claude Monthly Summary

Return total token usage and estimated cost for a Claude Code billing month. Shows spend vs your configured monthly budget and remaining runway. Defaults to the current month.

ParameterTypeDescription
monthMonth in YYYY-MM format. Defaults to current month.

claude_calibrate_pricing Claude Calibrate Pricing

Update the pricing discount factor from actual Claude Code billing. Run this each month after your billing statement resets. Provide the actual_billed amount shown on your subscription page.

ParameterTypeDescription
actual_billed *numberActual amount billed shown in Claude Code subscription (USD)
monthMonth being calibrated (YYYY-MM). Defaults to previous month.

claude_tool_impact Claude Tool Impact

Analyze how a specific tool affects Claude Code session efficiency. Scans session history to compare tokens/turn, cache hit %, and cost between sessions that used the tool and those that didn't. Useful for measuring the real-world impact of tools like 'serena', 'ck', 'ast-grep', 'Read', 'Grep', or any MCP/built-in tool. Provide the tool name as you'd refer to it naturally, e.g. 'serena', 'ck', 'ast-grep'.

ParameterTypeDescription
tool *stringTool name to analyze. Examples: 'serena', 'ck', 'ast-grep', 'Read', 'Grep', 'Glob', 'Bash'. Case-insensitive.
monthLimit analysis to a specific month, e.g. '2026-04'. Defaults to all history.

copilot_tool_impact Copilot Tool Impact

Analyze how a specific tool affects Copilot CLI session efficiency. Scans Copilot CLI session history to compare output tokens/turn and estimated cost between sessions that used the tool and those that didn't. Useful for measuring the real-world impact of tools like 'serena', 'ck', 'ast-grep', 'view', 'bash', or any MCP tool. Provide the tool name as you'd refer to it naturally, e.g. 'serena', 'ck', 'bash'.

ParameterTypeDescription
tool *stringTool name to analyze. Case-insensitive substring match against MCP tool names.
monthLimit analysis to a specific month, e.g. '2026-04'. Defaults to all history.

copilot_session_report Copilot Session Report

Show GitHub Copilot CLI session output token usage and efficiency metrics. Reads directly from ~/.copilot/session-state. Filter by last N sessions, today, or a specific month (YYYY-MM). Returns per-session: output tokens, turns, duration, tokens/turn, tools used, model. Note: only output tokens are tracked (Copilot CLI does not expose input/cache token counts).

ParameterTypeDescription
lastintegerShow last N sessions (default: 20)
monthFilter to a specific month, e.g. '2026-04'
todaybooleanShow today's sessions only

copilot_monthly_summary Copilot Monthly Summary

Monthly output token summary for GitHub Copilot CLI sessions. Shows total output tokens, session count, top projects, and at-API-rate equivalent cost vs your flat subscription budget. Defaults to the current month.

ParameterTypeDescription
monthMonth in YYYY-MM format. Defaults to current month.

configure_subscription Configure Subscription

Update the active Claude Code or GitHub Copilot subscription plan and monthly budget. Use this when you change plans or when your admin adjusts your budget. Provide a named plan key and/or a custom monthly_budget override. Claude plans: claude_pro ($20), claude_max_100 ($100), claude_max_200 ($200), claude_max_400 ($400), api ($0). Copilot plans: copilot_free ($0), copilot_pro ($10), copilot_pro_plus ($39), copilot_business ($19/seat), copilot_enterprise ($39/seat). For Copilot Pro, you can also set overage_budget to track the additional premium request budget you've configured on top of you…

ParameterTypeDescription
service *stringWhich service to configure: 'claude' or 'copilot'
monthly_budgetCustom monthly budget in USD. Overrides the plan default.
overage_budgetCopilot only. Additional premium request budget cap in USD (e.g. 25.0).
planNamed plan key. Claude: claude_pro, claude_max_100, claude_max_200, claude_max_400, api. Copilot: copilot_free, copilot_pro, copilot_pro_plus, copilot_business, copilot_enterprise.

analyze_copilot_session Analyze Copilot Session

Analyse a Copilot CLI session for inefficiencies and behavioural anti-patterns. Checks prompt quality (vague/short prompts), tool batching (parallelism), bash overuse vs specialised tools, and memory utilisation. Defaults to the currently active session (inuse lock detected), then falls back to the most recently modified session.

ParameterTypeDescription
session_idFull or partial session UUID. Omit to use the active/latest session.

copilot_behavior_report Copilot Behavior Report

Cross-session pattern analysis for GitHub Copilot CLI sessions. Aggregates behavioural signals across recent sessions to surface recurring inefficiencies: vague prompts, low tool parallelism, bash overuse, missing memory calls. Returns a scored summary with actionable recommendations.

ParameterTypeDescription
lastintegerNumber of recent sessions to analyse (default: 10)
monthLimit to a specific month, e.g. '2026-04'

copilot_premium_usage Copilot Premium Usage

Fetch live Copilot premium request usage from the GitHub API. Calls GET /users/{username}/settings/billing/premium_request/usage and shows requests used, cost by model, and progress against your configured overage budget. Uses the gh CLI token automatically; falls back to the GH_TOKEN or GITHUB_TOKEN environment variables. Requires a fine-grained PAT (or gh CLI login) with 'Plan' (read) permission. Only works for individual Copilot plans — not org/enterprise-managed licenses.

ParameterTypeDescription
monthMonth in YYYY-MM format. Defaults to current month.

record_copilot_spend Record Copilot Spend

Record actual Copilot overage spend for a month. Use this when you can see your real spend in the GitHub billing UI but the API isn't accessible (e.g. org/enterprise-managed plans). The recorded amount is shown in copilot_monthly_summary alongside your overage budget cap.

ParameterTypeDescription
amount *numberActual overage spend in USD (e.g. 17.72).
monthMonth in YYYY-MM format. Defaults to current month.

copilot_budget_forecast Copilot Budget Forecast

Forecast end-of-month Copilot spend and estimate savings from fixing inefficiencies. Uses burn rate from recorded spend + session history to project end-of-month cost. Analyses behavioral waste (low batching, bash overuse, vague prompts) and shows how fixing each issue would offset the projected spend. Requires record_copilot_spend and configure_subscription (overage_budget) to be set.

ParameterTypeDescription
monthMonth in YYYY-MM format. Defaults to current month.

copilot_model_efficiency Copilot Model Efficiency

Analyse how well the active model matched task complexity across Copilot CLI sessions. Scores each turn 0–8 (prompt length, output tokens, tool count, unique tools), classifies each as over-powered / fit / under-powered, and estimates savings from switching simple turns to a budget model.

ParameterTypeDescription
lastintegerNumber of most-recent sessions to analyse (default: 10)
monthFilter to a specific month, e.g. '2026-04'