compendium-mcp 0.1.2 → 0.1.3
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/README.md +38 -8
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Compendium
|
|
2
2
|
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="assets/logo.svg" alt="Compendium" width="420" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
3
7
|
MCP server that **minimizes LLM token usage** by compressing, summarizing, filtering, and chunk-referencing large context before it reaches the model.
|
|
4
8
|
|
|
5
9
|
Built in Rust with the official [`rmcp`](https://crates.io/crates/rmcp) SDK.
|
|
@@ -111,13 +115,31 @@ Single MCP tool: **`compendium`**. Choose the operation with `action`:
|
|
|
111
115
|
| `cache_invalidate` | Drop one key or clear cache | `key?` |
|
|
112
116
|
| `sanitize` | Redact secrets + neutralize IPI phrases | `text`, `sanitize?` |
|
|
113
117
|
| `rerank` | BM25-rank candidates / chunks for a query | `query`, `items` or `text` or chunk `map`, `rerank?` |
|
|
114
|
-
| `brief` | Scan a workspace
|
|
118
|
+
| `brief` | Scan a workspace; pack a structured starter briefing + cache key | `query`, `brief?` (`root`, caps), optional `text` hint |
|
|
119
|
+
| `catalog` | Short action (+ playbook) ads; prefer before guessing | _(none)_ |
|
|
120
|
+
| `help` | Usage notes for one action (default **compressed**; `force: true` → full) | `id`, `force?` |
|
|
121
|
+
| `playbooks` | List bundled token-hygiene playbook ads | _(none)_ |
|
|
122
|
+
| `playbook` | Load one playbook body (sanitized) | `id` |
|
|
123
|
+
| `pack` | Zip text/files into a size-capped archive (cache and/or base64) | `text` or `items`, `pack?` |
|
|
124
|
+
| `unpack` | Unpack zip with caps → chunks (**never runs scripts**) | `key` or base64 `text`, `pack?` |
|
|
125
|
+
|
|
126
|
+
### Progressive disclosure (skills)
|
|
127
|
+
|
|
128
|
+
Tool description/instructions stay thin. Discover details on demand:
|
|
129
|
+
|
|
130
|
+
- **Tool bridge:** `action=catalog` → `action=help` with `id`, or `playbooks` → `playbook`
|
|
131
|
+
- **MCP resources:** `resources/list` / `resources/read` on:
|
|
132
|
+
- `cmp://skill/index` — JSON index of actions + playbooks
|
|
133
|
+
- `cmp://skill/action/{name}` — full action help (markdown)
|
|
134
|
+
- `cmp://skill/playbook/{id}` — playbook body
|
|
135
|
+
|
|
136
|
+
Bundled playbooks live under [`playbooks/`](playbooks/). Override/extend with `COMPENDIUM_PLAYBOOKS_DIR` (same `id` wins). Archives honor `COMPENDIUM_ARCHIVE_MAX_BYTES` / `_UNCOMPRESSED` / `_FILES` (defaults 2 MiB / 4 MiB / 50).
|
|
115
137
|
|
|
116
138
|
Optional on most text actions: `sanitize_input: true` scrubs before processing. Soft payloads under `COMPENDIUM_SIGNAL_MIN_CHARS` (default 1000) bypass `compress` / `summarize` / `summarize_smart` unless `force: true`.
|
|
117
139
|
|
|
118
140
|
`filter` accepts optional `query` (top-level or `filter.query`) for BM25 line keep. `prune_history` supports `prune.strategy: "afm"` (Critical / Thematic / Distant tiers; distant blob cached for `cache_get`).
|
|
119
141
|
|
|
120
|
-
`brief` walks `brief.root` (default: process cwd) with `.gitignore` / `.ignore
|
|
142
|
+
`brief` walks `brief.root` (default: process cwd) with `.gitignore` / `.ignore`, BM25-ranks paths/chunks, window-reads oversized files (not head-truncate), and returns a structured `briefing`: **Task / Status / Evidence / Caveats / Sources / Read next**, plus `cache_key`. Status uses a local SLM when `COMPENDIUM_LOCAL_LLM_URL` is set (`backend: local_llm`); otherwise heuristic bullets. Caveats flag truncated files and docs older than selected code. **Read next** includes source paths plus suggested `cmp://skill/playbook/…` / action URIs. Optional `COMPENDIUM_BRIEF_ROOT` restricts allowed roots. Briefings are sanitized by default.
|
|
121
143
|
|
|
122
144
|
Example:
|
|
123
145
|
|
|
@@ -134,14 +156,13 @@ Response envelope: `{ "ok": true, "action": "filter", "result_json": "{...}" }`.
|
|
|
134
156
|
## Project layout
|
|
135
157
|
|
|
136
158
|
```
|
|
137
|
-
|
|
138
|
-
npm/ # platform packages + distribution docs
|
|
139
|
-
.github/workflows/ # release cross-compile + npm publish
|
|
159
|
+
assets/ # brand mark (SVG/PNG); baked into MCP icons via data URI
|
|
140
160
|
src/
|
|
141
161
|
main.rs # CLI: stdio | http
|
|
142
162
|
lib.rs
|
|
163
|
+
brand.rs # SEP-973 icons for serverInfo + tool
|
|
143
164
|
config.rs # COMPENDIUM_* env config
|
|
144
|
-
server.rs # MCP tool handlers (rmcp
|
|
165
|
+
server.rs # MCP tool + resources handlers (rmcp)
|
|
145
166
|
http.rs # Streamable HTTP/SSE (feature = "http")
|
|
146
167
|
pipeline/
|
|
147
168
|
tokens.rs # heuristic or tiktoken BPE (feature = "real-tokens")
|
|
@@ -152,12 +173,16 @@ src/
|
|
|
152
173
|
local_llm.rs # OpenAI-compatible local SLM client
|
|
153
174
|
chunk.rs # chunk + resolve
|
|
154
175
|
cache.rs # session key/value cache
|
|
176
|
+
catalog.rs # action ads + help (progressive disclosure)
|
|
177
|
+
playbook.rs # bundled / dir playbooks
|
|
178
|
+
pack.rs # zip pack/unpack with size caps
|
|
155
179
|
stats.rs # session savings counters
|
|
156
180
|
prune.rs # conversation history pruning
|
|
157
181
|
output.rs # domain-aware compress_output
|
|
182
|
+
playbooks/ # embedded skill-md playbooks
|
|
158
183
|
tests/
|
|
159
184
|
integration.rs
|
|
160
|
-
e2e_smoke.rs # spawns binary, MCP handshake,
|
|
185
|
+
e2e_smoke.rs # spawns binary, MCP handshake, tools + resources
|
|
161
186
|
```
|
|
162
187
|
|
|
163
188
|
## Build
|
|
@@ -239,6 +264,11 @@ Point an MCP streamable-HTTP client at that URL (e.g. `StreamableHttpClientTrans
|
|
|
239
264
|
| `COMPENDIUM_LOCAL_LLM_TIMEOUT_SECS` | `120` | HTTP timeout (first model load can be slow) |
|
|
240
265
|
| `COMPENDIUM_SIGNAL_MIN_CHARS` | `1000` | Bypass compress/summarize below this length (`0` disables) |
|
|
241
266
|
| `COMPENDIUM_BRIEF_ROOT` | _(unset)_ | When set, `action=brief` may only scan roots under this canonical path |
|
|
267
|
+
| `COMPENDIUM_PLAYBOOKS_DIR` | _(unset)_ | Extra/override playbook `*.md` directory (same `id` replaces embedded) |
|
|
268
|
+
| `COMPENDIUM_ARCHIVE_MAX_BYTES` | `2097152` | Max compressed archive size for pack/unpack |
|
|
269
|
+
| `COMPENDIUM_ARCHIVE_MAX_UNCOMPRESSED` | `4194304` | Max total uncompressed bytes for pack/unpack |
|
|
270
|
+
| `COMPENDIUM_ARCHIVE_MAX_FILES` | `50` | Max files per archive |
|
|
271
|
+
| `COMPENDIUM_SKILL_TTL_MS` | `300000` | Soft TTL (ms) on skill `resources/read` responses |
|
|
242
272
|
| `RUST_LOG` | `compendium=info` | Logs on **stderr** only |
|
|
243
273
|
|
|
244
274
|
## Example tool calls
|
|
@@ -319,7 +349,7 @@ Without `COMPENDIUM_LOCAL_LLM_URL`, `summarize_smart` / `filter_relevant` automa
|
|
|
319
349
|
}
|
|
320
350
|
```
|
|
321
351
|
|
|
322
|
-
Start the new turn with the returned `briefing` (or `cache_get` the `cache_key`). The host should not paste the whole tree into the prompt first.
|
|
352
|
+
Start the new turn with the returned `briefing` (or `cache_get` the `cache_key`). The host should not paste the whole tree into the prompt first. Treat Status as a starter synthesis — verify Caveats and Read next before large edits.
|
|
323
353
|
|
|
324
354
|
## Local small language model
|
|
325
355
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "compendium-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "MCP server that compresses, summarizes, and filters context to minimize LLM token usage",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"prepare": "node npm/scripts/link-bins.js"
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
|
-
"compendium-mcp-darwin-arm64": "0.1.
|
|
42
|
-
"compendium-mcp-darwin-x64": "0.1.
|
|
43
|
-
"compendium-mcp-linux-x64": "0.1.
|
|
44
|
-
"compendium-mcp-linux-arm64": "0.1.
|
|
45
|
-
"compendium-mcp-win32-x64": "0.1.
|
|
41
|
+
"compendium-mcp-darwin-arm64": "0.1.3",
|
|
42
|
+
"compendium-mcp-darwin-x64": "0.1.3",
|
|
43
|
+
"compendium-mcp-linux-x64": "0.1.3",
|
|
44
|
+
"compendium-mcp-linux-arm64": "0.1.3",
|
|
45
|
+
"compendium-mcp-win32-x64": "0.1.3"
|
|
46
46
|
},
|
|
47
47
|
"preferUnplugged": true
|
|
48
48
|
}
|