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.
no SECURITY.md
View on GitHub ↗Link checked 2026-11-12 · HTTP 200 · opens the vendor's own site
checked 2026-11-14 — requires Node >=22 (LTS since Oct 2024); a note, not a failure.
Install & config
- Copy the command above
- Paste it as one entry under
mcpServersinclaude_desktop_config.json— local servers take command + args (example: clients) - Restart your client
Remote endpoint (mcpServers - Claude Desktop / Cursor / Windsurf)
{
"mcpServers": {
"ondraulehla-mcpcost": {
"url": "https://mcpcost.ulehla.dev/mcp"
}
}
}Paste this into the mcpServers config of Claude Desktop or Cursor. The endpoint comes from public evidence; we do not install or host it. Official Registry record: this endpoint lists no request headers. That is not the same as key-free - the project docs decide.
VS Code (.vscode/mcp.json - the key is servers, remote needs type: http)
{
"servers": {
"ondraulehla-mcpcost": {
"type": "http",
"url": "https://mcpcost.ulehla.dev/mcp"
}
}
}VS Code differs from the other three: the top-level key is <code>servers</code> and a remote endpoint also needs <code>"type": "http"</code>. Paste into .vscode/mcp.json.
Claude Code (command line)
claude mcp add --transport http ondraulehla-mcpcost https://mcpcost.ulehla.dev/mcp
Claude Code does not read a config file; add the server with this command.
Client config (built from the install command this repo gives)
{
"mcpServers": {
"ondraulehla-mcpcost": {
"command": "npx",
"args": ["mcpcost"]
}
}
}Parsed from the README we fetched on 2026-10-26; we have not executed it.
command/args come from the install command the repository states. When it is ambiguous, the project README wins.
VS Code (.vscode/mcp.json - the key is servers)
{
"servers": {
"ondraulehla-mcpcost": {
"command": "npx",
"args": ["mcpcost"]
}
}
}Same server, but VS Code keeps it under <code>servers</code>.
Claude Code (command line)
claude mcp add --transport stdio ondraulehla-mcpcost -- npx mcpcost
Claude Code does not read a config file; add the server with this command.
Key names differ by client: Clients & CLI
- Star count
- 2 ★ · ondraulehla/mcpcost · read from the GitHub search API · (checked 2026-11-13 20:00:50)
- Source
- collected from the punkpeye/awesome-mcp-servers list · type: MCP server
- Harvest history
- first seen 2026-10-23 · last seen 2026-11-14 · seen 26× · listed by 23 sources
- Score
- score 2,300 · 2 ★ · 23 sources · mcp
- Install
npx mcpcost
FAQ (answers come from our records)
How do I install it?
The repository provides this install command:
npx mcpcost. It comes from the repository itself; we cannot guarantee it runs as-is in your client.Who is it for?
We filed it under these tags: MCP 服务. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository
ondraulehla/mcpcost;first catalogued 2026-10-23;last seen 2026-11-14。There is no official certification or quality rating here — we record sources and dates only.# 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.
Listed badge (optional)
Copy this line into the README if you want the listing mark. Optional, and it does not affect being listed.
[](https://anclum.com/en/s/ondraulehla-mcpcost/)
- Source
- awesome · https://github.com/ondraulehla/mcpcost
- Browse by field
- MCP servers
- Traction
- 2 ★
- Listed by
- 23 independent sources
- added
- today
- Security policy
- no
SECURITY.mdat the repository root (which does not mean it is unsafe)
More like this
Filed under
Every tag opens the full list for that filter. Counts are the live catalogue figures.