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
172 tokens in your agent's harness. One tool, inspect, that
counts the tool-definition cost of any other MCP server 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: Agent MCP Gateway
How
Add mcptokens to your agent's MCP config (Claude Code, Pi,
OpenCode, Codex, ...). The agent gains one tool:
{
"name": "inspect",
"description": "Count tool-def tokens of any MCP server. Pass argv [...]",
"inputSchema": {
"properties": {
"command": {"type": "array", "items": {"type": "string"}},
"encoding": {"type": "string", "enum": ["cl100k_base","o200k_base"], "default": "cl100k_base"},
"timeout": {"type": "number", "default": 15, "minimum": 1, "maximum": 60}
},
"required": ["command"]
}
}The agent calls:
inspect(command=["python", "-m", "some_mcp_server"])The agent decides whether to enable the candidate server based on the answer.
The numbers
Self-cost on wire | 172 tokens of |
Tools exposed | 1, named |
Cross-platform | Linux, macOS, Windows |
Python | 3.11+ |
Imports |
|
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 |
Why it's cheap
One server, one tool, tight description, minimal schema. The shipped tool definition tokenizes to 172 tokens. A small tool list is the product.
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.
Latest Blog Posts
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