</>MCP Agents Market
MCP Server

lean-ctx

by yvgude3.7kRustUpdated 2026-09-06

LeanCTX — Context Intelligence for AI systems.

CursorClaude CodeClaude DesktopGitHub CopilotWindsurfClineContinueZed

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

Context compression with 10 read modes reducing file reads to ~13 tokens on cache hits (98%+ compression)
Shell output compression for 95+ command patterns (git, npm, cargo, docker, kubectl, terraform)
Request proxy that compresses entire LLM conversations while preserving prompt cache compatibility
Session memory and knowledge graph that persists facts and decisions across chat sessions
Property graph with multi-edge code relationships for impact analysis and intelligent search
Real-time cost tracking with CPAO (Cost Per Accepted Outcome) metrics and savings ledger
Shadow Mode baseline comparison to prove compression savings without changing workflow
Addon system for extending functionality with signed WASM modules or external MCP servers

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 more

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.

Related searches