lean-context-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LEAN_RG | No | Path to the ripgrep binary. | rg |
| LEAN_ALLOW | No | Replaces the allowlist of commands run_compact may execute; patterns separated by ';'. | built-in list |
| LEAN_ROOTS | No | Allowed roots, separated by ':' or ','. Relative paths resolve against the first root. If not set, the server's current directory is the only root. | cwd |
| LEAN_CONFIG | No | JSON config file with { roots, allow, maxOutputChars, defaultTimeoutSec, maxTimeoutSec }. | $LEAN_CACHE_DIR/config.json |
| LEAN_TIMEOUT | No | Default run_compact timeout in seconds. The maximum is 1800. | 300 |
| LEAN_CACHE_DIR | No | Location of cache.json and the default config file. | ~/.lean-context |
| LEAN_MAX_CHARS | No | Output cap per tool call. | 8000 |
| LEAN_NO_REEXEC | No | Set to 1 to disable the entry point relaunching itself with node --liftoff-only. | |
| LEAN_ALLOW_EXTRA | No | Appends to the run_compact command allowlist. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| outlineA | Symbol map of a file (signatures + line ranges) or dir (files with symbol counts). Use before reading files. |
| read_symbolC | Source of one symbol (e.g. "fn", "Class.method") or a line range. |
| searchB | Code search (ripgrep), grouped by file. Every matching file is listed with its count; big results are compacted. Literal unless regex=true. |
| run_compactA | Run an allowlisted test/build/lint command (no shell). Returns exit code + failures only; full log path included. |
| summary_cacheA | Short per-file notes, auto-invalidated when the file changes. get before reading; set after understanding a file. |
| project_notesC | Repo memory (/.lean-context/notes.md): conventions, decisions, commands. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 6 tools
Tools are mostly distinct: outline (structure), read_symbol (content), search (find), run_compact (execute), and two memory tools. The only overlap is project_notes vs summary_cache, but descriptions clearly separate repo-level decisions from per-file notes.
Mixed conventions: verb_noun (read_symbol, run_compact), bare verbs (search, outline), and noun phrases (project_notes, summary_cache). Still readable and predictable enough to navigate, but no single pattern holds.
Six tools is well-scoped for a lean context server, with each tool covering a distinct stage of the read/navigate/remember workflow. No bloat or redundancy.
Covers navigation (outline, search), reading (read_symbol with line ranges), memory (project_notes, summary_cache get/set), and command execution with compact output. Minor gap: no explicit listing or invalidation control of cached notes beyond automatic file-change invalidation.