Tokencost Dev

io.github.jeff-atriumn由 GitHub 账号 jeff-atriumn 发布v0.1.3更新于 Oct 24, 2026

LLM pricing oracle — model lookup, cost estimation, and comparison via LiteLLM

已验证STDIO仅桌面金融AI 与机器学习

概览

AI 生成的概览

本地 MCP 服务器,为助手提供 LLM 价格数据:模型查询、token 成本估算与按成本比较模型,数据来自 LiteLLM。

可以做什么
  • 查询模型的每 token 价格、上下文窗口与能力,支持模糊名称匹配
  • 估算指定输入与输出 token 数量下的模型成本
  • 按性价比比较模型,可按提供商与模式筛选
  • 强制刷新本地缓存的价格数据
适用场景
适合需要快速获得 LLM API 价格答案、估算某段提示或工作负载的预算,或在不离开助手的情况下挑选满足需求的最便宜模型。
运行要求
通过 npx 作为本地进程运行(需要 Node.js)。无需 API 密钥、账号或配置文件;价格数据从 LiteLLM 社区注册表获取并在本地缓存 24 小时,因此获取和刷新时需要网络访问。
安装前请注意
价格来自 LiteLLM 社区注册表,可能滞后于官方定价,用于计费决策前应核实。该服务器会通过网络从第三方注册表获取数据。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Tokencost Dev,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[图片]

tokencost

[npm version] [npm downloads] [CI status] [license]

Ask your AI assistant "how much does GPT-4o cost?" — get an instant, accurate answer.


[tokencost demo in Claude Code]

Install in 30 seconds

Claude Code:

bash
claude mcp add tokencost-dev -- npx -y tokencost-dev

Then ask: "How much would 1M input tokens cost on claude-sonnet-4-5?"

Cursor (.cursor/mcp.json):

json
{  "mcpServers": {    "tokencost-dev": {      "command": "npx",      "args": ["-y", "tokencost-dev"]    }  }}

No API keys. No accounts. No configuration files. Pricing data is fetched from the LiteLLM community registry and cached locally for 24 hours.

Tools

get_model_details

Look up pricing, context window, and capabilities for any model. Fuzzy matching means "sonnet 4.5" works just as well as "claude-sonnet-4-5-20250514".

> "What are Claude Sonnet 4.5's pricing and capabilities?"
Model: claude-sonnet-4-5Provider: anthropic | Mode: chat
Pricing (per 1M tokens):  Input:  $3.00  Output: $15.00
Context Window:  Max Input:  200K  Max Output: 8K
Capabilities: vision, function_calling, parallel_function_calling

calculate_estimate

Estimate cost for a given number of input and output tokens.

> "How much will 1000 input + 500 output tokens cost on Claude Sonnet 4.5?"
Cost Estimate for claude-sonnet-4-5
  Input:  1K tokens × $3.00/1M  = $0.003000  Output: 500 tokens × $15.00/1M = $0.007500  ─────────────────────────────  Total:  $0.0105

compare_models

Find the most cost-effective models matching your requirements.

> "What are the cheapest OpenAI chat models?"
Top 2 most cost-effective models (provider: openai) (mode: chat):
1. gpt-4o-mini   Provider: openai | Mode: chat   Input: $0.15/1M | Output: $0.60/1M   Context: 128K in / 16K out
2. gpt-4o   Provider: openai | Mode: chat   Input: $5.00/1M | Output: $15.00/1M   Context: 128K in / 16K out

refresh_prices

Force re-fetch pricing data from the LiteLLM registry (cache is refreshed automatically every 24h).

Docs

Full documentation at tokencost.dev

License

MIT

来源:README.md,提交 adb73fc

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.3最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分