@compute-finance/mcp
Provides real-time AI compute pricing and cost analysis across LLM providers, enabling session cost tracking, model price comparisons, and historical data queries.
README
@compute-finance/mcp
Live AI compute pricing oracle — real-time LLM model prices across providers (Anthropic, OpenAI, Google, xAI) via the Compute Finance Oracle.
A stdio MCP server. Works in any MCP client. Includes optional Claude Code skills for session cost analysis.
Quick start
Claude Code (recommended)
npx @compute-finance/mcp setup
This single command:
- Registers the MCP server at user scope (
claude mcp add) - Installs Claude Code skills (
/cf-session-management,/cf-session-consumption,/cf-active-sessions) - Installs the cost hook — a
UserPromptSubmithook that injects session cost into Claude's context so every response can show how much you've spent
Restart Claude Code after setup.
Or register manually without skills/hook:
claude mcp add --scope user compute-finance -- npx @compute-finance/mcp
Cursor / VS Code / Any MCP client
Add to your MCP config (.cursor/mcp.json, VS Code settings, etc.):
{
"mcpServers": {
"compute-finance": {
"command": "npx",
"args": ["@compute-finance/mcp"]
}
}
}
From source
git clone https://github.com/compute-finance/mcp.git
cd mcp
npm install && npm run build
npx . setup
Tools
17 tools across five layers — no API key required. All tools are read-only.
Data (live oracle)
| Tool | Description |
|---|---|
data_get_basket |
All models with provider, family (e.g. openai.gpt, anthropic.claude), USD prices per million tokens, and per-component cache pricing (read, write-5m, write-1h) with provider attribution |
data_get_price |
Price for a single model (e.g. claude-opus-4.7) |
data_get_scu |
Current Standard Compute Unit — value plus a methodology-versioned breakdown listing every family representative |
data_get_breakdown |
Per-family blended-cost breakdown alone — methodology-versioned discriminated union with one entry per family representative |
data_get_cpi |
Full Compute Price Index — basket with scuUsd, version, raw/marked-up prices |
data_get_reconstitutions |
Historical basket changes — model swaps, SCU before/after |
data_get_methodology |
Methodology changelog — every version with its formula summary and spec link, plus the version in force |
data_get_history |
SCU index time series over a date range — per-revision, daily, or weekly granularity; daily/weekly buckets carry the last revision's value forward across empty buckets |
data_get_model_price_history |
Per-model input/output USD price time series for a model that has appeared in the SCU basket — same granularity semantics as data_get_history, with catchup gaps surfaced in unavailableRevisions |
Cache pricing comes from the Compute Finance Oracle. Session and consumption reports show effective (cache-aware) cost when the oracle has published the relevant cache components; otherwise they show nominal cost (input rate applied to every input variant) and label effective as unavailable for that model.
Compute
| Tool | Description |
|---|---|
compute_estimate |
Nominal USD cost for a model given input/output token counts |
compute_compare |
Rank all basket models by cost for a workload, grouped by family |
Render (Claude Code skills)
| Tool | Description |
|---|---|
render_session_report |
Pre-formatted session cost report — used by /cf-session-management |
render_consumption_report |
Pre-formatted per-inference breakdown — used by /cf-session-consumption |
render_active_sessions |
Overview of recent sessions across projects — used by /cf-active-sessions |
Reports surface three orthogonal counts: prompts (what you typed), inferences (assistant replies — tool-loop sessions produce several per prompt), and tool calls (tool_use blocks). The triplet is identical across all three reports for the same session.
Analysis
| Tool | Description |
|---|---|
analyze_session |
Raw JSON session analysis (for custom UI, not skills) |
analyze_inferences |
Raw JSON per-inference breakdown (for custom UI, not skills) |
History
| Tool | Description |
|---|---|
telemetry_get_history |
Aggregate stats across logged sessions — cumulative cost, per-profile medians, insights |
Cost hook
The setup command installs a UserPromptSubmit hook into ~/.claude/settings.json. Every time you send a message, the hook reads the current session transcript, prices it against the live oracle, and injects a cost summary into Claude's context via additionalContext. Claude then appends a 💰 Compute.Finance · … line at the end of its response.
Guards — the hook fires only when all three conditions are met:
- Session cost exceeds $1
- Session has at least 5 user prompts
- At least 10 minutes since the last fire (per session)
On any failure (oracle down, transcript missing, parse error) the hook exits silently — it never blocks your prompt.
Manual installation
If setup can't write to settings.json, add the hook manually:
{
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "npx @compute-finance/mcp hook-prompt"
}
]
}
]
}
}
Uninstall
Remove the UserPromptSubmit entry from ~/.claude/settings.json.
Privacy
All data stays on your machine. The only network calls are unauthenticated GETs to api.compute.finance/v1/oracle/*. Session logs (~/.compute-finance/sessions.jsonl, ~/.compute-finance/inferences.jsonl) are never uploaded.
Links
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。