MCP.Market

Token Compressor MCP server

by base76-research-lab·io.github.base76-research-lab/token-compressor·v0.1.1·11 stars

Compress prompts 40-60% using local LLM + embedding validation. Preserves all conditionals.

B72/100grade B
What users say
No reviews yet
Be the first
Safety scan
B72/100

full report

Adoption
New

11 stars

Reviews

Write one

Nobody has reviewed Token Compressor yet.

If you have run it, two minutes of your experience saves the next person an afternoon.

Token Compressor tools

No tool declarations could be read from the package source. They show once the server is installed.

Public scan report

scanner v0.1.10 · 2026-09-28 · same rubric, same numbers if you re-run it

no findings
  • Code scan8 source files scanned25/25
  • –Live reliabilityno gateway calls yet and no remote to proben/a
  • –Tool poisoningtools not inspected (local package is not executed); not countedn/a
  • Auth qualitylocal package, no credentials required12/15
  • Maintenancelast push 204 days ago4/15
  • Maintainer identityregistry namespace matches repository owner6/10
Overall 72/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

How Token Compressor compares

Against every graded AI and agents MCP server, from our own scans and uptime checks. Updated after each scan run.

Safety score
72/100
higher than 40% of 4,460 AI and agents servers
GitHub stars
11
more than 85% of 2,711 AI and agents servers

Install Token Compressor in Claude Code, Cursor or VS Code

claude mcp add token-compressor -- uvx token-compressor-mcp
Add to Cursor

What the publisher says

From the Token Compressor repository's README, as published. We do not edit it. Read it on GitHub

token-compressor

Reduce LLM prompt tokens by 30–70% while preserving semantic meaning.

mcp-name: io.github.base76-research-lab/token-compressor

Semantic prompt compression for LLM workflows. Reduce token usage by 40–60% without losing meaning.

Built by Base76 Research Lab — research into epistemic AI architecture.

Live demo

Intent Compiler MVP is now live and uses this project as part of the idea -> spec -> compressed output flow:

  • Live: https://intent-compiler-mvp.pages.dev
  • Product repo: https://github.com/base76-research-lab/token-compressor

What it does

token-compressor is a two-stage pipeline that compresses prompts before they reach an LLM:

  1. LLM compression — a local model (llama3.2:1b via Ollama) rewrites the prompt to its semantic minimum, preserving all conditionals and negations
  2. Embedding validation — cosine similarity between original and compressed embeddings must exceed a threshold (default: 0.85) — if not, the original is sent unchanged

The result: shorter prompts, lower costs, same intent.

Input prompt (300 tokens)
        ↓
  LLM compresses
        ↓
  Embedding validates (cosine ≥ 0.85?)
        ↓
  Pass → compressed (120 tokens)   Fail → original (300 tokens)

Key design principle: conditionality is never sacrificed. If your prompt says "only do X if Y", that constraint survives compression.

Requirements

  • Python 3.10+
  • Ollama running locally
  • Two models pulled:
ollama pull llama3.2:1b
ollama pull nomic-embed-text
  • Python dependencies:
pip install ollama numpy

Quick start

from compressor import LLMCompressEmbedValidate

pipeline = LLMCompressEmbedValidate()
result = pipeline.process("Your prompt text here...")

print(result.output_text)   # compressed (or original if validation failed)
print(result.report())      # MODE / COVERAGE / TOKENS saved

Result object:

CLI usage

echo "Your long prompt here..." | python3 cli.py

Output: compressed text on stdout, stats on stderr.

Claude Code hook (recommended setup)

Add to your ~/.claude/settings.json under hooks → UserPromptSubmit:

{
  "type": "command",
  "command": "echo \"${CLAUDE_USER_PROMPT:-}\" | python3 /path/to/token-compressor/cli.py > /tmp/compressed_prompt.txt 2>/tmp/compress.log || true"
}

This runs on every prompt submission and writes the compressed version to a temp file, which can be injected back into context via a second hook or MCP server.

MCP server

The MCP server exposes compression as a tool callable from Claude Code and any MCP-compatible client.

Install:

pip install token-compressor-mcp

Tool: compress_prompt

  • Input: text (string)
  • Output: compressed text + stats footer

Claude Code MCP config (~/.claude/settings.json):

{
  "mcpServers": {
    "token-compressor": {
      "command": "uvx",
      "args": ["token-compressor-mcp"]
    }
  }
}

Or from source:

{
  "mcpServers": {
    "token-compressor": {
      "command": "python3",
      "args": ["-m", "token_compressor_mcp"],
      "cwd": "/path/to/token-compressor"
    }
  }
}

Configuration

Shortened. The full README is on GitHub.

Nothing above is checked by us. What we check is on the safety report.

Token Compressor: common questions

Is Token Compressor MCP server safe?
Mostly: it is graded B (72/100). Read the Token Compressor safety report
How do I install Token Compressor?
It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
Does Token Compressor need an API key?
Not as far as the registry entry and our scan can tell: no credentials are declared or required.
Is Token Compressor maintained?
The last commit was 241 days ago (2026-03-08). The latest release is v0.1.1.
What can I use instead of Token Compressor?
Servers from other publishers that do the same job: llmtrim MCP server, Commonly MCP server and Agent-Native Analytics MCP server.
How does Token Compressor compare with other AI and agents MCP servers?
safety score 72/100 (higher than 40% of 4,460 AI and agents servers); github stars 11 (more than 85% of 2,711 AI and agents servers). Full comparison.

Alternatives to Token Compressor

Same job from other publishers: the closest match first, then the best rated.

  • llmtrim
    MCP server and proxy that compresses LLM prompts, tool output, and replies to cut token cost.
    A
  • Commonly
    Read Commonly pods and post as a Commonly agent you create, with a token from your Commonly account.
    A
  • Agent-Native Analytics
    Agent-Native Amplitude/Mixpanel - connect data sources, prompt for charts
    A
  • SuperCompress
    Compress coding-agent context ~64%. Hosted Neural Keep MCP for Cursor/Claude/Codex.
    B
  • mcptoon
    MCP tools + agent skills in one zero-dependency CLI: 71,929 -> 581 tokens (-99.2%, measured).
    A

More from base76-research-lab →