Metadata-Version: 2.4
Name: mcptokens
Version: 0.1.0
Summary: Ultra-light MCP server for inspecting tool-definition token cost. Plug it into your agent harness.
Project-URL: Repository, https://github.com/dondai1234/contextlens
Project-URL: Issues, https://github.com/dondai1234/contextlens/issues
Project-URL: Changelog, https://github.com/dondai1234/contextlens/blob/master/CHANGELOG.md
Author-email: Bishesh Bhandari <bishesh@master-fetch.dev>
License: MIT
License-File: LICENSE
Keywords: ai-agent,context,inspect,mcp,tokens
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Requires-Dist: mcp[cli]>=1.0
Requires-Dist: tiktoken>=0.7
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
Requires-Dist: pytest-mock>=3.14; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# mcptokens

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

```bash
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).
