Context Mode
An MCP server that reduces how much raw tool output enters an AI coding agent's context window, tracks session state in SQLite for recovery after compaction, and encourages agents to run scripts instead of reading large amounts of data directly.
Context Mode is an MCP server aimed at the context-window side of working with AI coding agents. Sandbox tools keep raw tool output, such as a browser snapshot or a long log, out of the context window, shrinking it by roughly 98% in the project's own examples, and every file edit, git operation, task, error and user decision is tracked in a local SQLite database.
When a conversation compacts, Context Mode does not dump that tracked history back into context; instead it indexes events with FTS5 and retrieves only what is relevant through BM25 search, so a session can pick up where it left off, or start clean if continuation is not requested. It also encourages agents to write and run a short script to compute an answer, such as counting functions across files, instead of reading many files directly into context.
It supports 17 agent platforms plus an OpenClaw gateway integration, wired in through MCP and hooks, and is written in TypeScript.