prompt-compressor-mcp

v1.0.4
prompt-compressor-mcp Checked 4 days ago Published 1 day ago

MCP server for rule-based prompt compression — cut LLM token usage without a model, without an API, without sending data anywhere.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

compress_prompt Compress prompt

Compress a prompt, system prompt, or context block to use fewer tokens, using deterministic rule-based algorithms (no LLM call). Template variables like {{name}} and {var} are preserved. Returns the compressed text and token stats.

ParameterTypeDescription
text *stringThe text to compress.
levelstringRisk level. 'none' = whitespace/unicode only; 'very-low' = + filler, phrases, JSON/SQL minify; 'low' = + hedging, comments, dedup (recommended); 'medium' = + near-duplicate removal and light summariza…

compress_file Compress file

Read a local text file (prompt, docs, logs, JSON, code) and return a compressed version with token stats. Does not modify the file.

ParameterTypeDescription
path *stringAbsolute path to a local text file.
levelstringRisk level. 'none' = whitespace/unicode only; 'very-low' = + filler, phrases, JSON/SQL minify; 'low' = + hedging, comments, dedup (recommended); 'medium' = + near-duplicate removal and light summariza…

compare_levels Compare compression levels

Run every risk level on the same text and report token savings for each, so you can pick the right trade-off.

ParameterTypeDescription
text *stringThe text to analyze.

estimate_tokens Estimate tokens

Estimate the token count of a text (fast heuristic, no tokenizer download).

ParameterTypeDescription
text *stringThe text to measure.