ContextForge MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
ContextForge MCP deterministically compresses codebases, noisy logs, massive JSON/OpenAPI dumps, and RAG chunks to cut 60-90% of context-window tokens with zero LLM calls.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| compile_repo_contextA | Walk a local repository on disk (skipping node_modules, .git, lockfiles, binaries, and .env secrets), rank files against taskQuery via BM25, and compile a strict token-budgeted context pack mixing verbatim target code and line-indexed skeletons. |
| skeletonize_codeA | Deterministically compress JS/TS, Python, C/C++, Go, Rust, or Java source code into a line-indexed signature skeleton (or symbol-focus view that expands only matching functions), cutting 65-88% tokens while preserving imports, types, signatures, and exact Lstart-Lend ranges. |
| compress_logs_and_tracesA | Drain-style deterministic log template clusterer and stack-trace deduplicator. Normalizes timestamps, UUIDs, IPs, hex pointers, and numbers to collapse 1,000+ noisy CI/server/test lines into frequency-ranked ERROR/WARN clusters + unique stack traces (70-95% token reduction). |
| compact_json_and_apiA | Deterministically compact huge JSON payloads, DB query dumps, or OpenAPI 3.x/Swagger specs into an inferred typed schema with field cardinality, numeric min/max ranges, enum distributions, and a trimmed sample item (75-92% token reduction). |
| audit_and_pack_rag_contextA | Audit retrieved RAG passages against embedding encoder hard limits (MiniLM 256, BGE/E5 512, Nomic 2048, OpenAI 8191, Voyage 32k), eliminate silent truncation via sentence-bounded re-chunking, remove Jaccard near-duplicates, and apply Lost-in-the-Middle U-shaped attention ordering inside a strict token budget. |
| compile_context_packB | BM25-ranked, token-budgeted multi-artifact context compiler. Ranks source files, logs, JSON dumps, and docs against a taskQuery, keeping top files verbatim, skeletonizing supporting dependencies, clustering logs, and outputting a strict XML context pack + dropped-file manifest. |
| simulate_context_budgetB | Deterministic multi-turn agent context-window and cost economics simulator. Computes exact MCP schema tax, turn-by-turn token growth, Lost-in-the-Middle degradation cliff turn, 85% compaction wall turn, prompt-cache economics, and monthly USD savings across 8 frontier models. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| compress-debug-session | Compress raw crash logs/stack traces and skeletonize suspect source files before diagnosing a production bug. |
| pack-repo-for-feature | Compile an optimal BM25-ranked context pack for implementing a feature across a large multi-file repository. |
| optimize-rag-pipeline | Audit a set of RAG chunks for silent encoder truncation, deduplicate overlap, and reorder for U-shaped attention. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Context Compression Decision Playbook | Deterministic guide for choosing full verbatim code vs signature skeletons, log clustering, JSON schema folding, or disk offloading. |
| Frontier Model Context Windows & Caching Economics | Reference table of effective attention sweet spots, compaction walls, and cached vs uncached input token pricing. |
| RAG Encoder Truncation & Lost-in-the-Middle Mitigation | Reference limits for common embedding encoders and U-shaped attention ordering. |
| MCP Tool-Schema Hygiene & Context-Bloat Prevention | How to avoid burning 15,000+ tokens per turn on eager MCP schemas. |
TDQS
Scored across 7 tools
Each tool targets a distinct artifact type (JSON/OpenAPI, source code, logs/traces, RAG passages) or task (repo walk, budget simulation), so purposes are mostly clear. The three 'pack/compile' tools (compile_context_pack, compile_repo_context, audit_and_pack_rag_context) overlap somewhat since all produce budgeted context, but input-source differences in the descriptions help disambiguate.
Names follow a consistent snake_case, verb-led convention (compact_, compile_, skeletonize_, compress_, audit_and_pack_, simulate_). Minor deviations: audit_and_pack_rag_context uses two verbs, and compress vs compact are near-synonyms, but overall pattern is predictable.
Seven tools is well-scoped for a context/token-optimization toolkit, with each tool covering a distinct compression or analysis concern. No redundant or filler tools.
The surface broadly covers artifact compaction (JSON, code, logs), context packing (multi-artifact, repo, RAG), and budget simulation, forming a coherent lifecycle. Minor gaps: no standalone token-count/validation tool and no inverse (expand/restore) operations, though simulate_context_budget partially covers estimation.