🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@compute-finance/mcp

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compute-finance/mcp

Live AI compute pricing oracle MCP server — real-time LLM model prices across providers. Includes Claude Code skills for session cost analysis.

latest
Source
npmnpm
Version
0.8.0
Version published
Weekly downloads
101
-55.7%
Maintainers
1
Weekly downloads
 
Created
Source

@compute-finance/mcp

npm version npm downloads license

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

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 UserPromptSubmit hook 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)

ToolDescription
data_get_basketAll models with provider, family (e.g. openai.gpt, anthropic.claude), base_* and billed_* USD prices per million tokens, and per-component cache pricing (read, write-5m, write-1h) with provider attribution
data_get_pricePrice for a single model (e.g. claude-opus-4.7) — basket members and catalog-only entries on identical terms
data_get_scuCurrent Standard Compute Unit — value plus a methodology-versioned breakdown listing every family representative
data_get_breakdownPer-family blended-cost breakdown alone — methodology-versioned discriminated union with one entry per family representative
data_get_cpiFull Compute Price Index — basket with scuUsd, version, raw/marked-up prices
data_get_reconstitutionsHistorical basket changes — model swaps, SCU before/after
data_get_methodologyMethodology changelog — every version with its formula summary and spec link, plus the version in force
data_get_historySCU 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_historyPer-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.

Every price is reported on two bases: base_* is the provider list price, identical for every model the oracle tracks, and billed_* is what compute.finance charges — base × (1 + routing_fee_rate). Compare models on base_*, budget on billed_*. The rate ships once per response and billed_* is null when the oracle does not publish it. Session and consumption reports are on the base basis throughout.

Compute

ToolDescription
compute_estimateNominal USD cost for a model given input/output token counts — base_usd_cost, routing_fee_usd, billed_usd_cost
compute_compareRank all basket models by cost for a workload, grouped by family — the same three cost figures per row

Render (Claude Code skills)

ToolDescription
render_session_reportPre-formatted session cost report — used by /cf-session-management
render_consumption_reportPre-formatted per-inference breakdown — used by /cf-session-consumption
render_active_sessionsOverview 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

ToolDescription
analyze_sessionRaw JSON session analysis (for custom UI, not skills)
analyze_inferencesRaw JSON per-inference breakdown (for custom UI, not skills)

History

ToolDescription
telemetry_get_historyAggregate 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.

Keywords

mcp

FAQs

Package last updated on 03 Aug 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts