Skip to main content
Glama
Code Analysis MCP Server

Code Analysis MCP Server

Servidor MCP de análisis de código

Un servidor de Protocolo de Contexto de Modelo (MCP) que permite que los modelos de IA comprendan y analicen bases de código a través de conversaciones en lenguaje natural.

✨ Aspectos destacados

  • Exploración de código natural : haga preguntas de alto nivel sobre su base de código

    "What are all the different payment providers integrated in the system?"
  • Comprensión profunda del código : extraiga información sobre los modelos de datos y la arquitectura del sistema

    "How does the user authentication flow work from frontend to database?"
  • Análisis dinámico : rastrear flujos de datos y comprender las relaciones del sistema

    "Show me all the places where we calculate transaction fees"

Related MCP server: Notion MCP Server

Limitaciones

Esta herramienta es una alternativa más sencilla a herramientas de análisis de código más sofisticadas, como Aider . Si bien carece de las capacidades avanzadas de análisis de código y la robustez de herramientas como Aider, ofrece una solución ligera para la exploración de la base de código si ya cuenta con una suscripción a Claude Pro. Sus principales ventajas son:

  • Rentable : usar su suscripción existente a Claude Pro significa que no hay costos de API adicionales, a diferencia de las herramientas que pueden resultar costosas al analizar grandes bases de código.

  • Configuración sencilla : inicio rápido con una configuración mínima

  • Análisis básico : útil para la comprensión y exploración de código de alto nivel.

Tenga en cuenta que debido a su enfoque más simple para el análisis de código, puede cometer más errores o proporcionar información menos detallada en comparación con herramientas más especializadas.

🚀 Inicio rápido

  1. Instalar el servidor:

git clone https://github.com/saiprashanths/code-analysis-mcp.git
cd code-analysis-mcp
  1. Instalar la aplicación Claude Desktop . Para obtener más instrucciones sobre cómo configurar un servidor MCP con la aplicación Claude Desktop, consulte la documentación.

  2. Configure el servidor en el archivo de configuración de Claude Desktop:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  • Ventanas: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "code-analysis": {
      "command": "uv",
      "args": [
        "--directory",
        "/PATH/TO/YOUR/REPO",
        "run",
        "code_analysis.py"
      ]
    }
  }
}
  1. ¡Reinicie Claude Desktop y comience a analizar su código!

  2. Asegúrese de que la herramienta esté configurada correctamente

  • Al hacer clic en el icono de herramientas deberían mostrarse las herramientas code-analysis

  • Al hacer clic en el botón de integraciones debería aparecer el mensaje analyze_code_repository

💡 Ejemplo de uso

A continuación se explica cómo puede utilizar la herramienta para comprender una base de código compleja:

Comience haciendo clic en el mensaje analyze_code_repository que se muestra a continuación. Esto le guiará a través del proceso para inicializar el repositorio y comenzar.

You: How does the transaction processing work in this system?

Claude: Let me analyze the data flow for transactions. 
Looking at the codebase, I can see that transaction processing happens through several key components:

1. Raw transaction data is captured in the `TransactionEvent` model with fields for:
   - Payment status
   - Amount
   - Fee calculations
   - Processing timestamps

2. This data is then processed through the PaymentSummary model, which:
   - Validates payment provider responses
   - Calculates processing fees
   - Records transaction status

Would you like me to explain any part of this in more detail?

You: What are the key database tables involved?

Claude: The main tables in the transaction processing pipeline are:

1. transaction_events: Stores raw payment events
2. payment_summary: Processed transaction records
3. payment_providers: Provider configuration
4. merchant_accounts: Account-specific settings

Let me know if you'd like to see the schema for any of these tables!

🔧 Herramientas disponibles

inicializar_repositorio

Inicializar un repositorio de código para su análisis:

initialize_repository("/path/to/repo")
# Output: Successfully initialized code repository at: /path/to/repo

obtener_información_del_repositorio

Recuperar información sobre el repositorio inicializado:

get_repo_info()
# Output:
# Code Repository Information:
# Path: /path/to/repo
# Exists: True
# Is Directory: True
# Found .gitignore file

obtener_estructura_del_repositorio

Examinar la estructura de archivos del repositorio:

get_repo_structure(depth=2)
# Output:
# 📁 src/
#   📁 api/
#     📄 routes.py
#     📄 models.py
#   📁 utils/
#     📄 helpers.py
#   📄 main.py

leer_archivo

Leer y analizar archivos específicos:

read_file("src/api/models.py")
# Output:
# File: src/api/models.py
# Language: python
# Size: 2.3 KB
# 
# [File contents...]

⚙️ Detalles técnicos

  • Profundidad de escaneo predeterminada: 3 niveles

  • Tamaño máximo de archivo: 1 MB

  • Máximo de líneas por archivo: 1000

  • Ignora las rutas enumeradas en .gitignore

  • Solo acceso al sistema de archivos local

  • Valida las rutas de archivos para evitar el cruce de directorios

📝 Licencia

Este proyecto está licenciado bajo la licencia MIT: consulte el archivo de LICENCIA para obtener más detalles.

Available Tools

4 tools
get_repo_infoB

Get information about the currently initialized code repository.

Inputs: no named parameters.

get_repo_structureB

Get the structure of files and directories in the repository.

Args:
    sub_path: Optional subdirectory path relative to repository root
    depth: Optional maximum depth to traverse (default is 3)

Inputs: sub_path, depth.

initialize_repositoryC

Initialize the repository path for future code analysis operations.

Args:
    path: Path to the repository root directory that contains the code to analyze

Inputs: path (required).

read_fileB

Read and display the contents of a file from the repository.

Args:
    file_path: Path to the file relative to repository root

Inputs: file_path (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: initialize_repository sets up the context, get_repo_info provides metadata, get_repo_structure shows the file hierarchy, and read_file accesses file contents. There is no overlap in functionality, making tool selection straightforward for an agent.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern (e.g., initialize_repository, get_repo_info, get_repo_structure, read_file). The naming is uniform and predictable, using snake_case throughout with clear action descriptors.

    Tool Count4/5

    With 4 tools, the count is reasonable for a code analysis server, covering core operations like initialization, metadata retrieval, structure viewing, and file reading. However, it feels slightly thin, as advanced analysis features (e.g., linting, dependency checks) are absent, though not essential for basic functionality.

    Completeness3/5

    The toolset covers basic repository operations (initialize, info, structure, read), but there are notable gaps for a code analysis domain, such as missing tools for analyzing code quality (e.g., lint, test), searching within files, or modifying content. Agents can perform foundational tasks but may hit dead ends for deeper analysis.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers