Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
COMPACTION_AUTONoauto-compact on ingest when pressure ≥ nowPct (store mode only) (default: false)
COMPACTION_MODENopassthrough | store (default: passthrough)
COMPACTION_HOOKSNopath to hooks JSON
COMPACTION_LLM_MODELNosummarizer model (default: qwen2.5-coder:14b)
COMPACTION_STATE_DIRNosession + ledger persistence (default: ~/.compaction-mcp/sessions)
COMPACTION_SUMMARIZERNodirect | sampling | auto (default: direct)
COMPACTION_EMBED_MODELNoembeddings model for semantic recall
COMPACTION_LLM_API_KEYNooptional bearer token
COMPACTION_LLM_HEADERSNoJSON of extra request headers
COMPACTION_RECALL_MODENoauto | embed | lexical (default: auto)
COMPACTION_LLM_BASE_URLNoOpenAI-compatible endpoint (default: http://localhost:11434/v1)
COMPACTION_TOKEN_BUDGETNodefault window size when host doesn't declare one (default: 128000)
COMPACTION_ALLOWED_ROOTSNocolon-separated roots for file re-hydration (default: cwd)
COMPACTION_HOOKS_ENABLEDNoset false to disable all hook execution (default: true)
COMPACTION_EMBED_BASE_URLNoOpenAI-compatible /embeddings endpoint (default: = LLM base URL)

Capabilities

Features and capabilities supported by this server

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
context_statusC

Report context pressure and a compaction recommendation (ok | compact-soon | compact-now | at-limit).

context_compactA

Summarize accumulated history into a dense block, snapshot the ledger, re-hydrate tracked files, and run Pre/PostCompact hooks. Returns the compacted context block to install as new ground truth.

context_trimB

Remove low-value/duplicate tool output without an inference call. Store mode only.

context_clearC

Hard reset turns and boundaries. Keeps rules and ledger by default.

handoff_briefA

Produce a small, self-contained brief (rules + latest summary + verification ledger + active files) to START A FRESH CHAT with. This is how you actually reclaim tokens on hosts that own their window (e.g. Copilot): open a new chat and seed it with this brief. Always written to disk too, so a new chat can attach the file even if MCP is unavailable.

turn_addC

Append a message to the server-held transcript. Store mode only. When COMPACTION_AUTO=true and pressure crosses the compact-now threshold, compaction fires automatically and the compacted block is returned under autoCompacted.

files_trackA

Mark files to silently re-read from disk on every compaction.

files_untrackB

Stop re-hydrating the given files.

files_rehydrateB

Read tracked (or given) files from disk and return current contents.

read_offloadedA

Read a file from disk and OFFLOAD it: returns a short digest (preview + structural outline + line/byte counts) and a handle, instead of dumping the full contents into the window. Prefer this over a normal file read for large files. Fetch the full body only when needed via offload_fetch or the compaction://blob/{handle} resource.

offload_storeA

Stash large text (command output, grep results, logs, API payloads) as a blob and return a digest + handle instead of putting it all in the window.

offload_fetchA

Retrieve a blob's full content, or a 1-indexed inclusive line slice. Use the smallest slice that answers the question to keep the window small.

recallA

Search the verification ledger + offloaded blobs for already-known facts and content. CALL THIS BEFORE querying the codebase / context engine: a cached fact or a known blob line range avoids pulling whole files back into the window (token saver, esp. on hosts with their own retrieval like Augment). Semantic ranking when embeddings are configured, else lexical. Returns ledger hits + blob hits with line ranges (use with offload_fetch).

rules_setA

Replace the CLAUDE.md-equivalent rules that survive every boundary.

rules_appendC

Append a rule that survives every boundary.

rules_getB

Return the current persistent rules.

ledger_recordA

Append an entry to the verification ledger (maker/checker). Survives compaction; verified results are copied verbatim into summaries.

ledger_queryB

Filter ledger entries by claim substring and/or result.

ledger_snapshotB

Return the full current ledger (used at boundaries for re-injection).

Prompts

Interactive templates invoked by user choice

NameDescription
compaction_summarizeThe summarization instruction used by context_compact.

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ink01101011/compaction-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server