LeanCTX 提供 58 个 MCP 工具,分为四个类别。每个工具由 AI 自动使用--您无需学习或输入任何命令。
核心工具--文件与代码
基础工具。处理文件读取、目录浏览、命令执行和代码搜索--占 AI 编程交互 90% 的操作。
| 工具 | 功能描述 | 节省 |
|---|---|---|
ctx_read | 智能文件读取,支持 10 read modes + 会话缓存 | up to 99% |
ctx_multi_read | 单次调用批量读取文件 | 减少往返次数 |
ctx_tree | 紧凑的项目结构图 | 34-60% |
ctx_shell | 支持 95+ 种模式压缩的 Shell 命令。使用 raw=true 获取未压缩输出。 | |
ctx_search | 紧凑结果的正则表达式代码搜索 | 50-80% |
ctx_edit | Context-aware file editor with create, replace, and replace_all | - |
ctx_delta | Show only changed lines since last read | 80-95% |
ctx_smart_read | Intelligent single-call read with auto-mode | varies |
智能引擎
超越压缩的工具--它们理解您的工作流,检测意图,去除重复上下文,并智能管理 token 预算。
| 工具 | 功能描述 |
|---|---|
ctx_fill | 基于优先级的上下文填充,带 token 预算 |
ctx_intent | 语义意图检测 + 自动文件加载 |
ctx_context | 多轮上下文状态概览 |
ctx_graph | 持久化项目依赖图(构建、关联、符号、影响) |
ctx_dedup | 跨文件去重分析 |
ctx_response | 双向响应压缩 |
ctx_discover | Shell 历史分析,发现未利用的压缩机会 |
ctx_preload | 主动上下文加载器 - 在会话开始时缓存任务相关文件 |
ctx_semantic_search | 混合语义搜索(BM25 + 向量嵌入)- 即使没有关键词重叠也能按含义找到代码 |
ctx_overview | Project overview with structure, entry points, and key files |
ctx_prefetch | Pre-load files based on task context and changed files |
ctx_graph_diagram | 依赖图或调用图的 Mermaid 图表 |
ctx_compress_memory | 压缩记忆/配置 Markdown(保留代码/URL)+ .original 备份 |
ctx_impact | Impact analysis: trace dependency chains and build graphs |
ctx_architecture | Graph-based architecture analysis: clusters, layers, cycles |
ctx_analyze | Entropy analysis - recommends optimal compression mode |
会话与监控
会话持久化、性能监控、压缩分析和基准测试--衡量和优化 token 节省所需的一切。
| 工具 | 功能描述 |
|---|---|
ctx_session | 跨对话的会话记忆(任务、发现、决策) |
ctx_compress | 紧凑的上下文检查点,用于继续对话 |
ctx_benchmark | 按模式的实际 token 计数--单文件或全项目 |
ctx_metrics | 带美元成本估算的会话统计 |
ctx_wrapped | 节省报告卡(每周/每月/累计) |
ctx_cache | 显式缓存管理(状态、清除、失效) |
ctx_gain | Query token savings, GainScore (0–100), cost breakdowns, task classifications, and per-agent statistics. Powered by the GainEngine with embedded ModelPricing. |
ctx_heatmap | File access heatmap - find hot files and cold directories |
记忆与多代理
跨会话记忆、多代理协调和任务感知项目定向。v2.7.0 新增。
| 工具 | 功能描述 |
|---|---|
ctx_knowledge | 持久化项目知识库--跨会话记忆事实 |
ctx_agent | 多代理协调 - 注册、发布、任务交接、状态同步 |
ctx_share | 多代理上下文共享 - 在代理之间推送/拉取缓存文件内容 |
ctx_task | Task delegation and tracking across agents |
ctx_cost | Cost attribution - track token spend per agent and tool |
ctx_context | 多轮上下文状态概览 |
Workflow & Orchestration
State machines, context handoff, sandboxed code execution, and quality feedback loops.
| 工具 | 功能描述 |
|---|---|
ctx_workflow | State-machine workflows with step ordering and evidence |
ctx_handoff | Context transfer between sessions or agents |
ctx_execute | Sandboxed code execution in 11 languages |
ctx_feedback | Quality feedback: latency, token counts, model info |
View Workflow & Orchestration docs →
Analysis & Navigation
Tree-sitter-powered symbol navigation, call graphs, route extraction, and structural outlining.
| 工具 | 功能描述 |
|---|---|
ctx_symbol | Find symbol definitions across 18 languages |
ctx_callers | Find all call sites of a function |
ctx_callees | Find all functions called by a symbol |
ctx_outline | Structural outline of a file |
ctx_routes | Extract HTTP routes from web frameworks |
ctx_smells | Code smell detection with graph-enriched scoring (long functions, deep nesting, complexity) |
ctx_smells | Detect code smells and anti-patterns |