Skip to main content

Ultra-light MCP server for inspecting tool-definition token cost. Plug it into your agent harness.

Project description

mcptokens

Ultra-light MCP server for inspecting tool-definition token cost. Plug it into your agent harness.

pip install mcptokens

What this is

mcptokens is an MCP server. Add a one-line entry to your agent's MCP config (Claude Code, Pi, OpenCode, ...) and the agent gains one tool: inspect. Call it with any MCP server's argv; receive its token cost back. Use BEFORE enabling an MCP server so the agent can decide whether the cost is worth it.

The product is the MCP tool definition. Nothing else ships.

Constraint

The whole point of mcptokens is that it doesn't eat many tokens of its own. The shipped tool definition, tokenized under cl100k_base, MUST stay under 1000 tokens. If a future refactor blows the budget, an import-time RuntimeError fires. This constraint is non-negotiable; tests pin it.

Status

0.1.0 is the first version. See CHANGELOG.md once we ship. For the goal articulation and the design constraints that drive this package, see ~/.pi/agent/workspace/Chatgpt pro subscription/contextlens/project.md (in this operator's workspace, not the published repo).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcptokens-0.1.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcptokens-0.1.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file mcptokens-0.1.0.tar.gz.

File metadata

  • Download URL: mcptokens-0.1.0.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for mcptokens-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ea8828ef4338c52c1ebf5948da13e7fd8cf1ebbea6ced8f144d404ae7eb87529
MD5 d4fc17bf1e900d8c2797f18498851f39
BLAKE2b-256 32384384ae55f4d179b0b30dd40328ade29428dd6d85a0c0e5f52e973e19670b

See more details on using hashes here.

File details

Details for the file mcptokens-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mcptokens-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for mcptokens-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d05a02cda6eadffb782d7b766b4ffb98928c848216877c923f4e07619eac772
MD5 d4ac1812bb98ef9d8d46236643c224de
BLAKE2b-256 c8225338e80f2ea7b3dd8e8c5f5659da618e2643f6831bc1779403e64fe8aac4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page