tokenslim-mcp
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., "@tokenslim-mcpcompress this text to reduce token usage"
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.
tokenslim-mcp
MCP server exposing the tokenslim
context-compression engine to any MCP host (Claude Code, Cursor, …). Stdio
transport, built on the official Python mcp SDK (FastMCP).
Tools
Tool | Args | Returns |
|
| Compressed text, CCR |
|
|
|
| — | Cumulative session savings: |
content_type is an advisory hint echoed back; the core auto-detects the real
type (JSON / log / code / diff / search / markdown / text) and picks a compressor.
Related MCP server: claw-tsaver
Install & register
pip install -e . # pulls the tokenslim core via gitRegister as a stdio MCP server. Example (Claude Code mcpServers):
{
"mcpServers": {
"tokenslim": { "command": "tokenslim-mcp" }
}
}or run directly: tokenslim-mcp / python -m tokenslim_mcp.
How it works
Each tokenslim_compress call wraps the blob as a one-message array, runs it
through the core compress() (with min_bytes=0 so single blobs always get
compressed), and returns the rewritten text plus token stats. The original is
stored under its tokenslim.ccr.content_hash so tokenslim_retrieve can return
it verbatim. tokenslim_stats reports the running total.
Development
pip install -e ".[dev]"
ruff check .
python -m pytest -qTests call the tool handlers directly and exercise the FastMCP dispatch — no live MCP host or API keys required.
Known gaps
Retrieval store is in-process. The core ships CCR markers +
content_hashbut not yet aretrieve()/ persistent store onmain, so retrieval is backed by a per-session dict populated bytokenslim_compress. Hashes already use the core'scontent_hash, so this will switch to the core CCR store once merged (TODO(core-ccr)inengine.py). A hash from a previous process (or another server instance) will reportfound: false.Compression depth is whatever the core provides; this server adds no algorithms of its own.
License
Apache-2.0
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/robertruben98/tokenslim-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server