tokenslim-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
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: TokenSkein
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
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Compress coding-agent context ~64%. Hosted Neural Keep MCP for Cursor/Claude/Codex.
Compress prose for LLM context windows. Per-call USDC billing, signed receipt.
A paid remote MCP for OpenAI Codex context compressor, built to return verdicts, receipts, usage log
Compact WebVTT/SRT transcripts, .eml email threads, Slack exports & Jira ADF JSON by 65-90%.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables local-first context compression for AI agents, offering tools to compress text, retrieve original content, and get compression statistics.MIT
- AlicenseNot gradedqualityDmaintenanceProvides compression, retrieval, and statistics for local context-economy when interacting with GPT/Codex, enabling efficient token usage and exact recovery of compacted content.3Apache 2.0
- AlicenseAqualityCmaintenanceProvides reversible context compression for AI agents, reducing token usage while preserving the ability to retrieve original content, and serves as an MCP server for integration with tools like GitHub Copilot and Claude Code.31Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables clients to compress code, command output, conversations, JSON, and MCP schemas on demand, expand compressed originals by hash, inspect compression statistics, and manage token budgets through MCP tools.19 npm9MIT