Local DeepWiki MCP Server
Local DeepWiki MCP 服务器
一个本地、注重隐私的 MCP 服务器,可为私有仓库生成 DeepWiki 风格的文档,并具备基于 RAG 的问答能力。
快速入门
立即尝试 — 已包含此项目的预构建 wiki:
git clone https://github.com/UrbanDiver/local-deepwiki-mcp.git
cd local-deepwiki-mcp
uv sync # Install dependencies
deepwiki serve .deepwiki # Browse the wiki at http://localhost:8080索引您自己的仓库 — 需要 LLM 提供商(OpenAI、Anthropic 或 Ollama):
export OPENAI_API_KEY="..." # Or ANTHROPIC_API_KEY for Anthropic
deepwiki init # Configure LLM + embedding providers
deepwiki config health-check # Verify providers are working
deepwiki update /path/to/repo # Index a repository and generate wiki
deepwiki serve /path/to/repo/.deepwiki要求: Python 3.11+、uv(请参阅下方的 安装 uv)以及一个 LLM 提供商:
OpenAI(默认) — 设置
OPENAI_API_KEY环境变量Anthropic — 设置
ANTHROPIC_API_KEY环境变量Ollama(完全本地,需要 GPU) — 安装 Ollama,然后运行
ollama pull qwen3-coder:30b
Related MCP server: Codebase Contextifier 9000
功能特性
多语言代码解析:使用 tree-sitter(支持 Python、TypeScript/JavaScript、Go、Rust、Java、C/C++、Objective-C、Swift、Ruby、PHP、Kotlin、C#)
基于 AST 的分块:遵循代码结构(函数、类、方法)
语义搜索:使用 LanceDB 向量数据库
LLM 驱动的 wiki 生成:支持 Ollama(本地)、Anthropic 和 OpenAI
可配置的嵌入模型 - 本地(sentence-transformers)或 OpenAI
增量索引 - 仅重新处理已更改的文件
基于 RAG 的问答 - 针对您的代码库进行提问
架构健康度 - 9 维度评分(复杂度、耦合度、代码异味、分层、代码流失、内聚性、重复度、可测试性、可维护性)
深度研究模式 - 针对复杂架构问题的多步推理
Web UI - 在浏览器中浏览生成的 wiki
导出为 HTML - 生成静态 HTML 站点以供共享
导出为 PDF - 生成带有 mermaid 图表的打印级 PDF 文档
交互式代码地图 - 带有 Mermaid 图表的跨文件执行流可视化
懒加载页面生成 - 访问时按需生成缺失的 wiki 页面
安装
使用 uv(推荐)
cd local-deepwiki-mcp
uv sync默认包含所有 LLM 提供商和 Web UI。PDF 导出的可选扩展:
uv sync --extra pdf # Add WeasyPrint for PDF export
uv sync --extra all # Same as --extra pdf (all optional extras)使用 pip
cd local-deepwiki-mcp
pip install -e ".[all]" # Recommended: install with all extras
# or: pip install -e . # Minimal: core only配置
运行初始化向导以自动生成配置文件:
deepwiki init # Interactive wizard
deepwiki init --non-interactive # Auto-detect defaults (CI/CD)或者在 ~/.config/local-deepwiki/config.yaml 手动创建一个:
embedding:
provider: "local" # or "openai"
local:
model: "all-MiniLM-L6-v2"
openai:
model: "text-embedding-3-small"
llm:
provider: "openai" # or "anthropic" or "ollama"
openai:
model: "gpt-4o"
# base_url: "https://your-proxy.example.com/v1" # For OpenAI-compatible proxies
anthropic:
model: "claude-sonnet-4-20250514"
ollama:
model: "qwen3-coder:30b"
base_url: "http://localhost:11434"
parsing:
languages:
- python
- typescript
- javascript
- go
- rust
- java
- c
- cpp
max_file_size: 1048576
exclude_patterns:
- "node_modules/**"
- "venv/**"
- ".git/**"
chunking:
max_chunk_tokens: 512
overlap_tokens: 50
output:
wiki_dir: ".deepwiki"
vector_db_name: "vectors.lance"安装 uv
uv 是一个快速的 Python 包管理器。如果您还没有安装:
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or with pip
pip install uv
# Or with Homebrew
brew install uv安装后,重启终端或运行 source ~/.bashrc(或 ~/.zshrc)。
MCP 服务器集成
MCP 服务器通过 stdio 运行,适用于任何兼容 MCP 的 AI 工具。手动启动方式:
deepwiki mcp或者配置您的 AI 工具自动启动它:
Claude Code
添加到 ~/.claude/claude_code_config.json:
{
"mcpServers": {
"local-deepwiki": {
"command": "uv",
"args": ["run", "--directory", "/path/to/local-deepwiki-mcp", "local-deepwiki"],
"env": {
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
}
}
}
}Cursor
添加到 Cursor 的 MCP 设置中(Settings > MCP Servers > Add):
{
"mcpServers": {
"local-deepwiki": {
"command": "uv",
"args": ["run", "--directory", "/path/to/local-deepwiki-mcp", "local-deepwiki"],
"env": {
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
}
}
}
}Windsurf
添加到 ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"local-deepwiki": {
"command": "uv",
"args": ["run", "--directory", "/path/to/local-deepwiki-mcp", "local-deepwiki"],
"env": {
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
}
}
}
}VS Code (Copilot)
添加到工作区中的 .vscode/mcp.json:
{
"servers": {
"local-deepwiki": {
"command": "uv",
"args": ["run", "--directory", "/path/to/local-deepwiki-mcp", "local-deepwiki"],
"env": {
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
}
}
}
}通用(任何 MCP 客户端)
服务器通过 MCP 协议 使用 stdio 进行通信。启动命令:
uv run --directory /path/to/local-deepwiki-mcp local-deepwiki或者在不使用 uv 的情况下(在 pip install -e . 之后):
local-deepwiki注意: 将 /path/to/local-deepwiki-mcp 替换为您克隆仓库的实际路径。如果使用 Anthropic 而非 OpenAI,请在 env 块中添加 ANTHROPIC_API_KEY。
MCP 工具(64 个工具)
服务器通过 8 个类别公开了 64 个 MCP 工具。以下是最常用的工具及其示例,随后是完整的工具参考。
核心工具
index_repository
索引仓库并生成 wiki 文档。
{
"repo_path": "/path/to/repo",
"full_rebuild": false,
"llm_provider": "ollama",
"embedding_provider": "local"
}ask_question
使用 RAG 对代码库进行提问。
{
"repo_path": "/path/to/repo",
"question": "How does the authentication system work?",
"max_context": 5
}deep_research
针对复杂架构问题的多步推理。执行查询分解、并行检索、差距分析和综合总结。
{
"repo_path": "/path/to/repo",
"question": "How does the authentication system interact with the database layer?",
"max_chunks": 30
}工具 | 描述 |
| 索引仓库并生成 wiki 文档 |
| 基于 RAG 的代码库问答 |
| 带有查询分解和综合的多步推理 |
| 获取 wiki 目录 |
| 读取特定的 wiki 页面 |
| 代码库语义搜索 |
| 将 wiki 导出为静态 HTML 站点 |
| 将 wiki 导出为带有 mermaid 图表渲染的 PDF |
生成器工具 (12)
工具 | 描述 |
| 生成 Mermaid 图表(类图、依赖图、模块图、时序图) |
| 函数调用图分析 |
| 可搜索的代码实体术语表 |
| 类继承树 |
| 文档覆盖率分析 |
| 基于 Git 的变更日志生成 |
| 参数和返回类型提取 |
| 提取实体的测试示例 |
| 检测过期的 wiki 页面 |
| 扫描硬编码的凭据 |
| 仓库索引状态和健康度 |
| 列出所有已索引的仓库 |
分析与搜索工具 (10)
工具 | 描述 |
| 跨 wiki 页面和代码实体的全文搜索 |
| 基于 Levenshtein 的名称匹配(“您是指?”) |
| 源文件的导入、调用者和相关文件 |
| 复合工具:术语表 + 调用图 + 继承 + 测试 + API 文档 |
| 带有反向调用图和风险等级的爆炸半径分析 |
| 通过 tree-sitter AST 获取圈复杂度和嵌套深度 |
| 将 git diff 映射到受影响的 wiki 页面和实体 |
| 基于 RAG 的代码变更问答 |
| 从 pyproject.toml、package.json 等解析元数据 |
| Wiki 健康仪表板:索引、页面、覆盖率、状态 |
架构健康工具 (17)
工具 | 描述 |
| 9 个维度的复合健康评分 (A-F) |
| 按复杂度、认知复杂度、参数、长度或嵌套对函数进行排名 |
| Robert C. Martin 耦合度指标 (Ca, Ce, I, A, D) |
| 检测上帝类、特性嫉妒、长方法等 |
| 分层违规检测 (handlers→services→core) |
| 带有流失率×复杂度复合指标的文件变更频率 |
| 通过 Jaccard 相似度计算共同变更耦合 |
| LCOM4 类内聚和模块导入内聚 |
| 类型 1(精确)和类型 2(结构)克隆检测 |
| 测试代码比、覆盖率映射、断言密度 |
| 每个函数的可维护性指数 (Halstead + CC + LOC) |
| 带有工作量/影响评估的优先级重构建议 |
| 比较两个 git 引用之间的健康度 |
| 历史健康评分快照 |
| 模块范围的复杂度、异味、耦合、风险 |
| 新开发者入职指南 |
| 代码库交互式导览 |
代码地图工具 (2)
工具 | 描述 |
| 带有 Mermaid 图表和 LLM 叙述的跨文件执行流地图 |
| 从调用图中心发现有趣的入口点 |
研究与进度工具 (4)
工具 | 描述 |
| 列出已保存的深度研究检查点 |
| 恢复之前保存的研究会话 |
| 取消正在进行的研究操作 |
| 检查长时间运行操作的进度 |
智能体工具 (5)
工具 | 描述 |
| 基于近期操作的上下文感知下一工具建议 |
| 运行预定义的多步工作流(例如:全面分析、快速审查) |
|
|
| 智能体 RAG:评估分块相关性,重写查询以获得更好结果 |
| 基于自然语言查询发现相关工具 |
Web 服务器工具 (2)
工具 | 描述 |
| 启动 wiki Web 服务器以浏览文档 |
| 停止正在运行的 wiki Web 服务器 |
CLI 命令
所有命令都是统一 deepwiki CLI 的子命令。旧版入口点(deepwiki-serve、deepwiki-export 等)仍可用于向后兼容。
命令 | 描述 |
| 配置交互式设置向导 |
| 显示索引健康度、新鲜度和 wiki 覆盖率 |
| 索引仓库并重新生成 wiki(增量) |
| 启动 MCP 服务器(用于 IDE 集成) |
| 使用 Web UI 提供 wiki 服务 |
| 监视模式 - 文件更改时自动重新索引 |
| 将 wiki 导出为静态 HTML |
| 将 wiki 导出为 PDF |
| 配置管理(验证、显示、健康检查、配置文件) |
| 交互式模糊代码搜索 |
| 缓存管理(统计、清除、清理) |
# Setup
deepwiki init # Interactive wizard
deepwiki init --non-interactive # Auto-detect defaults (CI/CD)
deepwiki init --non-interactive --force # Overwrite existing config
# Indexing & status
deepwiki update # Index repo and regenerate wiki
deepwiki update --full-rebuild # Force full rebuild
deepwiki update --dry-run # Preview what would change
deepwiki status # Show index health dashboard
deepwiki status --json # Machine-readable output
deepwiki status --verbose # Detailed file-level info
# MCP server
deepwiki mcp # Start MCP server (stdio)
# Web UI & export
deepwiki serve .deepwiki --port 8080 # Browse wiki in browser
deepwiki export .deepwiki --output ./html-export # Export to static HTML
deepwiki export-pdf .deepwiki -o docs.pdf # Export to single PDF
deepwiki export-pdf .deepwiki --separate -o dir/ # Export each page as PDF
# Configuration
deepwiki config show # Show effective configuration
deepwiki config show --raw # Show raw YAML
deepwiki config validate # Check config for errors
deepwiki config health-check # Verify provider connectivity
deepwiki config profile list # List saved config profiles
deepwiki config profile save dev # Save current config as profile
deepwiki config profile use prod # Switch to a profile
# Utilities
deepwiki search # Interactive fuzzy code search
deepwiki watch /path/to/repo # Auto-reindex on file changes
deepwiki cache stats # Show cache hit rates and sizes
deepwiki cache clear --llm --embedding # Clear caches
deepwiki cache cleanup # Remove expired entriesAPI 密钥
OpenAI(默认)
登录(或创建账户)
点击 Create new secret key
复制密钥并将其设置在您的环境中:
export OPENAI_API_KEY="sk-..."要使其持久化,请将 export 添加到您的 ~/.zshrc 或 ~/.bashrc 中。
Anthropic
点击 Create Key
将其设置在您的环境中:
export ANTHROPIC_API_KEY="sk-ant-..."使用 OpenAI 兼容代理
如果您的组织提供了 OpenAI 兼容的 API 端点(例如通过 GitHub Copilot Enterprise 或企业代理),请在配置中设置 base_url:
llm:
provider: "openai"
openai:
model: "gpt-4o"
base_url: "https://your-proxy.example.com/v1"OPENAI_API_KEY 环境变量仍是身份验证所必需的。
先决条件
对于本地 LLM 支持:
已安装并运行 Ollama
已拉取模型(例如
ollama pull llama3.2)
对于 PDF 导出:
系统库:
pango、cairo、gdk-pixbuf(WeasyPrint 依赖项)macOS:
brew install pangoUbuntu/Debian:
apt install libpango-1.0-0 libpangocairo-1.0-0
Mermaid 图表可选:
npm install -g @mermaid-js/mermaid-cli
故障排除
Ollama 连接错误
如果您看到 "Failed to connect to Ollama":
确保 Ollama 正在运行:
ollama serve验证模型已拉取:
ollama list检查默认 URL 是否有效:
curl http://localhost:11434/api/tags如果使用自定义端口,请使用正确的
base_url更新config.yaml
PDF 导出失败
"pango not found" 或类似的 Cairo/Pango 错误:
macOS:
brew install pango cairo gdk-pixbufUbuntu/Debian:
apt install libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0Fedora:
dnf install pango cairo gdk-pixbuf2
Mermaid 图表在 PDF 中未渲染:
安装 mermaid-cli:
npm install -g @mermaid-js/mermaid-cli验证:
mmdc --version如果没有 mermaid-cli,图表将显示为代码块
大型仓库的内存问题
对于代码行数超过 10 万行的仓库:
如果内存充足,请在配置中增加批处理大小限制
初始索引后,使用
full_rebuild: false进行增量更新考虑通过配置中的
exclude_patterns排除大型生成文件
LLM 质量问题
如果 wiki 内容出现幻觉或质量低下:
从 Ollama 切换到 Anthropic 或 OpenAI 以获得更好的结果
尝试更大的本地模型(例如
qwen3-coder:30b而非llama3.2)确保源文件已正确解析(检查支持的语言)
Web UI 无法加载
检查端口 8080 是否被占用:
lsof -i :8080尝试其他端口:
deepwiki serve .deepwiki --port 8081确保
.deepwiki目录存在
Available Tools
65 toolsanalyze_architectureARead-onlyIdempotent
Comprehensive architecture analysis in a single call. Runs health check, dependency analysis, design smell detection, and hotspot ranking, then returns a pre-synthesized markdown narrative report. No prior indexing required.
Inputs: repo_path (required), detail_level, focus.
analyze_diffARead-onlyIdempotent
Analyze git diff between two refs. Supports two modes:
mode='structured' (default): Map changed files to affected wiki pages and code entities. Returns structured analysis.
mode='question': Ask questions about the diff using RAG. Combines git diff with vector search context and LLM synthesis. Requires 'question' parameter.
No prior indexing required.
Inputs: repo_path (required), mode, question, base_ref, +3 more.
ask_about_diffARead-onlyIdempotent
Ask questions about recent code changes using RAG. Combines git diff with vector search context and LLM synthesis to answer questions like 'What changed?', 'Are there any bugs?', or 'What's the impact?'.
Note: This is an alias for analyze_diff with mode='question'.
No prior indexing required.
Inputs: repo_path (required), question (required), base_ref, head_ref, +1 more.
ask_questionARead-onlyIdempotent
Ask a question about an indexed repository using RAG. Returns an answer based on relevant code context.
Requires: index_repository must be called first.
Example: {"repo_path": "/path/to/repo", "question": "How does authentication work?"}
Inputs: repo_path (required), question (required), max_context, agentic_rag.
batch_explain_entitiesARead-onlyIdempotent
Explain multiple code entities in a single call. Loads the search index once and looks up each entity name. More efficient than calling explain_entity repeatedly.
Requires: index_repository must be called first.
Inputs: repo_path (required), entity_names (required), depth.
cancel_researchA
Cancel an active deep research session and save its checkpoint. The research can be resumed later using the deep_research tool with resume_research_id.
Requires: index_repository must be called first.
Inputs: repo_path (required), research_id (required).
compare_architectureARead-onlyIdempotent
Compare architecture health between two git refs. Shows which metrics improved or degraded, grade changes, and new/resolved smells. Uses git worktree for safe non-destructive analysis.
No prior indexing required.
Inputs: repo_path (required), base_ref, head_ref, detail_level.
deep_researchA
Perform deep research on a codebase question using multi-step reasoning. Unlike ask_question (single retrieval), this performs query decomposition, parallel retrieval, gap analysis, and comprehensive synthesis. Best for complex architectural questions. Supports checkpointing for long-running research that can be resumed if interrupted.
Requires: index_repository must be called first.
Example: {"repo_path": "/path/to/repo", "question": "How is the event system architected?"}
Inputs: repo_path (required), question (required), max_chunks, preset, +1 more.
detect_bugsARead-onlyIdempotent
Scan a repository for potential bugs using AST pattern matching. Detects bug patterns across Python, JavaScript, TypeScript, Go, Rust, Java, C, C++, C#, and Kotlin including mutable default arguments, bare excepts, unreachable code, empty catch blocks, missing breaks, and more. Set enrich=true for LLM verification.
No prior indexing required.
Inputs: repo_path (required), min_confidence, languages, enrich, +4 more.
detect_secretsARead-onlyIdempotent
Scan a repository for hardcoded credentials and secrets (API keys, tokens, passwords, private keys). Returns findings with type, location, confidence, and remediation advice.
No prior indexing required.
Inputs: repo_path (required), exclude_tests.
detect_stale_docsARead-onlyIdempotent
Find wiki pages that may be outdated because their source files have been modified since the documentation was generated.
Requires: index_repository must be called first.
Inputs: repo_path (required), threshold_days.
explain_entityARead-onlyIdempotent
Get a comprehensive explanation of a function, class, or method by combining glossary info, call graph, inheritance tree, test examples, and API docs into a single response.
Requires: index_repository must be called first.
Example: {"repo_path": "/path/to/repo", "entity_name": "MyClass"}
Inputs: repo_path (required), entity_name (required), include_call_graph, include_inheritance, +3 more.
export_wiki_htmlAIdempotent
Export wiki documentation to static HTML files. Creates a self-contained website that can be viewed without a server.
Requires: index_repository must be called first.
Inputs: wiki_path (required), output_path.
export_wiki_pdfAIdempotent
Export wiki documentation to PDF format. Creates a printable PDF document with proper formatting, page numbers, and table of contents.
Requires: index_repository must be called first.
Inputs: wiki_path (required), output_path, single_file.
find_toolsARead-onlyIdempotent
Search for tools by capability description. Returns ranked matches with tool name, description, and whether indexing is required. Useful when an agent needs to discover which tool to use.
No prior indexing required.
Inputs: query (required).
fuzzy_searchARead-onlyIdempotent
Fuzzy name matching for functions, classes, and methods using Levenshtein distance. Returns 'Did you mean?' suggestions, file locations, and similarity scores. Great for finding entities when you don't know the exact name.
Requires: index_repository must be called first.
Inputs: repo_path (required), query (required), threshold, limit, +1 more.
generate_codemapARead-onlyIdempotent
Generate a Windsurf-style codemap: a focused execution-flow map with Mermaid diagram and narrative trace for a question or topic. Shows how code flows across files with file paths and line numbers. Best for understanding 'How does X work?' questions.
Requires: index_repository must be called first.
Example: {"repo_path": "/path/to/repo", "query": "How does request handling work?"}
Inputs: repo_path (required), query (required), entry_point, focus, +2 more.
get_api_docsARead-onlyIdempotent
Get API documentation with function signatures, parameters, return types, and docstrings for a specific file. Uses tree-sitter AST parsing for accuracy.
No prior indexing required.
Inputs: repo_path (required), file_path (required).
get_architecture_healthARead-onlyIdempotent
Comprehensive architecture health check. Runs complexity hotspot analysis, coupling metrics, design smell detection, and layer dependency analysis in a single call. Returns an overall health grade (A-F), per-dimension scores, and top findings.
No prior indexing required.
Inputs: repo_path (required), top_findings, detail_level.
get_architecture_summaryARead-onlyIdempotent
Deprecated: use get_architecture_health with detail_level='full' instead. Returns a composite architecture overview combining health grade, layer dependency analysis, and file metrics.
No prior indexing required.
Inputs: repo_path (required).
get_architecture_trendsARead-onlyIdempotent
View architecture health score trends over time. Returns historical snapshots with overall and per-dimension scores. Snapshots are saved automatically by 'deepwiki check' and 'deepwiki update'. No prior indexing required (reads saved history).
Inputs: repo_path (required), since.
get_call_graphARead-onlyIdempotent
Get function call graphs showing which functions call which. Can analyze a specific file or the entire repository. Returns a Mermaid flowchart.
Requires: index_repository must be called first.
Inputs: repo_path (required), file_path.
get_changelogARead-onlyIdempotent
Extract recent git commit history as a formatted changelog. Groups commits by date and includes file change information.
No prior indexing required.
Inputs: repo_path (required), max_commits.
get_churn_metricsARead-onlyIdempotent
Analyze file change frequency from git history. Shows which files change most often, optionally overlaid with cyclomatic complexity to find high-risk hotspots (frequently changed + complex). Also reports churn concentration (Gini coefficient).
No prior indexing required.
Inputs: repo_path (required), window_days, top_n, include_complexity.
get_co_changeARead-onlyIdempotent
Find files that frequently change together in the same commits. Uses Jaccard similarity to measure co-change strength. High co-change coupling may indicate hidden dependencies or candidates for merging/splitting.
No prior indexing required.
Inputs: repo_path (required), window_days, min_shared, top_n.
get_cohesion_metricsARead-onlyIdempotent
Analyze class and module cohesion. Reports LCOM4 (Lack of Cohesion of Methods) for each class and internal-import ratio for each package. Classes with LCOM4 > 1 may be candidates for splitting. Modules with low cohesion ratio rely heavily on external imports.
No prior indexing required.
Inputs: repo_path (required), top_n, exclude_tests.
get_complexity_metricsARead-onlyIdempotent
Analyze code complexity for a source file using tree-sitter AST parsing. Returns function/class counts, line metrics, cyclomatic complexity, nesting depth, and parameter counts.
No prior indexing required.
Inputs: repo_path (required), file_path (required).
get_coupling_metricsARead-onlyIdempotent
Compute Robert C. Martin package-level coupling metrics per module: afferent coupling (Ca), efferent coupling (Ce), instability (I = Ce/(Ca+Ce)), abstractness (A = abstract_classes/total_classes), and distance from the main sequence (D = |A+I-1|). Modules with high distance are either too concrete-and-stable or too abstract-and-unstable.
No prior indexing required.
Inputs: repo_path (required), module_filter, top_n, include_leaves, +2 more.
get_coverageARead-onlyIdempotent
Get documentation coverage report for an indexed repository. Shows which classes, functions, and methods have docstrings and which don't.
Requires: index_repository must be called first.
Inputs: repo_path (required).
get_cross_module_dependenciesARead-onlyIdempotent
Build an inter-module import graph for a Python repository. Returns module nodes (with file counts and line counts), weighted directed edges, most-depended-on and most-dependent modules, and a Mermaid graph LR diagram.
No prior indexing required.
Inputs: repo_path (required), module_filter, include_external, min_edge_weight, +2 more.
get_design_smellsARead-onlyIdempotent
Detect common design smells using heuristic AST-based thresholds: God Class (>15 methods AND >500 lines), Long Method (>80 lines AND cyclomatic complexity >7, or CC >15), Long Parameter List (>6 params), Feature Envy (>3 calls to another class's methods), Large File (>800 lines), Deep Nesting (>4 levels), Data Clump (3+ functions share 3+ identical parameter names). Returns smells with severity, file location, entity name, description, and refactoring suggestion.
No prior indexing required.
Inputs: repo_path (required), severity_threshold, exclude_tests, top_n, +1 more.
get_diagramsARead-onlyIdempotent
Generate Mermaid diagrams for an indexed repository. Supports class diagrams, dependency graphs, module overviews, language distribution pie charts, and sequence diagrams.
Requires: index_repository must be called first.
Example: {"repo_path": "/path/to/repo", "diagram_type": "class"}
Inputs: repo_path (required), diagram_type, entry_point.
get_duplication_metricsARead-onlyIdempotent
Detect code duplication using two methods: exact clones (Type 1, line-based fingerprinting) and structural clones (Type 2, AST node-type sequences). Reports duplication ratio, clone groups, and largest clone blocks.
No prior indexing required.
Inputs: repo_path (required), min_lines, top_n, exclude_tests.
get_file_contextARead-onlyIdempotent
Get rich context for a source file: imports, callers (who uses this file), related files, and type definitions used. Helps understand a file's role in the codebase.
Requires: index_repository must be called first.
Inputs: repo_path (required), file_path (required), detail_level.
get_glossaryARead-onlyIdempotent
Get a searchable glossary of all code entities (classes, functions, methods) in an indexed repository. Useful for discovering what's in the codebase.
Requires: index_repository must be called first.
Inputs: repo_path (required), search, file_path, limit, +1 more.
get_guided_tourARead-onlyIdempotent
Generate a guided tour of a codebase organized by topic. Returns an ordered list of file stops with explanations. Topics: architecture, data_flow, request_handling, testing, or custom:. No prior indexing required.
Inputs: repo_path (required), topic, max_stops, enrich.
get_hotspotsARead-onlyIdempotent
Rank functions across an entire repository by a chosen complexity metric (cyclomatic complexity, parameter count, line length, or nesting depth). Returns top-N hotspots with full detail breakdown. Useful for prioritising refactoring efforts.
No prior indexing required.
Inputs: repo_path (required), metric, top_n, min_threshold, +2 more.
get_index_statusARead-onlyIdempotent
Get index statistics for a repository without re-indexing. Shows file count, chunk count, languages, and when it was last indexed.
Note: This is an alias for get_status with scope='index'.
Requires: index_repository must be called first.
Inputs: repo_path (required).
get_inheritanceARead-onlyIdempotent
Get class inheritance hierarchy trees for an indexed repository. Shows parent-child relationships, abstract classes, and generates a Mermaid inheritance diagram.
Requires: index_repository must be called first.
Inputs: repo_path (required), search, limit, offset.
get_layer_dependenciesARead-onlyIdempotent
Analyze architectural layer dependencies in a Python codebase. Categorizes files into layers (web, handlers, services, generators, core, providers, models) and detects upward dependency violations where lower layers import from higher layers. Returns layer file counts, dependency edges, and violations.
No prior indexing required.
Inputs: repo_path (required), summary_only.
get_maintainability_metricsARead-onlyIdempotent
Compute Maintainability Index (MI) per function across a Python repository. MI combines Halstead Volume, cyclomatic complexity, and lines of code into a 0-100 score. Returns the worst-scoring functions first. Functions with MI < 20 are hard to maintain.
No prior indexing required.
Inputs: repo_path (required), top_n, exclude_tests.
get_module_healthARead-onlyIdempotent
Deep health analysis of a single module. Shows complexity distribution, design smells, coupling metrics, dependents (who uses this module), dependencies (what it uses), and refactoring risk level.
No prior indexing required.
Inputs: repo_path (required), module_name (required).
get_onboarding_guideARead-onlyIdempotent
Generate a developer onboarding guide for a codebase. Returns a markdown narrative with project overview, getting started instructions, repository layout, entry points, key modules, and testing info. No prior indexing required.
Inputs: repo_path (required), detail_level.
get_operation_progressARead-onlyIdempotent
Get progress for active long-running operations. Supports polling-based progress tracking for clients that cannot receive push notifications. Returns current progress, ETA, and phase information.
No prior indexing required.
Inputs: operation_id.
get_project_manifestARead-onlyIdempotent
Get parsed project metadata from package manifest files (pyproject.toml, package.json, Cargo.toml, go.mod, etc.). Returns name, version, dependencies, scripts, tech stack summary.
No prior indexing required.
Inputs: repo_path (required), use_cache.
get_recommendationsARead-onlyIdempotent
Generate prioritized refactoring recommendations from architecture health analysis. Returns actionable suggestions with effort/impact scoring. Set enrich=true for LLM-generated detailed descriptions. No prior indexing required.
Inputs: repo_path (required), max_items, category_filter, enrich.
get_statusARead-onlyIdempotent
Get repository index status and/or wiki health dashboard.
scope='all' (default): Returns both index status and wiki stats.
scope='index': Index stats only (file count, chunks, languages).
scope='wiki': Wiki health dashboard (pages, coverage, staleness).
Requires: index_repository must be called first.
Inputs: repo_path (required), scope.
get_testability_metricsARead-onlyIdempotent
Analyze testability metrics for a Python repository. Reports test-to-code ratio, matches test files to source modules, counts assertions per test, and identifies untested source files.
No prior indexing required.
Inputs: repo_path (required).
get_test_examplesBRead-onlyIdempotent
Find usage examples for a function or class by searching test files in the indexed repository. Returns code snippets showing how the entity is used in tests.
Requires: index_repository must be called first.
Inputs: repo_path (required), entity_name (required), max_examples.
get_wiki_statsARead-onlyIdempotent
Get a wiki health dashboard with index stats, page counts, search index size, coverage data, and wiki status - all in a single call.
Note: This is an alias for get_status with scope='wiki'.
Requires: index_repository must be called first.
Inputs: repo_path (required).
impact_analysisARead-onlyIdempotent
Analyze the blast radius of changes to a file or entity. Combines reverse call graph, inheritance dependents, file-level imports, and affected wiki pages to help understand impact before making changes.
Requires: index_repository must be called first.
Example: {"repo_path": "/path/to/repo", "file_path": "src/auth.py"}
Inputs: repo_path (required), file_path (required), entity_name, include_reverse_calls, +3 more.
index_repositoryAIdempotent
Index a repository and generate wiki documentation. This parses all source files, extracts semantic code chunks, generates embeddings, and creates wiki markdown files.
No prior indexing required.
Example: {"repo_path": "/path/to/repo"}
Inputs: repo_path (required), output_dir, languages, full_rebuild, +6 more.
list_indexed_reposARead-onlyIdempotent
Discover all indexed repositories under a given directory. Searches for .deepwiki directories and returns index metadata for each.
No prior indexing required.
Inputs: base_path.
list_research_checkpointsARead-onlyIdempotent
List all research checkpoints for a repository. Shows incomplete and cancelled research sessions that can be resumed using the deep_research tool with resume_research_id.
Requires: index_repository must be called first.
Inputs: repo_path (required).
query_codebaseARead-onlyIdempotent
Smart query that combines ask_question with automatic escalation to deep_research when the initial answer is insufficient. Single entry point for codebase Q&A.
Requires: index_repository must be called first.
Inputs: repo_path (required), query (required), auto_escalate.
read_wiki_pageARead-onlyIdempotent
Read a specific wiki page content.
Requires: index_repository must be called first.
Inputs: wiki_path (required), page (required).
read_wiki_structureARead-onlyIdempotent
Get the table of contents and structure of a generated wiki.
Requires: index_repository must be called first.
Inputs: wiki_path (required).
resume_researchA
Resume a previously interrupted deep research session from its checkpoint. This is a convenience wrapper - you can also use deep_research with resume_research_id directly.
Requires: index_repository must be called first.
Inputs: repo_path (required), research_id (required).
run_workflowARead-onlyIdempotent
Run a pre-built multi-step workflow. Available presets: 'onboarding' (project overview), 'security_audit' (secrets + complexity), 'full_analysis' (stats + coverage + stale + secrets), 'quick_refresh' (stale docs + changelog).
Requires: index_repository must be called first.
Example: {"repo_path": "/path/to/repo", "workflow": "onboarding"}
Inputs: repo_path (required), workflow (required).
search_codeARead-onlyIdempotent
Semantic search across the indexed codebase with optional fuzzy matching and filters. Returns relevant code chunks with similarity scores.
Requires: index_repository must be called first.
Example: {"repo_path": "/path/to/repo", "query": "error handling"}
Inputs: repo_path (required), query (required), limit, language, +4 more.
search_wikiARead-onlyIdempotent
Full-text search across wiki pages and code entities. Searches titles, headings, code terms, descriptions, and keywords. Returns ranked matches.
Requires: index_repository must be called first.
Inputs: repo_path (required), query (required), limit, entity_types.
serve_wikiA
Start the interactive wiki web server for a .deepwiki directory. Launches a Flask app with chat, search, codemap explorer, and research UI. The server runs as a subprocess and can be stopped with stop_wiki_server.
Requires: index_repository must be called first.
Example: {"wiki_path": "/path/to/repo/.deepwiki"}
Inputs: wiki_path (required), host, port, open_browser.
stop_wiki_serverA
Stop a previously started wiki web server. Gracefully terminates the server process. If no server is found on the specified port, returns a list of currently running servers.
No prior indexing required.
Inputs: port, wiki_path.
suggest_codemap_topicsARead-onlyIdempotent
Suggest interesting codemap topics for a repository based on call graph hubs, core modules, and common entry patterns. Use before generate_codemap to discover what flows are worth exploring.
Requires: index_repository must be called first.
Inputs: repo_path (required), max_suggestions.
suggest_next_actionsARead-onlyIdempotent
Suggest which tools to use next based on tools already used. Returns ranked suggestions with reasons. No LLM calls - uses a static decision tree for instant responses.
No prior indexing required.
Inputs: tools_used, context, repo_path.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 65 tools
Most tools have clear, distinct purposes, though some aliases (e.g., ask_about_diff for analyze_diff, get_wiki_stats for get_status) and a deprecated tool introduce minor ambiguity. Descriptions are sufficiently detailed to differentiate the many metrics and analysis tools.
Naming follows a mostly consistent verb_noun pattern (e.g., analyze_architecture, search_code, get_complexity_metrics). Some mixing of verb styles (ask, batch_explain, cancel, serve) occurs, but it's not chaotic. Aliases and deprecated items are well-documented.
With 65 tools, the surface is very large. While the domain (code analysis and documentation) could justify a broad set, many metric tools (e.g., get_churn_metrics, get_co_change) could be consolidated. This many tools may overwhelm agents and increase selection errors.
The tool set comprehensively covers indexing, searching, architecture analysis, metrics, diff analysis, research, documentation export, and more. No obvious missing operations for the stated purpose; it handles the full lifecycle of code analysis and wiki generation.
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
A cited wiki of your GitHub repo: search, read pages, find symbols and ask, with line citations.
Codebase intelligence for AI coding agents: graph, git history, docs, decisions, code health.
Related MCP Servers
- AlicenseAqualityBmaintenanceGenerates professional documentation for multi-language codebases with deep AST-based code analysis, supporting Docusaurus, MkDocs, and Sphinx frameworks. Includes API documentation generation, PDF export, OpenAPI spec generation, and sales-ready documentation for code marketplaces.9MIT
- AlicenseNot gradedqualityDmaintenanceEnables semantic code search across multiple repositories using AST-aware chunking and relationship tracking. Supports local LLM embeddings, real-time indexing, and cross-codebase dependency analysis through vector and graph databases.3MIT
- AlicenseNot gradedqualityDmaintenanceAutomatically generates comprehensive wiki documentation from any codebase, including Mermaid diagrams, source code citations, and automated quality checks.3MIT
- AlicenseNot gradedqualityDmaintenanceGenerates comprehensive documentation (architecture overview, dependency graph, API surface, and README) for any codebase locally without external APIs.1MIT