AI Skill Hub 推荐使用:LeanKG: 开源MCP工具 是一款优质的MCP工具。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
LeanKG是一款开源的MCP工具,帮助开发者减少Token的消耗,提高编码效率。它基于Rust语言开发,提供了一个高效的MCP解决方案。
LeanKG: 开源MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
LeanKG是一款开源的MCP工具,帮助开发者减少Token的消耗,提高编码效率。它基于Rust语言开发,提供了一个高效的MCP解决方案。
LeanKG: 开源MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/FreePeak/LeanKG
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"leankg----mcp--": {
"command": "npx",
"args": ["-y", "leankg"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 LeanKG: 开源MCP工具 执行以下任务... Claude: [自动调用 LeanKG: 开源MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"leankg____mcp__": {
"command": "npx",
"args": ["-y", "leankg"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<p align="center"> <img src="https://www.leankg.com/icon.svg" alt="LeanKG" width="80" height="80"> </p>
detect_changes classifies risk as critical/high/medium/lowIMPORTS, CALLS, TESTED_BY edges@Entity, @HiltViewModel, and other annotationsSee docs/architecture.md for system design and data model details.
---
---
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- <target>
Supported targets:
| Target | AI Tool | Auto-Installed |
|---|---|---|
opencode | OpenCode AI | Binary + MCP + Plugin + Skill + AGENTS.md |
cursor | Cursor AI | Binary + MCP + Skill + AGENTS.md + Session Hook |
claude | Claude Code | Binary + MCP + Plugin + Skill + CLAUDE.md + Session Hook |
gemini | Gemini CLI | Binary + MCP + Skill + GEMINI.md |
kilo | Kilo Code | Binary + MCP + Skill + AGENTS.md |
antigravity | Google Antigravity | Binary + MCP + Skill + GEMINI.md |
Examples:
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- cursor
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- claude
cargo install leankg && leankg --version
git clone https://github.com/FreePeak/LeanKG.git && cd LeanKG && cargo build --release
---
LeanKG auto-triggers in Claude Code sessions via lifecycle hooks that route search intents to LeanKG tools instead of native tools.
```bash
leankg setup
leankg update
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- update
```bash leankg init # Initialize LeanKG in your project leankg index ./src # Index your codebase leankg watch ./src # Auto-index on file changes leankg impact src/main.rs --depth 3 # Calculate blast radius leankg status # Check index status leankg metrics # View token savings leankg web # Start Web UI at http://localhost:8080 leankg export --format mermaid # Export graph as Mermaid, DOT, or JSON leankg quality --min-lines 50 # Find oversized functions leankg detect-clusters # Identify functional code communities leankg trace --all # Show feature-to-code traceability leankg annotate src/main.rs::main -d "Entry point" # Annotate code elements
LeanKG uses memory-mapped I/O and in-memory caching which can consume significant RAM on macOS. Primary causes:
| Cause | Location | Fix |
|---|---|---|
| SQLite mmap_size=256MB | src/db/schema.rs:20 | Set LEANKG_MMAP_SIZE=134217728 (128MB) |
Deprecated all_elements() | src/graph/query.rs:537 | Use get_elements_paginated() instead |
Deprecated all_relationships() | src/graph/query.rs:992 | Use get_relationships_paginated() |
| SessionCache 500K tokens | src/compress/session_cache.rs:11 | Set LEANKG_CACHE_MAX_TOKENS=100000 |
| Multiple GraphEngine cached | src/mcp/server.rs:48-49 | Cache eviction with TTL |
| Multiple cache layers | Various | Enable memory_only mode for PersistentCache |
Quick fix - add to your shell profile:
export LEANKG_MMAP_SIZE=134217728 # 128MB instead of 256MB
export LEANKG_CACHE_MAX_TOKENS=100000 # 100K instead of 500K
See INSTRUCTION.md for detailed memory tuning and MCP server setup.
Try LeanKG without installing: https://leankg.onrender.com
leankg web --port 9000
---
leankg api-serve --port 8081 --auth leankg api-key create --name my-key
LeanKG是一款高质量的开源MCP工具,基于Rust语言开发,提供了一个高效的MCP解决方案。它适用于需要MCP功能的开发者,帮助他们提高编码效率和减少Token的消耗。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
总体来看,LeanKG: 开源MCP工具 是一款质量良好的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | LeanKG |
| Topics | mcpantigravityclaude-codeconcise-contextcursorgeminirust |
| GitHub | https://github.com/FreePeak/LeanKG |
| License | Apache-2.0 |
| 语言 | Rust |
收录时间:2026-05-24 · 更新时间:2026-05-24 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端