Context Engine — Claude Code MCP server: what it does and setup
Prepares dense, noise-free context from logs, RAG chunks, and code for LLMs. It trims boilerplate repetitions and sorts key evidence within a token budget.
claude mcp add context-engine -- uvx melonelish-context-engineWhat Context Engine does
This server sits between raw application data and language models. Rather than sending raw text dumps, it discards duplicated noise and prioritizes signals. It provides three dedicated operational modes: logs for traceback filtering, rag for re-ranking retrieved knowledge, and code for pinning down bug hotspots.
The pipeline standardizes entries, validates schemas, and crops payload to fit small, medium, or large budgets. The server registers a single tool called compress_context. When input validation fails, it replies with a structured error payload containing an error code and a corrective hint.
Running it requires Python between 3.11 and 3.13. Built-in size guards reject text blocks over 200000 characters and structured lists exceeding 64 items. Payloads above 2000000 bytes fail validation immediately.
What it helps with
- clean repetitive error logs down to the root cause
- prioritize RAG chunks based on question relevance
- extract relevant repository files for targeted bug fixing
- compress prompt context to match token budget limits
Example prompts for the agent
- Compress this crash traceback using context-engine to pinpoint the root cause
- Rank retrieved knowledge chunks via
compress_contextfor a query about payment failures - Filter candidate repository files down to the minimal context needed for this issue
How to install Context Engine
Platform CLI
claude mcp add context-engine -- uvx melonelish-context-engineuvx runs the command named after the package; if the README names another one, use uvx --from melonelish-context-engine <command>
Platform CLI
codex mcp add context-engine -- uvx melonelish-context-engineuvx runs the command named after the package; if the README names another one, use uvx --from melonelish-context-engine <command>
Config file
{
"mcpServers": {
"context-engine": {
"command": "uvx",
"args": [
"melonelish-context-engine"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from melonelish-context-engine <command>
Config file
{
"servers": {
"context-engine": {
"type": "stdio",
"command": "uvx",
"args": [
"melonelish-context-engine"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from melonelish-context-engine <command>
Platform CLI
gemini mcp add context-engine uvx melonelish-context-engineuvx runs the command named after the package; if the README names another one, use uvx --from melonelish-context-engine <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Context Engine
How do I install Context Engine in Claude Code?
Run claude mcp add context-engine -- uvx melonelish-context-engine in your terminal.
What does Context Engine do?
It acts as a pre-processing filter that collapses repetitive traces, reorders search chunks, and isolates hotspot files before prompting an LLM.
What payload size limits does the server enforce?
The pipeline limits single text fields to 200000 characters, lists to 64 items, and input file sizes to 2000000 bytes.