lean-ctx
LeanCTX — Context Intelligence for AI systems.
LeanCTX is an MCP server that optimizes context management for AI coding agents through intelligent compression, caching, and routing. It reduces token costs by compressing file reads (up to 98%), shell command output, and LLM requests while maintaining quality through multiple read modes (map, signatures, diff). The server includes session memory that persists across chats, a property graph for code intelligence, and real-time cost tracking. Works with 30+ AI agents including Cursor, Claude Code, GitHub Copilot, and Windsurf through standard MCP protocol.
Key Features
Use Cases
- 01Reducing API costs in long coding sessions by compressing repeated file reads and command outputs
- 02Maintaining context across multiple chat sessions without losing project knowledge
- 03Analyzing code impact and dependencies through the integrated property graph
- 04Tracking and optimizing AI development costs with detailed token and dollar metrics
- 05Compressing git logs, test outputs, and build results for cleaner LLM context
- 06Running multi-agent workflows with shared knowledge and context handoffs
Related MCP Servers
View moremarkitdown
Python tool for converting files and office documents to Markdown.
firecrawl
The context API to search, scrape, and interact with the web at scale. 🔥
prompts.chat
f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.
langflow
Langflow is a powerful tool for building and deploying AI-powered agents and workflows.
lean-ctx — FAQ
What is LeanCTX?+
LeanCTX is an MCP server that acts as a context intelligence layer for AI coding agents. It compresses file reads, shell output, and LLM requests to reduce token usage and costs while maintaining session memory and code knowledge across chats.
How do I install LeanCTX?+
Install via curl (curl -fsSL https://leanctx.com/install.sh | sh), Homebrew (brew tap yvgude/lean-ctx && brew install lean-ctx), npm (npm install -g lean-ctx-bin), or cargo (cargo install lean-ctx). Then run 'lean-ctx wrap cursor' (or your agent name) for one-command setup.
Which AI clients work with LeanCTX?+
LeanCTX works with 30+ MCP-compatible clients including Cursor, Claude Code, Claude Desktop, GitHub Copilot, Windsurf, Cline, Continue, Zed, VS Code, JetBrains IDEs, Aider, and more. Any MCP-compatible client is supported.
Does LeanCTX require API keys?+
No API keys are required for core functionality. LeanCTX runs locally and compresses context from your existing AI agent setup. Optional wire-level request compression via the proxy uses your existing ANTHROPIC_API_KEY or OPENAI_API_KEY.
Is LeanCTX free to use?+
Yes, local use is completely free with no telemetry by default. Optional cloud sync and team features are available on paid plans, but all core compression, caching, and MCP tools work locally without cost.
How much token reduction does LeanCTX provide?+
Compression varies by mode and workload: map mode achieves 98.1% compression, signatures mode 96.7%, and cached re-reads use approximately 13 tokens. Shell output compression handles 95+ command patterns, and the request proxy provides up to 99.4% input-side savings on cache-priced rails.
How do I install lean-ctx?+
Open the source repository on GitHub and follow its README. lean-ctx is a mcp server — MCP Agents Market links you directly to the official repo.
Is lean-ctx free?+
lean-ctx is an open-source project hosted on GitHub. Check the repository for its license and any usage requirements.