mcp-server

lean-ctx cuts token usage and secures AI context for founders

Lean-CTX is a local Rust binary that trims token costs by up to 90% while controlling and auditing what AI agents read and store—ideal for founders building safe, efficient AI products. 3.9k+ GitHub stars.

From the repo · “LeanCTX — Context Gateway for AI Systems. Control what your AI can see. Open-source Engine for context selection, supported controls, and evidence.”

3,898 stars+21★ this week355 forksRustGuide quality 8/10 · reviewed Oct 19Updated 10/22/2026100% free · open source
What it does

LeanCTX is a context intelligence layer that controls what AI agents can see, remember, and save, optimizing token usage by 60-90%.

When to use it
  • •When integrating multiple AI agents into a startup's workflow
  • •When sensitive data needs to be protected from unauthorized AI access
  • •When optimizing token usage is crucial for cost reduction
Ready-to-paste prompt
Run `./target/release/lean-ctx --config lean-ctx.conf --agent my_agent` to start the LeanCTX server with a custom configuration for a specific AI agent
Heads up: Ensure the `RUST_LOG` environment variable is set to the desired log level (e.g., `RUST_LOG=info`) to avoid silent failures or unexpected behavior
Saves to your device
Use with Claude
New

Skip the builder — one click puts this in Claude, Cursor, Antigravity and more.

⚡ Runs out of the box

A prompt/skill package — nothing to install beyond adding it to your AI tool.

Try it instantly — no install
Claude Code
mkdir -p ~/.claude/skills/lean-ctx && curl -fsSL https://workflowstacks.com/api/skills/lean-ctx/claude-skill -o ~/.claude/skills/lean-ctx/SKILL.md
Open in another AI app

Opens the app with this repo with the prompt ready to go — no copy-paste needed.

Connect the whole catalog (MCP)
claude mcp add --transport http workflowstacks https://workflowstacks.com/api/mcp

Adds a WorkflowStacks connector to Claude Code: search and load any skill here by chatting.

How lean-ctx cuts token usage and secures AI context for founders works
Codeflow
Free to inspect

Lean-ctx cuts token usage and secures AI context for founders is a very large Rust project (~677k lines across 2352 code files, plus 276 test files). You install it into your AI tool with one command; there is nothing to run yourself. Last commit this month, Apache-2.0 license, has a test suite.

Size
Very large codebase
~677k lines · 2352 code files · days to read — use, don't read
Setup
Install as a skill / plugin
Add it to Claude Code (or your AI tool) with one command — 3 skills inside. Nothing to run yourself.
Runs on
Inside your AI tool
Nothing to install on your machine
Rust 87%C 4%Python 3%JavaScript 3%TypeScript 1%
Where to start reading
  1. 1
    README.md
    Start here — what it does and how to install it
  2. 2
    AGENTS.md
    The instructions the AI actually follows
  3. 3
    bin/lctx
    Where the program starts running
  4. 4
    skills/lean-ctx-review/SKILL.md
    Inside skills/ — an example of what the AI is told to do
  5. 5
    cookbook/.biomeignore
    A worked example — copy this to get going
What's in each folder
skills/Prompts, skills & agent definitions4 files
packages/Sub-packages / plugins61 files
integrations/Sub-packages / plugins34 files
bin/Command-line entry points1 files
docs/Documentation295 files
cookbook/Examples you can copy47 files
examples/Examples you can copy18 files
rust/Folder2446 files
READMEHas testsDocumentedCI checksExamples includedApache-2.0 licenseUpdated this month
Quick Actions
Details
Creator
yvgude
Language
Rust
Category
mcp-server
Published
3/23/2026

Are you the creator of this tool? and earn 85% of every sale.

Show it off in your README:

Featured on WorkflowStacks
[![Featured on WorkflowStacks](https://workflowstacks.com/api/badge/lean-ctx.svg)](https://workflowstacks.com/skills/lean-ctx?utm_source=github&utm_medium=badge)
🔥 Hot this week, in your inbox
Skills like this, every Monday.

The five fastest-growing open-source AI skills, ranked by GitHub star growth. One email a week, unsubscribe anytime.

Do this with a working workflow

Pages we wrote and tested that put a skill like this to work — importable n8n templates, outcome guides and Claude Desktop configs.