Openclaw Usage
БесплатноНе проверенMCP server that reads local OpenClaw session files to provide token usage and cost data without any network calls or authentication.
Описание
MCP server that reads local OpenClaw session files to provide token usage and cost data without any network calls or authentication.
README
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/*.jsonl
Tools
| Tool | Description |
|---|---|
get_usage |
Token counts and costs for a date range, broken down by period and model |
list_sessions |
Sessions with usage breakdown, grouped by period (top-N or all) |
get_session_logs |
Per-message logs for a session: timestamps, token counts, costs, roles |
Setup
1. Install dependencies
pip install mcp
2. Configure
The server reads these environment variables:
| Variable | Default | Description |
|---|---|---|
OPENCLAW_AGENTS_DIR |
~/.openclaw/agents/ |
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 home
Claude 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/*.jsonl - Archived (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.py
Communicates 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.
Установка Openclaw Usage
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/quittung/openclaw-usage-mcpFAQ
Openclaw Usage MCP бесплатный?
Да, Openclaw Usage MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Openclaw Usage?
Нет, Openclaw Usage работает без API-ключей и переменных окружения.
Openclaw Usage — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Openclaw Usage в Claude Desktop, Claude Code или Cursor?
Открой Openclaw Usage на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Openclaw Usage with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
