Skip to main content
AllMCPs
BrowseBestCategoriesStackCompareToolsGuidesBlog
Log in Submit MCP

Stay in the loop

Get new MCP servers and top picks in your inbox.

AllMCPs

The open directory for discovering and installing Model Context Protocol servers.

AllMCPs on GitHub (opens in a new tab)
Launched onTiny Startupstinystartups.com
Explore
  • Browse servers
  • Best MCP servers
  • Categories
  • MCP clients
  • Agent prompts
  • Stack Builder
  • Compare servers
  • Random discovery New
  • Submit a server
  • Pricing & Boost Boost
Learn
  • Guides hub
  • What is MCP?
  • Install guide
  • Build an MCP server
  • Deploy an MCP server
  • Security guide
  • Troubleshooting
  • MCP for SEO & AEO
  • Protocol versioning
  • Blog & updates
Tools
  • All developer tools
  • Config generator
  • Config validator
  • Config auditor
  • MCP playground
  • Token calculator
  • OpenAPI β†’ MCP
  • Badge generator
For agents
  • REST API docs
  • Trust & traffic Live
  • Remote MCP server SSE β†— (opens in a new tab)
  • llms.txt β†— (opens in a new tab)
  • Catalog JSON β†— (opens in a new tab)
Company
  • About
  • Advertise Sponsor
  • Contact
  • GitHub β†— (opens in a new tab)
  • Terms
  • Privacy
AllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZoneAllMCPs VerifiedAllMCPs VerifiedFeatured on Nick LaunchesFeatured on Nick LaunchesLaunch Llama NewsletterLaunch Llama NewsletterVerified DR - allmcps.comVerified DR - allmcps.comFeatured on SaaSGrowFeatured on SaaSGrowFeatured on Twelve ToolsFeatured on Twelve ToolsFeatured on Saaspa.geFeatured on Saaspa.geFeatured on Findly.toolsFeatured on Findly.toolsFeatured on Startup FameFeatured on Startup FameFeatured on LaunchKiwiFeatured on LaunchKiwiFeatured on ScrollLaunchFeatured on ScrollLaunchFeatured on DailyPingsFeatured on DailyPingsFazier badgeFazier badgeFeatured on NewTool.siteFeatured on NewTool.siteFeatured on saasfame.comFeatured on saasfame.comDR Checker - Domain RatingDR Checker - Domain RatingListed on Turbo0Listed on Turbo0Launched on LaunchBoard - Product Launch PlatformLaunched on LaunchBoard - Product Launch PlatformList on SimilarlabsList on Similarlabshttps://codetrendy.comhttps://codetrendy.comListed on DevTool.ioFeatured on BuildlistFeatured on BuildlistLaunched on Tiny StartupsFeatured on ShowMeBestAIFeatured on ShowMeBestAIFind us on LaunchZoneFind us on LaunchZone
Β© 2026 Jackalope Digital LLC. All rights reserved.
  1. Home
  2. πŸ’» Developer Tools
  3. CompactPrompt
CompactPrompt logo
Health: ActiveRecent health check succeeded.Last checked 9/7/2026, 8:19:39 PM

CompactPrompt

User RatingsBe the first to rate and review this MCP server! Enrichment pendingWe haven’t run our AI enrichment pass on this listing yet, so the overview, use cases, and FAQ below may be sparse or missing. We work through the catalog over time β€” check back soon.
View RepositoryVisit Website

Review and compact prompts, docs, and AI-agent skills to save tokens, preserving structure.

Quick Install

Automated & IDE Setup

Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β€” or use 1-click editor setup below.

Add to CursorAdd to VS Code
Not yet automatically verified

We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β€” we're steadily working through the catalog.

Manual Client & Custom JSON ConfigExpand JSON β–Ύ

Client Config & Setup

Choose your client or environment
Target File:~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "compactprompt": {
      "command": "uvx",
      "args": [
        "compactprompt"
      ]
    }
  }
}

πŸ’‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.

Install Directory Badge Claim listing AlternativesπŸ’» More in Developer Tools

Documentation Overview

CompactPrompt

Tests Pylint Documentation Status PyPI - Version gtkcyber/compact_prompt MCP server

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:

Terminal
pip install compactprompt

Shorten a prompt:

server.ts
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:

Code
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.

server.ts
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.

server.ts
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 original

Retain abbr.dictionary so the placeholders can be expanded again later.

Reducing the size of numeric data

Large tables of numbers consume many tokens. This lowers their precision to save space while guaranteeing that the rounding never exceeds a known bound.

server.ts
import compactprompt as cp

q = cp.quantize([1.0, 2.5, 3.3, 4.8, 9.2, 10.0], bits=8)
q.reconstruct()   # the rounded values
q.max_error       # the guaranteed maximum error

Selecting representative examples

Models perform better when shown a few examples. If you have many candidate examples, this selects a small, varied subset that still reflects the full range, so you send a representative few rather than all of them.

server.ts
from compactprompt import select_examples

chosen = select_examples(my_examples)
chosen.examples

Choosing how the wording is trimmed

The wording-trimming step can be carried out by any of three interchangeable engines. All of them shorten text; they differ in how they decide what to remove and in what they require to run. Select one with the engine argument β€” nothing else in your code changes.

EngineApproachRequirements
Built-in (default)Scores each word and removes the least useful. Runs locally.None
LLMLinguaMicrosoft's established tool, which uses a small model to decide what to remove.Downloads a model
CavemanRewrites the text in a concise style, preserving code, links, and headings.Access to a language model
python
CompactPrompt.compact(prompt)                       # built-in, no extra install
CompactPrompt.compact(prompt, engine="llmlingua")   # pip install 'compactprompt[llmlingua]'
CompactPrompt.compact(prompt, engine="caveman")     # pip install 'compactprompt[caveman]'

The built-in engine and the other core features implement the CompactPrompt research paper. LLMLingua and Caveman are independent open-source tools that this library integrates; see Attribution.

Compacting files and skills

CompactPrompt can also compact whole markdown files β€” documentation, CLAUDE.md, notes, and Claude Code skills (SKILL.md) β€” not just strings. It can first review a file or folder to report where the savings are.

This works safely by design: YAML frontmatter is preserved exactly, fenced code blocks and links are never altered, the result is rejected if it would change a heading, code block, or URL, and nothing is written without --apply (which first saves a .bak backup). Files that look like code, config, or secrets are skipped automatically.

From the command line:

bash
# See where the savings are (read-only)
compactprompt review ./skills

# Preview the compaction of one skill (writes nothing)
compactprompt compact ./skills/my-skill/SKILL.md --engine builtin

# Apply it (saves SKILL.md.bak, then rewrites the file)
compactprompt compact ./skills/my-skill/SKILL.md --engine caveman --apply

--engine is required β€” you choose builtin, llmlingua, or caveman each time (caveman, which rewrites prose, is usually best for human-readable files).

From Python:

server.ts
from compactprompt import review_file, compact_file

report = review_file("SKILL.md")
print(report.tokens, report.issues)

result = compact_file("SKILL.md", engine="caveman", apply=True)
print(result.tokens_before, "->", result.tokens_after)

The Streamlit app's Files & Skills tab does the same interactively.

Optional features

The basic installation requires no setup. Additional features depend on extra components, which you install only as needed:

Terminal
pip install compactprompt                  # core: trimming and reversible shortening
pip install 'compactprompt[ml]'            # numeric reduction and example selection
pip install 'compactprompt[llmlingua]'     # the LLMLingua engine
pip install 'compactprompt[caveman]'       # the Caveman engine
pip install 'compactprompt[mcp]'           # the MCP server for AI agents
pip install 'compactprompt[app]'           # the interactive application
pip install 'compactprompt[all]'           # everything

When a feature needs a component that is not installed, CompactPrompt reports exactly what to install.

Interactive application

A small web application lets you paste a prompt and see it shortened, with the savings reported as you go:

Terminal
pip install 'compactprompt[app]'
streamlit run compactprompt_app.py

It opens in the browser. Use the sidebar to choose an engine and set how much to remove.

Use it from an AI agent

CompactPrompt ships an MCP server so AI coding tools (Claude Code, Codex, Cursor, Gemini, and any MCP-capable agent) can review and compact prompts, docs, and skills directly:

Terminal
pip install 'compactprompt[mcp]'      # provides the `compactprompt-mcp` command
claude mcp add compactprompt -- compactprompt-mcp   # e.g. for Claude Code

The agent-skills/ directory also has lightweight skill/rules files and an install.sh for the same tools. See its README for per-tool configuration.

Confirming the meaning is preserved

To check that a shortened prompt still means the same thing, you can measure the similarity between the original and the result, where 1.0 indicates identical meaning:

server.ts
from compactprompt import cosine_fidelity   # pip install 'compactprompt[embeddings]'

score = cosine_fidelity(original_text, result.text)
print(score.mean)

Reference

CompactPrompt.compact(...) returns a result object with the following fields:

Read the full README β†’View source on GitHub β†’

Related MCP Servers

View all in Developer Tools View all alternatives
  • PraisonAI logoPraisonAI

    AI Agents Framework with Self Reflection and MCP support

    πŸ’» Developer Tools1 views
    Compare vs PraisonAI β†’
  • Skill of Skills logoSkill of Skills

    Quality-ranked, cross-platform directory of AI coding skills, plugins and MCP servers.

    πŸ’» Developer Tools2 views
    Compare vs Skill of Skills β†’
  • Labelhead Artist Momentum logoLabelhead Artist Momentum

    Trending hip-hop artist momentum scores across four cultural dimensions.

    πŸ’» Developer Tools0 views
    Compare vs Labelhead Artist Momentum β†’
  • Skills Board logoSkills Board

    Search your team's shared AI-skill library, get install commands, and save skills from your agent.

    πŸ’» Developer Tools0 views
    Compare vs Skills Board β†’

Reviews

No reviews yet β€” be the first to share how this listing worked for you.

Frequently Asked Questions about CompactPrompt

Add the following block to your claude_desktop_config.json under mcpServers: "mcpServers": { "compactprompt": { "command": "npx", "args": ["-y", "CompactPrompt"] } }

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCompactPrompt AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/compactprompt?style=directory)](https://allmcps.com/mcp/compactprompt)
HTML Embed
<a href="https://allmcps.com/mcp/compactprompt"><img src="https://allmcps.com/api/badge/compactprompt?style=directory" alt="CompactPrompt on AllMCPs" /></a>

Technical Specs & Signals

CategoryπŸ’»Developer Tools
More technical detailsExpand β–Ύ
TransportSTDIO
RuntimePython
Last updatedSep 7, 2026
Views0
Unique ViewsTotal visits recorded for this listing page on AllMCPs.
Installs0
Installs & Copy ActionsTotal times users copied install commands or configuration snippets for this server.
GitHub stars0
GitHub Star CountTotal stargazers on GitHub representing community popularity (0 stars).
36Quality signal: Fair Β· 36/100How this signal is calculated β–Ύ
Server availabilityNot measured

Not scored for repo-hosted servers β€” we can't reach the running server, only its GitHub page. Hosted MCP endpoints are health-checked live.

Verified ownership10/20
Documentation & tools16/30
Adoption & activity1/15
Community engagement0/10

A guidance signal from public completeness & health data β€” not a user rating. New listings start lower and rise as they add docs, get verified, and grow adoption. Signals we can't observe for a listing are skipped, not counted against it.

β˜… FeaturedMoxie Docs MCP logo

Moxie Docs MCP

MCP & Agent Skills for Automated Documentation, and codebase conventions + context

Explore Server β†’

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to unlock edit access and the Official badge β€” proof is checked automatically, then reviewed by our team.

Free dofollow backlink: add your website and place the AllMCPs badge on it β€” no claim needed. We detect it automatically and keep it verified as long as the badge stays live.

Claim & get free dofollow

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.

Explore more

More in πŸ’» Developer Tools β†’Best MCP servers for Developers β†’Alternatives to CompactPrompt β†’Install in Claude DesktopInstall in CursorInstall in VS Code