Skip to main content
Glama
Local DeepWiki MCP Server

Local DeepWiki MCP Server

by UrbanDiver

Servidor MCP Local DeepWiki

Un servidor MCP local centrado en la privacidad que genera documentación al estilo DeepWiki para repositorios privados con capacidades de preguntas y respuestas basadas en RAG.

Inicio rápido

Pruébelo inmediatamente — se incluye una wiki preconstruida de este proyecto:

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

Indexe su propio repositorio — requiere un proveedor de LLM (OpenAI, Anthropic u 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

Requisitos: Python 3.11+, uv (consulte Instalación de uv a continuación) y un proveedor de LLM:

  • OpenAI (predeterminado) — establezca la variable de entorno OPENAI_API_KEY

  • Anthropic — establezca la variable de entorno ANTHROPIC_API_KEY

  • Ollama (totalmente local, requiere GPU) — instale Ollama, luego ollama pull qwen3-coder:30b

Related MCP server: Codebase Contextifier 9000

Características

  • Análisis de código multilingüe usando tree-sitter (Python, TypeScript/JavaScript, Go, Rust, Java, C/C++, Objective-C, Swift, Ruby, PHP, Kotlin, C#)

  • Fragmentación basada en AST que respeta la estructura del código (funciones, clases, métodos)

  • Búsqueda semántica usando la base de datos vectorial LanceDB

  • Generación de wiki impulsada por LLM con soporte para Ollama (local), Anthropic y OpenAI

  • Embeddings configurables - locales (sentence-transformers) u OpenAI

  • Indexación incremental - solo reprocesa los archivos modificados

  • Preguntas y respuestas basadas en RAG - haga preguntas sobre su código base

  • Salud de la arquitectura - puntuación de 9 dimensiones (complejidad, acoplamiento, olores, capas, rotación, cohesión, duplicación, capacidad de prueba, mantenibilidad)

  • Modo de investigación profunda - razonamiento de varios pasos para preguntas arquitectónicas complejas

  • Interfaz web - explore la wiki generada en su navegador

  • Exportación a HTML - genere un sitio HTML estático para compartir

  • Exportación a PDF - genere documentación PDF imprimible con diagramas mermaid

  • Mapa de código interactivo - visualización del flujo de ejecución entre archivos con diagramas Mermaid

  • Generación de páginas bajo demanda - las páginas wiki faltantes se generan cuando se visitan

Instalación

Usando uv (recomendado)

cd local-deepwiki-mcp
uv sync

Todos los proveedores de LLM y la interfaz web se incluyen de forma predeterminada. Extra opcional para exportación a PDF:

uv sync --extra pdf              # Add WeasyPrint for PDF export
uv sync --extra all              # Same as --extra pdf (all optional extras)

Usando pip

cd local-deepwiki-mcp
pip install -e ".[all]"          # Recommended: install with all extras
# or: pip install -e .           # Minimal: core only

Configuración

Ejecute el asistente de inicio para generar un archivo de configuración automáticamente:

deepwiki init                    # Interactive wizard
deepwiki init --non-interactive  # Auto-detect defaults (CI/CD)

O cree uno manualmente en ~/.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"

Instalación de uv

uv es un gestor de paquetes de Python rápido. Si no lo tiene:

# 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

Después de instalarlo, reinicie su terminal o ejecute source ~/.bashrc (o ~/.zshrc).

Integración del servidor MCP

El servidor MCP se ejecuta sobre stdio y funciona con cualquier herramienta de IA compatible con MCP. Inícielo manualmente con:

deepwiki mcp

O configure su herramienta de IA para iniciarlo automáticamente:

Claude Code

Añada a ~/.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

Añada a la configuración de MCP de Cursor (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

Añada a ~/.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)

Añada a .vscode/mcp.json en su espacio de trabajo:

{
  "servers": {
    "local-deepwiki": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/local-deepwiki-mcp", "local-deepwiki"],
      "env": {
        "OPENAI_API_KEY": "${OPENAI_API_KEY}"
      }
    }
  }
}

Genérico (cualquier cliente MCP)

El servidor se comunica a través de stdio usando el protocolo MCP. Inicie con:

uv run --directory /path/to/local-deepwiki-mcp local-deepwiki

O sin uv (después de pip install -e .):

local-deepwiki

Nota: Reemplace /path/to/local-deepwiki-mcp con la ruta real donde clonó el repositorio. Añada ANTHROPIC_API_KEY al bloque env si usa Anthropic en lugar de OpenAI.

Herramientas MCP (64 herramientas)

El servidor expone 64 herramientas MCP en 8 categorías. A continuación se muestran las herramientas más utilizadas con ejemplos, seguidas de la referencia completa de herramientas.

Herramientas principales

index_repository

Indexa un repositorio y genera documentación wiki.

{
  "repo_path": "/path/to/repo",
  "full_rebuild": false,
  "llm_provider": "ollama",
  "embedding_provider": "local"
}

ask_question

Haga una pregunta sobre el código base usando RAG.

{
  "repo_path": "/path/to/repo",
  "question": "How does the authentication system work?",
  "max_context": 5
}

deep_research

Razonamiento de varios pasos para preguntas arquitectónicas complejas. Realiza descomposición de consultas, recuperación paralela, análisis de brechas y síntesis integral.

{
  "repo_path": "/path/to/repo",
  "question": "How does the authentication system interact with the database layer?",
  "max_chunks": 30
}

Herramienta

Descripción

index_repository

Indexa un repositorio y genera documentación wiki

ask_question

Preguntas y respuestas basadas en RAG sobre el código base

deep_research

Razonamiento de varios pasos con descomposición y síntesis de consultas

read_wiki_structure

Obtiene la tabla de contenidos de la wiki

read_wiki_page

Lee una página wiki específica

search_code

Búsqueda semántica en todo el código base

export_wiki_html

Exporta la wiki a un sitio HTML estático

export_wiki_pdf

Exporta la wiki a PDF con renderizado de diagramas mermaid

Herramientas de generación (12)

Herramienta

Descripción

get_diagrams

Genera diagramas Mermaid (clase, dependencia, módulo, secuencia)

get_call_graph

Análisis del gráfico de llamadas de funciones

get_glossary

Glosario de entidades de código buscable

get_inheritance

Árbol de jerarquía de clases

get_coverage

Análisis de cobertura de documentación

get_changelog

Generación de registro de cambios basado en Git

get_api_docs

Extracción de parámetros y tipos de retorno

get_test_examples

Extrae ejemplos de prueba para entidades

detect_stale_docs

Detecta páginas wiki obsoletas

detect_secrets

Escanea en busca de credenciales codificadas

get_index_status

Estado de salud e índice del repositorio

list_indexed_repos

Lista todos los repositorios indexados

Herramientas de análisis y búsqueda (10)

Herramienta

Descripción

search_wiki

Búsqueda de texto completo en páginas wiki y entidades de código

fuzzy_search

Coincidencia de nombres basada en Levenshtein ("¿Quiso decir?")

get_file_context

Importaciones, llamadores y archivos relacionados para un archivo fuente

explain_entity

Compuesto: glosario + gráfico de llamadas + herencia + pruebas + docs de API

impact_analysis

Análisis del radio de explosión con gráfico de llamadas inverso y nivel de riesgo

get_complexity_metrics

Complejidad ciclomática y profundidad de anidamiento mediante AST de tree-sitter

analyze_diff

Mapea el diff de git a páginas wiki y entidades afectadas

ask_about_diff

Preguntas y respuestas basadas en RAG sobre cambios de código

get_project_manifest

Metadatos analizados de pyproject.toml, package.json, etc.

get_wiki_stats

Panel de salud de la wiki: índice, páginas, cobertura, estado

Herramientas de salud de la arquitectura (17)

Herramienta

Descripción

get_architecture_health

Grado de salud compuesto (A-F) en 9 dimensiones

get_hotspots

Clasifica funciones por complejidad, complejidad cognitiva, parámetros, longitud o anidamiento

get_coupling_metrics

Métricas de acoplamiento de Robert C. Martin (Ca, Ce, I, A, D)

get_design_smells

Detecta clases dios, envidia de características, métodos largos, etc.

get_layer_dependencies

Detección de violación de capas (handlers→services→core)

get_churn_metrics

Frecuencia de cambio de archivos con compuesto de rotación×complejidad

get_co_change

Acoplamiento de co-cambio mediante similitud de Jaccard

get_cohesion_metrics

Cohesión de clase LCOM4 y cohesión de importación de módulos

get_duplication_metrics

Detección de clones Tipo 1 (exacto) y Tipo 2 (estructural)

get_testability_metrics

Relación prueba-código, mapeo de cobertura, densidad de aserción

get_maintainability_metrics

Índice de mantenibilidad por función (Halstead + CC + LOC)

get_recommendations

Sugerencias de refactorización priorizadas con esfuerzo/impacto

compare_architecture

Compara la salud entre dos referencias de git

get_architecture_trends

Instantáneas históricas de puntuación de salud

get_module_health

Complejidad, olores, acoplamiento y riesgo a nivel de módulo

get_onboarding_guide

Guía de incorporación para nuevos desarrolladores

get_guided_tour

Recorridos guiados interactivos del código base

Herramientas de mapa de código (2)

Herramienta

Descripción

generate_codemap

Mapas de flujo de ejecución entre archivos con diagramas Mermaid y narrativa LLM

suggest_codemap_topics

Descubre puntos de entrada interesantes desde centros de gráficos de llamadas

Herramientas de investigación y progreso (4)

Herramienta

Descripción

list_research_checkpoints

Lista los puntos de control de investigación profunda guardados

resume_research

Reanuda una sesión de investigación previamente guardada

cancel_research

Cancela una operación de investigación en curso

get_operation_progress

Comprueba el progreso de operaciones de larga duración

Herramientas de agente (5)

Herramienta

Descripción

suggest_next_actions

Sugerencias conscientes del contexto para las próximas herramientas a usar basadas en acciones recientes

run_workflow

Ejecuta flujos de trabajo predefinidos de varios pasos (ej. análisis completo, revisión rápida)

batch_explain_entities

Versión por lotes de explain_entity para múltiples entidades a la vez

query_codebase

RAG agéntico: califica la relevancia de los fragmentos, reescribe consultas para mejores resultados

find_tools

Descubre herramientas relevantes basadas en una consulta en lenguaje natural

Herramientas de servidor web (2)

Herramienta

Descripción

serve_wiki

Inicia el servidor web wiki para explorar la documentación

stop_wiki_server

Detiene un servidor web wiki en ejecución

Comandos CLI

Todos los comandos son subcomandos de la CLI unificada deepwiki. Los puntos de entrada heredados (deepwiki-serve, deepwiki-export, etc.) siguen funcionando por compatibilidad con versiones anteriores.

Comando

Descripción

deepwiki init

Asistente de configuración interactivo

deepwiki status

Muestra la salud del índice, frescura y cobertura de la wiki

deepwiki update

Indexa el repositorio y regenera la wiki (incremental)

deepwiki mcp

Inicia el servidor MCP (para integración con IDE)

deepwiki serve

Sirve la wiki con interfaz web

deepwiki watch

Modo de vigilancia - reindexación automática ante cambios de archivos

deepwiki export

Exporta la wiki a HTML estático

deepwiki export-pdf

Exporta la wiki a PDF

deepwiki config

Gestión de configuración (validar, mostrar, comprobación de salud, perfil)

deepwiki search

Búsqueda de código difusa interactiva

deepwiki cache

Gestión de caché (estadísticas, borrar, limpieza)

# 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 entries

Claves de API

OpenAI (predeterminado)

  1. Vaya a platform.openai.com/api-keys

  2. Inicie sesión (o cree una cuenta)

  3. Haga clic en Create new secret key

  4. Copie la clave y establézcala en su entorno:

export OPENAI_API_KEY="sk-..."

Para persistirla, añada el export a su ~/.zshrc o ~/.bashrc.

Anthropic

  1. Vaya a console.anthropic.com/settings/keys

  2. Haga clic en Create Key

  3. Establézcala en su entorno:

export ANTHROPIC_API_KEY="sk-ant-..."

Uso de un proxy compatible con OpenAI

Si su organización proporciona un punto final de API compatible con OpenAI (por ejemplo, a través de GitHub Copilot Enterprise o un proxy corporativo), establezca la base_url en su configuración:

llm:
  provider: "openai"
  openai:
    model: "gpt-4o"
    base_url: "https://your-proxy.example.com/v1"

La variable de entorno OPENAI_API_KEY sigue siendo necesaria para la autenticación.

Requisitos previos

Para soporte de LLM local:

  • Ollama instalado y en ejecución

  • Un modelo descargado (ej. ollama pull llama3.2)

Para exportación a PDF:

  • Bibliotecas del sistema: pango, cairo, gdk-pixbuf (dependencias de WeasyPrint)

    • macOS: brew install pango

    • Ubuntu/Debian: apt install libpango-1.0-0 libpangocairo-1.0-0

  • Opcional para diagramas mermaid: npm install -g @mermaid-js/mermaid-cli

Solución de problemas

Errores de conexión con Ollama

Si ve "Failed to connect to Ollama":

  1. Asegúrese de que Ollama esté ejecutándose: ollama serve

  2. Verifique que el modelo esté descargado: ollama list

  3. Compruebe si la URL predeterminada funciona: curl http://localhost:11434/api/tags

  4. Si usa un puerto personalizado, actualice config.yaml con la base_url correcta

Fallos en la exportación a PDF

"pango not found" o errores similares de Cairo/Pango:

  • macOS: brew install pango cairo gdk-pixbuf

  • Ubuntu/Debian: apt install libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0

  • Fedora: `dnf install

Available Tools

65 tools
analyze_architectureA
Read-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_diffA
Read-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_diffA
Read-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_questionA
Read-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_entitiesA
Read-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_architectureA
Read-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_bugsA
Read-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_secretsA
Read-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_docsA
Read-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_entityA
Read-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_htmlA
Idempotent

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_pdfA
Idempotent

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_toolsA
Read-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).

generate_codemapA
Read-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_docsA
Read-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_healthA
Read-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_summaryA
Read-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_call_graphA
Read-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_changelogA
Read-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_metricsA
Read-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_changeA
Read-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_metricsA
Read-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_metricsA
Read-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_metricsA
Read-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_coverageA
Read-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_dependenciesA
Read-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_smellsA
Read-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_diagramsA
Read-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_metricsA
Read-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_contextA
Read-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_glossaryA
Read-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_tourA
Read-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_hotspotsA
Read-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_statusA
Read-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_inheritanceA
Read-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_dependenciesA
Read-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_metricsA
Read-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_healthA
Read-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_guideA
Read-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_progressA
Read-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_manifestA
Read-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_recommendationsA
Read-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_statusA
Read-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_metricsA
Read-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_examplesB
Read-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_statsA
Read-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_analysisA
Read-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_repositoryA
Idempotent

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_reposA
Read-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_checkpointsA
Read-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_codebaseA
Read-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_pageA
Read-onlyIdempotent

Read a specific wiki page content.

Requires: index_repository must be called first.

Inputs: wiki_path (required), page (required).

read_wiki_structureA
Read-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_workflowA
Read-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_codeA
Read-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_wikiA
Read-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_topicsA
Read-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_actionsA
Read-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

    A3.8/5.0

    Scored across 65 tools

    Disambiguation4/5

    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 Consistency4/5

    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.

    Tool Count2/5

    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.

    Completeness5/5

    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

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers