Live MCP token usage audit (Archolith Skree) for Codex sessions. Tracks per-server token spend and waste patterns in real time.
curl -fsSL https://raw.githubusercontent.com/Archolith/archolith-mcp-audit/main/scripts/install.sh | bash -s -- codexThe installer clones https://github.com/Archolith/archolith-audit-plugin-codex to
~/.archolith/plugins/archolith-audit-plugin-codex, verifies the managed Python runtime, and runs
codex mcp add with the correct PYTHONPATH.
On first MCP startup, the plugin creates an isolated runtime under
~/.archolith/venvs/codex-pyXY and installs requirements.txt there. It does
not mutate your global Python environment.
git clone https://github.com/Archolith/archolith-audit-plugin-codex \
~/.archolith/plugins/archolith-audit-plugin-codex
codex mcp add archolith-audit \
--env MCP_AUDIT_ENABLED=1 \
--env PYTHONPATH="$HOME/.archolith/plugins/archolith-audit-plugin-codex" \
-- python -m archolith_mcp_audit.bootstrap mcp --agent codexRestart Codex after installing.
After a few tool calls, run mcp_audit_summary via the MCP tool. Should show
per-server data. If empty, check that the JSONL file exists at
~/.archolith/sessions/.
To verify the runtime without starting a full Codex session:
PYTHONPATH="$HOME/.archolith/plugins/archolith-audit-plugin-codex" \
python -m archolith_mcp_audit.bootstrap check --agent codexplugin.json ← metadata + MCP server registration
hooks/hooks.json ← PostToolUse hook (calls hook_observer_codex.py)
hook_observer_codex.py ← standalone hook wrapper (writes JSONL observations)
requirements.txt ← Python runtime dependencies
archolith_mcp_audit/ ← bundled core Python package
Codex does not inject session ID into MCP server env automatically.
This plugin uses a per-hour fallback session key (codex-<hour>).
All observations from the same hour's Codex session map to the same file.
Good enough for reporting; not perfectly session-scoped.
- Python 3.10+ on PATH with
venvandpip - Network access on first MCP startup unless the managed venv is already populated
- Codex CLI