mcptokens
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcptokenshow many tokens does the weather server use?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcptokens
375 tokens in your agent's harness. One tool, inspect, that
counts the tool-definition cost of any other MCP server (stdio or
Streamable HTTP) before you enable it.
pip install mcptokensWhy
When your agent enables a new MCP server, its tools enter the
agent's context on every turn. The cost compounds fast. mcptokens
lets the agent ask is this server cheap enough? before flipping
the switch.
Related MCP server: mcp-compressor
Transports
Same tool, same response shape:
stdio (default): spawn a local process and speak JSON-RPC on its stdin/stdout.
streamable_http: POST
initializeandtools/listto a remote MCP endpoint per MCP 2025-03-26. Server may reply viaapplication/json(one message) ortext/event-stream.
How
Add mcptokens to your agent's MCP config (Claude Code, Pi,
OpenCode, Codex, ...). The agent gains one tool:
inspect(command=["python", "-m", "some_mcp_server"])
# stdio spawn argv, same as your MCP config
inspect(command=["hound"])
# pre-installed binary
inspect(
transport="streamable_http",
url="http://localhost:8080/mcp",
headers={"Authorization": "Bearer ..."}, # optional
)
# remote MCP server
# Returns the same JSON shape every call:
# {ok, server, tool_count, wire_total_tokens,
# tools: [{name, total}], encoding, elapsed_ms, version}wire_total_tokens is the number to report. Use it BEFORE
enabling a candidate server: a large value means don't enable.
The numbers
Self-cost on wire | 375 tokens of |
Tools exposed | 1, named |
Transports | stdio, streamable_http |
Cross-platform | Linux, macOS, Windows |
Python | 3.11+ |
Imports | stdlib, |
Install
pip install mcptokensAdd mcptokens to your agent's mcpServers / mcp_servers. Done.
CLI (debug surface)
mcptokens python -m some_mcp_server # human table
mcptokens --json python -m some_mcp_server # pipeline-friendly JSON
mcptokens --timeout 30 python -m srv # custom spawn, custom timeout
mcptokens serve # run as an MCP serverFlag | Default | Purpose |
|
|
|
|
| Per-server timeout in seconds (1 to 60) |
|
| Output JSON instead of the table |
License
MIT. pip install mcptokens from the canonical PyPI index.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityCmaintenanceProvides per-Subagent MCP controls to any coding agent or client across all your MCPs and prevents context window waste. Loads only 3 tools instead of all your MCP Server's tool definitions. Agents discover tools on-demand, only when needed and only the servers and tools they are allowed.Last updated441MIT
- Alicense-qualityAmaintenanceA proxy server that wraps existing MCP servers to significantly reduce token consumption by compressing tool descriptions into a two-step interface. It enables users to integrate extensive toolsets without exceeding context limits or incurring high API costs.Last updated104Apache 2.0
- AlicenseAqualityBmaintenanceToken-cost telemetry for OpenClaw, queryable from Claude or any MCP-aware agent. Provides per-agent and per-provider cost attribution, anomaly detection, model-routing recommendations, and 30-day forecasts.Last updated7MIT
- Alicense-qualityAmaintenanceEnables AI agents to self-audit their token usage and costs, providing burn reports, forensics, and optimization recommendations via MCP.Last updated6MIT
Related MCP Connectors
327 tools, 92 providers. Pay per call via x402 + MPP. One MCP endpoint.
Free MCP tools: the only MCP linter, health checks, cost estimation, and trust evaluation.
See, price, and control every tool call your AI agents make: policy checks, cost, and audit tools.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/dondai1234/mcptokens'
If you have feedback or need assistance with the MCP directory API, please join our Discord server