Context Engine
Lets your AI agent compress logs, search results and code files into short, ranked context before sending them to the model.
322 stars on GitHubby melonelishLicense MITUpdated 5 months ago
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Paste in the terminal:
claude mcp add context-engine -- uvx melonelish-context-engine
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Compress this 5,000-line log and show me the likely root cause.
Re-rank these retrieved chunks for the question why did checkout fail.
What it is
Context Engine cleans up long, noisy input so the model sees only the useful parts. It has three modes: logs, rag and code. It exposes one MCP tool, compress_context, and also works as a command line tool and Python package.
What it can do
compress_context: compress logs, rag or code context within a budget- logs mode: keep likely root cause and traceback tail, fold repeated noise
- rag mode: re-rank retrieved chunks around the question
- code mode: rank hotspot files from an issue and test output
- Returns structured results or structured errors with a hint
When to use
- βΊWhen you have a very long log and only need the likely cause
- βΊWhen search results contain many chunks and only a few answer the question
- βΊWhen you need to choose which files matter for fixing a failing test
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
agent-platform-rag-engine-managementHelps your agent list and inspect Agent Platform RAG corpora and files, retrieve grounded context, and generate answers from a corpus.rag-architectHelps your agent design a search-based AI system over your documents, choosing chunk size and tools, then test how well it finds answers.rag-engineerIs an expert in building Retrieval-Augmented Generation (RAG) systems. It masters embedding models, vector databases, and optimization for LLM applications.Frequently asked questions
Is it free?
It uses the MIT license and installs from PyPI. The readme does not mention a price.
How do I start the MCP server?
After installing with the mcp extra, run context-engine-mcp. It uses stdio.
What input does it accept?
Plain text logs, and JSON for rag (question and chunks) and code (issue, test output and files). PDFs, images and Office files are not supported.
Are there size limits?
Yes. The readme lists 200000 characters per text, 64 items per list and 2000000 bytes per input file.
Is it production ready?
The readme calls v0.1.0 an early beta, good for trials and integration tests, without production auth, monitoring or audit.
Does it use an AI model?
The readme does not say it calls a model. It describes ranking, deduplication and budget trimming before the text goes to your model.
If it does not work
- βΊCheck that Python 3.11 to 3.13 is installed.
- βΊIf a call fails, read the error_code and hint in the structured error, for example an empty chunks list.
- βΊRestart your MCP client after adding context-engine-mcp.
5 new skills a week. 1 minute to read.