CompactPrompt MCP server
io.github.gtkcyber/compactprompt·v0.5.2Review and compact prompts, docs, and AI-agent skills to save tokens, preserving structure.
0 stars
Reviews
Write oneNobody has reviewed CompactPrompt yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
CompactPrompt tools (4)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
compactCompact a markdown file or skill. Dry run unless ``apply`` is true.
compact_promptShorten a prompt string while preserving meaning.
count_tokensCount the tokens in a piece of text (the unit LLMs bill by).
reviewReview a markdown/text file for compaction opportunities (read-only).
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan24 source files scanned20/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 65 days ago12/15
- Maintainer identityregistry namespace matches repository owner; GitHub account older than a year9/10
Findings (1)
- mediumeval / new Function used
exec.evalcompactprompt-0.5.2/compactprompt/scoring.py: …ed(self.model_name) self._model.eval() if self._device: s…
How CompactPrompt compares
Against every graded Productivity MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 82/100
- higher than 58% of 1,299 Productivity servers
- Tools
- 4
- the typical Productivity server has 7
- Tools that change things
- 0%
- typical: 0%. Fewer write tools means less an agent can break
What its tools let an agent do: 4 read
Install CompactPrompt in Claude Code, Cursor or VS Code
claude mcp add compactprompt -- uvx compactprompt
What the publisher says
From the CompactPrompt repository's README, as published. We do not edit it. Read it on GitHub
CompactPrompt
CompactPrompt shortens the text you send to an AI model while preserving its meaning. The result costs less to run, returns faster, and is less likely to exceed the model's input limit. The common case is a single function call, and no background in machine learning is required to use it.
Background
An AI model reads an input — the prompt — and returns a response. Providers charge according to the amount of text processed, measured in tokens (each token is roughly three-quarters of a word), and every model has a maximum input size. A long prompt that combines instructions, documents, tables, and examples therefore costs more, responds more slowly, and may not fit at all.
CompactPrompt reduces the size of a prompt while retaining the information that matters, so you keep the substance and discard the overhead.
Getting started
Install the library:
pip install compactpromptShorten a prompt:
from compactprompt import CompactPrompt
result = CompactPrompt.compact(
"Please could you very kindly go ahead and provide a really concise "
"summary of the quarterly report."
)
print(result.text)
print(f"{result.ratio:.1f}x smaller "
f"({result.tokens_before} -> {result.tokens_after} tokens)")Output:
a really concise summary of the quarterly report.
1.7x smaller (22 -> 13 tokens)The filler — "Please could you very kindly go ahead and" — is removed, and the meaning is unchanged.
What it does
CompactPrompt provides several methods for reducing the size of a prompt. They can be used individually or together. Each is described below in plain terms, followed by an optional technical note.
Trimming low-value wording
Removes words that carry little meaning, such as conversational filler, and keeps the words that do. This is lossy: the removed words are not recoverable, but the result is ready to use as it is.
from compactprompt import CompactPrompt
# Remove approximately 40% of the tokens
result = CompactPrompt.compact(prompt, ratio=0.4)
# Or target a specific size
result = CompactPrompt.compact(prompt, budget=64)Technical detail
Each word receives an information score that combines how rare it is in general (static self-information) with how predictable it is in context (dynamic self-information from a small language model). Low-scoring words are removed. Whole grammatical phrases are removed together, using spaCy, so the result remains readable, and names and numbers are protected. This implements the fusion rule from the CompactPrompt paper.
Reversible shortening of repeated phrases
When a phrase recurs, it is replaced with a short placeholder, and a key records what each placeholder stands for. This is lossless: the exact original can be restored at any time.
import compactprompt as cp
doc = "operating cash flow rose. operating cash flow fell. operating cash flow held."
abbr = cp.abbreviate(doc, n=3)
print(abbr.text) # '@0 rose. @0 fell. @0 held.'
print(abbr.dictionary) # {'@0': 'operating cash flow'}
print(abbr.restore()) # the exact originalRetain abbr.dictionary so the placeholders can be expanded again later.
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
CompactPrompt: common questions
- Is CompactPrompt MCP server safe?
- Mostly: it is graded B (82/100). Read the CompactPrompt safety report
- How do I install CompactPrompt?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does CompactPrompt need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is CompactPrompt maintained?
- The last commit was 103 days ago (2026-07-24). The latest release is v0.5.2.
- What can I use instead of CompactPrompt?
- Servers from other publishers that do the same job: Mdma MCP server, GodPrompt MCP Server and Context7 MCP server.
- How does CompactPrompt compare with other Productivity MCP servers?
- safety score 82/100 (higher than 58% of 1,299 Productivity servers); tools 4 (the typical Productivity server has 7); tools that change things 0% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to CompactPrompt
Same job from other publishers: the closest match first, then the best rated.
- MdmaMCP server for MDMA — exposes spec, prompts, docs, and package metadata to AI assistants.not reviewedGrowingA
GodPrompt MCP ServerGodPrompt MCP + Agent Skill for coding agents with TDD, debugging, verification, and task routing.not reviewedGrowingA
Context7Up-to-date docs for AI agentsnot reviewedWidely usedA- Svelte MCPThe official Svelte MCP server providing docs and autofixing tools for Svelte developmentnot reviewedEstablishedA
SvGridChecks AI-written SvGrid code against the real API, plus version-pinned Svelte 5 grid docs.not reviewedEstablishedA