mcp-context-optimizer
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| persistPath | No | Optional path to persist records across restarts. Corresponds to the CLI option --persist <path>. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| ingest_recordsA | Add structured records (messages, tool calls, errors, files, diffs, test results, decisions, notes) to the local in-memory context store. Records are validated; malformed entries are reported and skipped. |
| search_contextA | Retrieve fragments relevant to a query, ranked by the explainable relevance model. Returns fragments with score breakdowns and provenance (never modifies sources). |
| get_decisionsA | Retrieve previously recorded technical decisions and constraints (accepted, proposed, superseded, rejected). |
| get_relevant_errorsB | Retrieve related errors, failed attempts and diagnostic information (error records, failed tool calls, failing tests). Optionally ranked by a query. |
| get_file_historyA | Retrieve context associated with a particular file: file snapshots, diffs, errors and test failures pointing at that path. |
| build_contextB | Construct a compact, task-specific context under a token budget. Combines stored records with any inline records; returns the rendered context plus provenance, omissions and a reproducible optimization report. Token counts are estimates unless a custom estimator is configured server-side. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| optimize-context | Build a compact, task-specific context from stored records. Use before answering a task to keep only relevant facts within the token budget. |
| summarize-errors | Retrieve recorded errors and failed attempts, optionally ranked by a query. Use when debugging to see what has failed so far. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 6 tools
The write tool (ingest_records) and composition tool (build_context) are clearly distinct from the retrieval tools. The four retrieval tools are mostly separable by scope (general query, decisions, errors, file history), though search_context can overlap with the specialized getters when queries target decisions or errors.
All six names follow a consistent snake_case verb_noun pattern: ingest_records, search_context, get_decisions, get_relevant_errors, get_file_history, build_context. The verbs vary by operation but remain predictable and readable.
Six tools is well-scoped for a context optimizer: one ingestion path, several targeted retrieval views, and one context-builder. Each tool has a clear role and the set avoids unnecessary surface area.
The core lifecycle is covered: ingest records, retrieve by query/category/file, and build budgeted context with provenance. Minor gaps exist around record management, such as updating, deleting, clearing, or listing stored records, which could matter for long-running in-memory use.