DEV Community

Cover image for I Built an MCP Server So Claude Can Answer Questions About Its Own Usage
Yurukusa
Yurukusa

Posted on

I Built an MCP Server So Claude Can Answer Questions About Its Own Usage

Here's something that didn't exist until recently: you can ask Claude how much Claude Code you've been using, and get a real answer backed by your actual data.

You: "How much have I used Claude Code this month, and is my streak going to survive?"

Claude: "You've logged 47.3h interactive + 83.1h AI sub-agent work in March,
         for 130.4h total. You're on a 36-day streak with 22 Ghost Days.

         Based on your last 14 days, your streak is likely to survive —
         you've been active 100% of days this month."
Enter fullscreen mode Exit fullscreen mode

That's cc-mcp. An MCP server that gives Claude real-time access to your Claude Code usage stats.

The problem with analytics tools

I've built 26 other Claude Code analytics tools. You run them, they print stats, you close the terminal. The knowledge doesn't go anywhere useful.

What I wanted was for Claude to know this information during a session. If I'm planning work with Claude, it should be able to factor in that I've already spent 8 hours in Claude Code today, that AI has been running autonomously for 3 hours while I was offline, and that my streak needs protecting.

MCP makes this possible.

How it works

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "cc-toolkit": {
      "command": "npx",
      "args": ["@yurukusa/cc-mcp"]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Restart Claude Desktop. Now you have four new tools:

cc_usage_summary

Today / 7-day / month-to-date totals, current streak, and autonomy ratio.

"Show me my Claude Code stats" → Claude calls this, gets structured data, responds naturally.

cc_daily_breakdown

Day-by-day activity for the last N days, with you vs AI split.

"When were my Ghost Days last week?" → Claude scans the breakdown, finds days where AI ran while you didn't.

cc_project_stats

Per-project time breakdown (top 15 by hours).

"Which project am I spending the most Claude Code time on?" → Claude looks at your project distribution.

cc_forecast

Month-end projection at your current pace.

"Will I hit 700+ hours this month?" → Claude runs the projection and gives you the math.

Ghost Days

One concept that comes up frequently in the data: Ghost Days.

A Ghost Day is any day where AI sub-agents ran Claude Code autonomously — while you had zero interactive sessions. Your AI kept working while you were offline.

When you ask Claude "what were my Ghost Days this month?", cc-mcp surfaces these automatically. It's a useful signal for understanding how much your AI pipeline runs unsupervised.

What makes this different from just running cc-agent-load

When you run npx cc-agent-load, you get a terminal output you read once and forget. When Claude has this data via MCP, it becomes part of the conversation:

  • Claude can proactively mention that your streak is at risk
  • You can ask follow-up questions without re-running tools
  • The data can inform Claude's recommendations ("Given you've already used 8h of AI time today, maybe we should keep this session focused")

The data is the same. The difference is context persistence within the session.

Technical implementation

The server is a Node.js ES module using the @modelcontextprotocol/sdk. Each tool calls cc-agent-load --json as a subprocess, parses the output, and returns both plain text (for display) and structured JSON (for downstream processing).

Source: github.com/yurukusa/cc-mcp

No telemetry. No server. All computation happens locally — the MCP server runs on your machine, Claude calls it as a local process, data never leaves your environment.

Setup

# Install the data source
npm install -g cc-agent-load

# Run the MCP server directly (test it works)
npx @yurukusa/cc-mcp
Enter fullscreen mode Exit fullscreen mode

Then add to your Claude Desktop config and restart.

Works with Claude Desktop and any other MCP-compatible client.

Part of cc-toolkit

cc-mcp is part of the cc-toolkit collection — 27 free tools for understanding your Claude Code usage.

The full loop: TrackUnderstandPredictActAsk (cc-mcp closes the loop back into Claude).


Is your Claude Code setup actually safe? Run npx cc-health-check — a free 20-point diagnostic. Score below 80? The Claude Code Ops Kit fixes everything in one command.

GitHub: yurukusa/cc-mcp
npm: @yurukusa/cc-mcp

Top comments (0)