Hybrid Context Optimizer — Shell Hook + MCP Server. Reduces LLM token consumption by 89-99%. Single Rust binary, zero dependencies.
MCPpedia last refreshed this data
Lean Ctx is an MCP server that hybrid Context Optimizer — Shell Hook + MCP Server. Reduces LLM token consumption by 89-99%. Single Rust binary, zero dependencies. Its tool list has not been published yet over stdio, sse and http, requires no API key, and scores 91/100 on MCPpedia's security, maintenance and efficiency rubric.
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"lean-ctx": {
"command": "lean-ctx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
██╗ ███████╗ █████╗ ███╗ ██╗ ██████╗████████╗██╗ ██╗ ██║ ██╔════╝██╔══██╗████╗ ██║ ██╔════╝╚══██╔══╝╚██╗██╔╝ ██║ █████╗ ███████║██╔██╗ ██║ ██║ ██║ ╚███╔╝ ██║ ██╔══╝ ██╔══██║██║╚██╗██║ ██║ ██║ ██╔██╗ ███████╗███████╗██║ ██║██║ ╚████║ ╚██████╗ ██║ ██╔╝ ██╗ ╚══════╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ The Intelligence Layer for AI Coding
This server supports HTTP transport. Be the first to test it — help the community know if it works.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
Checked lean-ctx-bin against OSV.dev.
Click any tool to inspect its schema.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in developer-tools / ai-ml
Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
XcodeBuildMCP provides tools for Xcode project management, simulator management, and app utilities.
MCP client bridge: connects to MCP servers and registers their tools on ctx.tools
MCP Security Weekly
Get CVE alerts and security updates for Lean Ctx and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
The Context SDK for AI Agents. Give every agent a context system.
LeanCTX is a local context layer for existing AI agents. It selects, shapes, reuses, and recovers the project context an agent needs inside the agent loop you own. Your agent, model, tools, and task logic remain yours.
Your framework runs the agent. LeanCTX manages the context path routed through it.
LeanCTX supports three ways to integrate:
It is not an agent platform, a generic agent builder, a hosted execution service, or a marketplace.
The Python SDK v1 and its declared OpenAI Agents reference-wrapper are Preview. Performance Profiles, first-class Context Kits, the Performance Benchmark product flow, AutoTune, public rankings, and organization-scale operation are Research. An implementation directory is not a product claim. Local agent-presence, handoff, and related coordination substrate are also Research; LeanCTX does not currently provide a public multi-agent orchestration contract.
Select → Shape → Reuse → Recover
Evidence is a separate proof discipline: a gain is valid only with a comparable baseline and treatment, a declared quality threshold, and visible methodology. A lower token count or calculated cost is not a successful outcome on its own.
# Pick one installation method.
curl -fsSL https://leanctx.com/install.sh | sh
brew tap yvgude/lean-ctx && brew install lean-ctx
npm install -g lean-ctx-bin
cargo install lean-ctx
# Connect one supported agent, then verify the local installation.
lean-ctx wrap codex
lean-ctx doctor
Use lean-ctx unwrap codex to remove that integration, or lean-ctx uninstall --dry-run to review a full removal before it changes anything.
An agent does not always need the same representation of a project. LeanCTX provides local tools to inspect structure, public interfaces, relevant excerpts, exact lines, diffs, and full source. It also compresses eligible shell output, keeps recoverable references to source, and exposes local context state for the current task.
agent → LeanCTX context tools / shell hook → project and local tools
agent → optional local proxy → model provider
The proxy only records and transforms traffic it can observe. Its data must not be used to infer hidden prompts, retries, task quality, provider bills, or accepted business savings.
The current programmatic path is Python SDK v1 (Preview) through its declared OpenAI Agents reference-wrapper. It wraps that one declared agent lifecycle around the local Runtime; it does not choose a model, replace task logic, or turn an unobserved run into verified evidence.
pip install lean-ctx-python
from agents import Agent
from lean_ctx import LeanCTX
ctx = LeanCTX()
openai_agent = Agent(name="reviewer")
run = ctx.wrap(openai_agent).run("Review the payments module")
print(run.output)
print(run.receipt.verify()) # True only when Runtime evidence is sealed
See the Python SDK README for its declared adapter scope, compatibility, degradation behaviour, and evidence boundary.
Local observability can show context movement and compression deltas. A pu