O
ondraulehla/mcpcost
Is that MCP server alive, and what does it cost your context window? Daily health and exact token cost of every server in the MCP registry.
无 SECURITY.md
在 GitHub 查看 ↗链接已于 2026-11-12 核查 · HTTP 200 · 打开的是厂商自己的官网
2026-11-14 实测:要求 Node >=22(2024-10 起为 LTS),仅提示,不算失败。
安装与配置
- 复制上面的命令
- 粘成
claude_desktop_config.json里mcpServers的一项(本地服务器用 command + args,示例见 客户端接法) - 重启客户端
远端端点(Claude Desktop / Cursor / Windsurf 共用 mcpServers)
{
"mcpServers": {
"ondraulehla-mcpcost": {
"url": "https://mcpcost.ulehla.dev/mcp"
}
}
}把这段粘进 Claude Desktop / Cursor 的 mcpServers 配置即可。端点来自公开证据,我们没有替你安装或托管它。 官方 Registry 记录:这个端点没有列出任何请求头。这不等于免密 —— 以项目文档为准。
VS Code(.vscode/mcp.json —— 键名是 servers,远程要 type: http)
{
"servers": {
"ondraulehla-mcpcost": {
"type": "http",
"url": "https://mcpcost.ulehla.dev/mcp"
}
}
}VS Code 的配置文件和另外三家不同:顶层键是 <code>servers</code>,远程端点还要写 <code>"type": "http"</code>。复制到 .vscode/mcp.json。
Claude Code(命令行)
claude mcp add --transport http ondraulehla-mcpcost https://mcpcost.ulehla.dev/mcp
Claude Code 不收 JSON 文件,用这条命令直接加。
客户端配置(取自该仓库的安装命令)
{
"mcpServers": {
"ondraulehla-mcpcost": {
"command": "npx",
"args": ["mcpcost"]
}
}
}解析自我们于 2026-10-26 抓取的该仓库 README;我们未执行过。
command/args 来自仓库写明的安装命令;不确定时请以该项目 README 为准。
VS Code(.vscode/mcp.json —— 键名是 servers)
{
"servers": {
"ondraulehla-mcpcost": {
"command": "npx",
"args": ["mcpcost"]
}
}
}VS Code 顶层键是 <code>servers</code>,其余与上面那份相同。
Claude Code(命令行)
claude mcp add --transport stdio ondraulehla-mcpcost -- npx mcpcost
Claude Code 不收 JSON 文件,用这条命令直接加。
配置项的键名以你的客户端为准:客户端与 CLI
- ★ 数取值
- 2 ★ · ondraulehla/mcpcost · 取自 GitHub 搜索 API · (2026-11-13 20:00:50 核对)
- 来源明细
- 收录自 punkpeye/awesome-mcp-servers 榜单(我们从中收集的条目之一) · 条目类型:MCP 服务
- 收录与活跃
- 收录于 2026-10-23 · 最近见到 2026-11-14 · 共见到 26 次 · 被 23 个来源列出
- 评分构成
- 综合分 2,300 · 2 ★ · 23 个来源 · mcp
- 安装
npx mcpcost
常见问题(答案都来自我们的记录)
怎么安装?
该仓库给出的安装命令是
npx mcpcost。我们的记录里它是仓库自己提供的;不保证在你的客户端上直接可用。它适合谁 / 用来做什么?
我们把它归在这些标签下: MCP 服务。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库
ondraulehla/mcpcost;我们收录于 2026-10-23;最近见到 2026-11-14。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。# mcpcost
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Is that MCP server alive, and what does it cost your context window?
Live board: mcpcost.ulehla.dev
mcpcost probes every remote server in the official MCP registry and records, for each one:
whether it answers initialize and tools/list, and how fast
the protocol version it negotiates
whether it needs auth, which scheme (from WWW-Authenticate), and how a client gets in: OAuth with dynamic client registration, OAuth with a client id from the publisher, or a key, read from the server's public OAuth metadata
whether it asks for payment (HTTP 402)
how many tools it has and how many tokens their definitions cost
## mcpcost: what do your own servers cost?
bash
npx mcpcost # reads Claude Code, Claude Desktop, Cursor, VS Code, Windsurf and Gemini CLI configs
npx mcpcost --config .mcp.json # one file
npx mcpcost --budget 30000 # exit 1 when the total is above the budget, for CI
npx mcpcost --claude # exact counts from the Anthropic counttokens endpoint (free, needs ANTHROPICAPIKEY)
npx mcpcost mcp # the same measurements as an MCP server over stdio, for your agent
It starts every configured server the way your client does, lists the tools and prints the token cost per server and in total. See packages/mcpcost.
### Servers that need auth
A server that answers 401 is reachable but not measured until it gets credentials. Store them once; every later measurement of that URL uses them.
bash
npx mcpcost auth https://mcp.linear.app/mcp # OAuth: register, consent in the browser, store the tokens
npx mcpcost auth https://api.githubcopilot.com/mcp/ --header "Authorization: Bearer ghp…" # an API key instead
npx mcpcost auth --list # what is stored, without the secrets
The OAuth flow follows the MCP authorization spec: discovery, dynamic client registration, PKCE, a callback on 127.0.0.1. The consent screen is the one step that needs a person. After it, the tokens live in ~/.mcpcost/credentials.json (mode 0600, or $MCPCOSTCREDENTIALS), npx mcpcost sends them for that URL, and a refreshed token goes back to the file.
The board does the same: npm run credentials:push copies the file into the D1 table credentials; the daily run reads it before the probe, writes the refreshed tokens back after it, and marks the server "measured with credentials". A refresh token that a service revokes or lets expire needs the consent step again.
Without credentials, the board still shows a tool set for many gated servers: tool definitions do not depend on the token, so when the publisher's repository holds a package on npm or PyPI, probe/derive-packages.ts finds it and the weekly container run measures it with placeholder values. The server page then says "from the publisher's package". probe/derived-aliases.json maps the few servers whose registry entry names no repository.
### In CI, as a GitHub Action
yaml
uses: ondraulehla/mcpcost@v1
with:
config: .mcp.json # one or more config files, one per line
budget: 30000 # fail when the tool definitions cost more than this
The job summary gets a table with every server, its result and its cost, plus the most expensive tools. A pull request that adds a 40 000-token server fails the check. Set claude: true and put ANTHROPICAPIKEY in env for exact counts from the free counttokens endpoint; the default is the o200kbase estimate. Outputs: tokens, servers, over-budget.
Live board: mcpcost.ulehla.dev
mcpcost probes every remote server in the official MCP registry and records, for each one:
whether it answers initialize and tools/list, and how fast
the protocol version it negotiates
whether it needs auth, which scheme (from WWW-Authenticate), and how a client gets in: OAuth with dynamic client registration, OAuth with a client id from the publisher, or a key, read from the server's public OAuth metadata
whether it asks for payment (HTTP 402)
how many tools it has and how many tokens their definitions cost
## mcpcost: what do your own servers cost?
bash
npx mcpcost # reads Claude Code, Claude Desktop, Cursor, VS Code, Windsurf and Gemini CLI configs
npx mcpcost --config .mcp.json # one file
npx mcpcost --budget 30000 # exit 1 when the total is above the budget, for CI
npx mcpcost --claude # exact counts from the Anthropic counttokens endpoint (free, needs ANTHROPICAPIKEY)
npx mcpcost mcp # the same measurements as an MCP server over stdio, for your agent
It starts every configured server the way your client does, lists the tools and prints the token cost per server and in total. See packages/mcpcost.
### Servers that need auth
A server that answers 401 is reachable but not measured until it gets credentials. Store them once; every later measurement of that URL uses them.
bash
npx mcpcost auth https://mcp.linear.app/mcp # OAuth: register, consent in the browser, store the tokens
npx mcpcost auth https://api.githubcopilot.com/mcp/ --header "Authorization: Bearer ghp…" # an API key instead
npx mcpcost auth --list # what is stored, without the secrets
The OAuth flow follows the MCP authorization spec: discovery, dynamic client registration, PKCE, a callback on 127.0.0.1. The consent screen is the one step that needs a person. After it, the tokens live in ~/.mcpcost/credentials.json (mode 0600, or $MCPCOSTCREDENTIALS), npx mcpcost sends them for that URL, and a refreshed token goes back to the file.
The board does the same: npm run credentials:push copies the file into the D1 table credentials; the daily run reads it before the probe, writes the refreshed tokens back after it, and marks the server "measured with credentials". A refresh token that a service revokes or lets expire needs the consent step again.
Without credentials, the board still shows a tool set for many gated servers: tool definitions do not depend on the token, so when the publisher's repository holds a package on npm or PyPI, probe/derive-packages.ts finds it and the weekly container run measures it with placeholder values. The server page then says "from the publisher's package". probe/derived-aliases.json maps the few servers whose registry entry names no repository.
### In CI, as a GitHub Action
yaml
uses: ondraulehla/mcpcost@v1
with:
config: .mcp.json # one or more config files, one per line
budget: 30000 # fail when the tool definitions cost more than this
The job summary gets a table with every server, its result and its cost, plus the most expensive tools. A pull request that adds a 40 000-token server fails the check. Set claude: true and put ANTHROPICAPIKEY in env for exact counts from the free counttokens endpoint; the default is the o200kbase estimate. Outputs: tokens, servers, over-budget.
收录徽章(可选)
想把收录标记放进 README 就复制这行,可选,不影响收录。
[](https://anclum.com/zh/s/ondraulehla-mcpcost/)
- 来源
- awesome · https://github.com/ondraulehla/mcpcost
- 按领域浏览
- MCP 服务
- Traction
- 2 ★
- 收录来源
- 23 个独立来源
- 收录于
- 今天
- 安全策略
- 我们没在该仓库根目录找到
SECURITY.md(这不代表不安全)
同类推荐
所属领域与标签
每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。