openclaw-usage-mcp
Click on "Install 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., "@openclaw-usage-mcpshow my usage costs for this week"
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.
openclaw-usage-mcp
MCP server that reads local OpenClaw session files for usage and cost data. No network calls or authentication required — it scans the JSONL session files directly from disk.
AI Agent ──stdio──▶ MCP Server ──reads──▶ ~/.openclaw/agents/*/sessions/*.jsonlTools
Tool | Description |
| Token counts and costs for a date range, broken down by period and model |
| Sessions with usage breakdown, grouped by period (top-N or all) |
| Per-message logs for a session: timestamps, token counts, costs, roles |
Related MCP server: AgentCost
Setup
1. Install dependencies
pip install mcp2. Configure
The server reads these environment variables:
Variable | Default | Description |
|
| Path to the OpenClaw agents directory containing session files |
3. Register with your MCP client
mcporter (recommended with OpenClaw):
mcporter config add usage \
--command python3 \
--arg /path/to/server.py \
--scope homeClaude Code (~/.claude/settings.json):
{
"mcpServers": {
"openclaw-usage": {
"command": "python3",
"args": ["/path/to/server.py"]
}
}
}How it works
The server scans JSONL session files from the OpenClaw agents directory:
Active sessions:
~/.openclaw/agents/*/sessions/*.jsonlArchived (reset) sessions:
~/.openclaw/agents/*/sessions/*.jsonl.reset.*
Each session file contains JSON lines with type: "session" headers, type: "message" entries (with usage/cost data on assistant messages), and type: "model_change" entries for model switches.
The server aggregates token counts and costs per model, per session, and per time period — returning the same structured output format the tools have always used.
Archived .reset.* files are included in scans, so usage from reset sessions is no longer invisible.
Running standalone
python3 server.pyCommunicates over stdio using the MCP protocol.
Previous architecture
Earlier versions used the gateway's WebSocket RPC API with Ed25519 device
authentication. That code (including device_auth.py) is preserved at tag
v0.1.0-gateway-api.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceLocal-first dashboard + MCP server that parses Claude Code and Codex JSONL files into a SQLite cost / token tracker. Per-MCP and per-tool breakdown, session drill-down, dedup by request_id; never talks to vendor APIsLast updated5801MIT
- Alicense-qualityDmaintenanceMCP server that analyzes AI agent session logs to find token waste and optimization opportunities.Last updated29MIT
- AlicenseBqualityDmaintenanceTrack LLM token costs across Claude, GPT and Gemini. MCP server + CLI with optimization hints and $ savings estimates.Last updated8321MIT
- Alicense-qualityDmaintenanceMCP server for querying OpenAI usage and cost data, including spend summaries, daily breakdowns, month-over-month comparisons, and token usage by model.Last updatedMIT
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
A paid remote MCP for ClawManager, built to return verdicts, receipts, usage logs, and audit-ready J
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/quittung/openclaw-usage-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server