ai-price-index-mcp

ai-price-index-mcp

Enables coding agents to query AI model API prices, including historical point-in-time lookups with cited sources, using a bundled dated dataset and requiring no API keys.

Category
访问服务器

README

ai-price-index-mcp

A read-only, zero-key Model Context Protocol server that lets a coding agent (Claude Code, Cursor, and any other MCP client) query the open AI Price Index: dated, first-party-sourced AI model API prices.

Most pricing tools tell an agent what a model costs today. This one also answers what a model cost on a given date, and returns the first-party source URL plus the date that price was last validated, so the agent can cite the number. That point-in-time lookup is the differentiator.

  • Zero keys, zero prompts, zero network at runtime. The dated dataset is bundled inline inside the ai-price-index dependency. The server reads it locally and adds nothing to your traffic.
  • Read-only. It only looks prices up. It cannot write, configure, or call out.
  • Cite-ready. Every result carries source_url, last_validated, confidence, and the CC BY 4.0 attribution string.

Install

Requires Node.js 18 or newer. No build step, no API key.

npx -y ai-price-index-mcp

That command runs the stdio server; an MCP client launches it for you using the config below.

Client configuration

Drop this into your MCP client config. The server speaks stdio.

Claude Code (~/.claude.json or a project .mcp.json), and Cursor (~/.cursor/mcp.json), use the same mcpServers shape:

{
  "mcpServers": {
    "ai-price-index": {
      "command": "npx",
      "args": ["-y", "ai-price-index-mcp"]
    }
  }
}

Or, with Claude Code's CLI:

claude mcp add ai-price-index -- npx -y ai-price-index-mcp

Tools

All tools return structured JSON as text content. Prices are usd_per_mtok (USD per million tokens). Model ids resolve through the dataset's aliases, so short ids work (e.g. claude-opus-4-5 resolves to claude-opus-4-5-20251101).

Tool Arguments Returns
current_price model, provider? Today's input/output price for a model, with its source.
price_on model, date (YYYY-MM-DD), provider? The price in effect on that date (the point-in-time lookup).
compare models[], date? Side-by-side input/output prices for several models on one date.
cost_from_usage model, tokens, date?, provider? USD value of a token rollup at a point in time, with cache multipliers.
list_models provider? Known model ids (optionally one provider), each with its aliases.

tokens for cost_from_usage accepts input, output, cache_read, cache_write_5m, cache_write_1h (all optional, missing counts as 0). Cache read is 0.1x input, cache write is 1.25x (5 minute) or 2x (1 hour).

Pass provider (for example openai, anthropic, google) to disambiguate a bare id that exists under more than one vendor.

Example result

price_on with { "model": "gpt-4", "date": "2024-01-01" }:

{
  "query": "gpt-4",
  "provider": "openai",
  "model": "gpt-4",
  "date": "2024-01-01",
  "covered": true,
  "input": {
    "usd_per_mtok": 30,
    "unit": "usd_per_mtok",
    "effective_from": "2023-03-14",
    "effective_to": null,
    "last_validated": "2023-04-15",
    "confidence": "archived",
    "source_url": "https://web.archive.org/web/20230415223802/https://openai.com/pricing"
  },
  "output": { "usd_per_mtok": 60, "...": "..." },
  "provenance": {
    "dataset": "AI Price Index by RoninForge",
    "data_version": "2026-06-17",
    "license": "CC-BY-4.0",
    "attribution": "AI Price Index by RoninForge (https://roninforge.org/data/ai-price-index/), CC BY 4.0",
    "source": "https://roninforge.org/data/ai-price-index/"
  }
}

How it works

This server is a thin wrapper over the ai-price-index npm library, which ships the dated dataset bundled inline. There is no pricing logic, no separate data layer, and no network call here. The data version a result reports is the dataset release that the installed ai-price-index pins to. To move to newer prices, update that dependency.

Data license and attribution

The price data is from the AI Price Index and is licensed CC BY 4.0. When you publish anything derived from it, attribute it:

AI Price Index by RoninForge (https://roninforge.org/data/ai-price-index/), CC BY 4.0.

The code of this server is licensed MIT (see LICENSE). Data and tooling licenses are tracked upstream in the ai-price-index repository.

Links

  • Data page: https://roninforge.org/data/ai-price-index/
  • Library: https://www.npmjs.com/package/ai-price-index
  • Dataset repo: https://github.com/RoninForge/ai-price-index
  • DOI: https://doi.org/10.5281/zenodo.20730241

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选