Context Mode 🔌 MCP server Free
Sandboxed execution and local search index that keep bulky tool output out of context
- GitHub stars
- 25k
- Stars this week
- +908
- Forks
- 1.8k
- Licence
- Elastic-2.0
- Last push
- 2026-10-02
- Maintainer
- mksglu
claude mcp add context-mode -- npx -y context-modeThird-party MCP servers run with your permissions. Read the source before installing, and prefer pinned versions.
Works with
Built on the open MCP standard, so it works in every app that supports MCP.
About Context Mode
What it does
Context Mode is an MCP server, packaged with hooks, that keeps bulky tool output out of your coding agent's context window. The agent does not read large files, logs or API responses directly. It runs code in a sandboxed subprocess and only the printed result comes back. Longer output is indexed into a local SQLite full-text store, and the agent pulls back only the sections that match what it is looking for. The same store records file edits, git operations, tasks and decisions, so the agent can recover its working state when a conversation is compacted. On platforms with hooks, it also steers the agent toward these tools and away from raw shell or file reads.
Tools it gives your agent
ctx_execute,ctx_execute_fileandctx_batch_executerun code in 12 languages, including JavaScript, Python, Shell, Go and Rust, and return only stdoutctx_index,ctx_searchandctx_fetch_and_indexchunk, search and cache documents and web pages with BM25 rankingctx_stats,ctx_doctor,ctx_upgradeandctx_purgefor savings reports, diagnostics, upgrades and wiping the index
Works with
It runs locally. The README has setup steps for Claude Code, where it ships as a plugin with slash commands, as well as Gemini CLI, VS Code and JetBrains Copilot, GitHub Copilot CLI, Cursor, OpenCode, Kilo Code, Codex CLI, Kiro, Antigravity, Zed and others. Routing enforcement depends on how well each client supports hooks.
How to connect
The full Claude Code plugin, or the MCP-only option:
/plugin marketplace add mksglu/context-mode
/plugin install context-mode@context-mode
claude mcp add context-mode -- npx -y context-mode
Cost and limits
Free to use. It needs Node.js 22.5+ or Bun. The licence is the Elastic License 2.0, which makes it source-available rather than open source: you can use, modify and redistribute it, but you cannot offer it as a hosted service.
Safety notes
The execute tools run arbitrary code with your user's filesystem access. They apply the same deny and allow rules you set in Claude Code's settings.json. ctx_execute_file is confined to the project root by default. URL fetching blocks cloud-metadata addresses, and CTX_FETCH_STRICT=1 also blocks private network ranges. The project says nothing leaves your machine, although the optional Insight dashboard is hosted. The hooks change how your agent routes its tool calls, so review them before installing.
Pros
- Only stdout or matching search hits reach the model
- Session events survive context compaction
- Setup guides for a wide range of agents
Cons
- Elastic License 2.0 is source-available, not open source
- Execute tools run arbitrary code, and hooks change how the agent routes tool calls
Similar MCP servers
All docs & code context MCP servers →Context7 🔌 MCP serverFreemium
Up-to-date, version-specific library documentation for your coding agent
MCP Python SDK 🔌 MCP serverOpen source
The official Python SDK for building Model Context Protocol servers and clients
Serena 🔌 MCP serverFree
Semantic code retrieval and editing toolkit for agents, powered by language servers
Codebase Memory MCP 🔌 MCP serverOpen source
Local knowledge graph of your repo so agents query call chains instead of grepping files
pg-aiguide 🔌 MCP serverOpen source
MCP server and skills giving coding agents versioned PostgreSQL and TimescaleDB expertise
MCP Memory Service 🔌 MCP serverOpen source
Self-hosted persistent memory for coding agents with semantic search and a knowledge graph