prompt-compressor-mcp 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +10 -5
- package/index.js +1 -1
- package/package.json +2 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tom Ketter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
> MCP server for rule-based prompt compression. Cut LLM token usage without a model, without an API key, and without sending data anywhere.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/prompt-compressor-mcp)
|
|
6
|
+
[](https://glama.ai/mcp/servers/kettertom/prompt-compressor)
|
|
6
7
|
|
|
7
8
|
⭐ **Find it useful? [Star it on GitHub](https://github.com/kettertom/prompt-compressor)** · 🐛 **Found a bug or have an idea? [Open an issue](https://github.com/kettertom/prompt-compressor/issues/new)**
|
|
8
9
|
|
|
9
10
|
Gives Claude, Cursor, VS Code, Windsurf, or any MCP client tools to shrink prompts, system prompts, docs, logs and JSON before they go into context. Built on [`prompt-compressor`](https://www.npmjs.com/package/prompt-compressor). Fully deterministic and runs locally. Template variables like `{{name}}` are preserved.
|
|
10
11
|
|
|
12
|
+
**No model. No API key. Deterministic. Zero dependencies. Your data never leaves your machine.** At the default level it cut **23% of tokens across 8 real-world prompt types while keeping 94/94 critical instructions**. See the [benchmark](https://github.com/kettertom/prompt-compressor#benchmark).
|
|
13
|
+
|
|
11
14
|
## Tools
|
|
12
15
|
|
|
13
16
|
| Tool | What it does |
|
|
@@ -21,12 +24,14 @@ Resource: `prompt-compressor://levels` lists which algorithms run at each level.
|
|
|
21
24
|
|
|
22
25
|
### Risk levels
|
|
23
26
|
|
|
24
|
-
| Level | What runs |
|
|
27
|
+
| Level | What runs | Measured saving ([benchmark](https://github.com/kettertom/prompt-compressor#benchmark)) |
|
|
25
28
|
|---|---|---|
|
|
26
|
-
| `none` | Whitespace, unicode normalization, indentation |
|
|
27
|
-
| `very-low` | + filler lead-ins, phrase shortening, JSON/SQL minify |
|
|
28
|
-
| `low` (default) | + hedging, code comments, deduplication, stack-trace truncation |
|
|
29
|
-
| `medium` | + fuzzy
|
|
29
|
+
| `none` | Whitespace, unicode normalization, indentation | 4% avg (0–24%) |
|
|
30
|
+
| `very-low` | + filler lead-ins, phrase shortening, JSON/SQL minify | 9% avg (0–32%) |
|
|
31
|
+
| `low` (default) | + hedging, code comments, deduplication, stack-trace truncation | **23% avg (2–59%)**, 100% of critical facts kept |
|
|
32
|
+
| `medium` | + Near-duplicate removal (fuzzy / n-gram / Levenshtein), TextRank on plain prose only | 24% avg (5–59%), 100% of critical facts kept |
|
|
33
|
+
|
|
34
|
+
> **`medium` = `low` + near-duplicate removal + light summarization of plain prose.** Code blocks, lists, tables, `Key: value` lines, questions, and any sentence with a rule, number, ID or variable are never removed. On the dense prompts in the benchmark it saves about the same as `low` (24% vs 23%) and kept 94/94 critical facts. It helps most on long, chatty prose. *(Before 1.0.3, `medium` chained three summarizers and kept only 22% of critical facts. Upgrade if you used it.)*
|
|
30
35
|
|
|
31
36
|
## Install
|
|
32
37
|
|
package/index.js
CHANGED
|
@@ -21,7 +21,7 @@ const levelSchema = z
|
|
|
21
21
|
.default('low')
|
|
22
22
|
.describe(
|
|
23
23
|
"Risk level. 'none' = whitespace/unicode only; 'very-low' = + filler, phrases, JSON/SQL minify; " +
|
|
24
|
-
"'low' = + hedging, comments, dedup (recommended); 'medium' = +
|
|
24
|
+
"'low' = + hedging, comments, dedup (recommended); 'medium' = + near-duplicate removal and light summarization of plain prose (code, lists, questions and sentences with rules/numbers/IDs are always kept)."
|
|
25
25
|
);
|
|
26
26
|
|
|
27
27
|
const statsLine = (s) =>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prompt-compressor-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"mcpName": "io.github.kettertom/prompt-compressor",
|
|
5
5
|
"description": "MCP server for rule-based prompt compression — cut LLM token usage without a model, without an API, without sending data anywhere.",
|
|
6
6
|
"type": "module",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
20
|
-
"prompt-compressor": "^1.0.
|
|
20
|
+
"prompt-compressor": "^1.0.3",
|
|
21
21
|
"zod": "^4.0.0"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|