Skip to main content
Glama

CodeSavant

MCP-CodeSavant

CodeSavant es un proyecto WIP.

CodeSavant es un servidor de Protocolo de Contexto de Modelo (MCP) que ofrece funciones de manipulación, ejecución y control de versiones de código. Permite a los asistentes de IA leer, escribir y ejecutar código, manteniendo un historial de cambios.

Características

  • Leer y escribir archivos de código con operaciones específicas de línea
  • Ejecutar código en múltiples lenguajes de programación (Python, Node.js)
  • Ejecutar comandos de shell en un entorno controlado
  • Realice un seguimiento y gestione los cambios de código con el control de versiones
  • Buscar dentro de los archivos de código
  • Revertir a versiones anteriores del código

Instalación

  1. Clonar el repositorio:
git clone https://github.com/twolven/mcp-codesavant.git cd mcp-codesavant
  1. Instale las dependencias necesarias:
pip install -r requirements.txt
  1. Agregue la configuración del servidor a su config.json de Claude Desktop:
{ "mcpServers": { "codesavant": { "command": "python", "args": ["path/to/codesavant.py"] } } }

Estructura del directorio

El servidor crea y administra la siguiente estructura de directorio:

workspaces/ ├── project1/ │ ├── .code_history.json │ └── [code files] ├── project2/ │ ├── .code_history.json │ └── [code files] └── ...

Referencia de herramientas

Uso detallado

1. leer_archivo_de_código

Leer el contenido de un archivo de código, buscando opcionalmente secciones específicas.

{ "project": "string", // Project name "path": "string", // Path to file relative to project workspace "search": "string" // (Optional) Text/pattern to search for in file }

Respuesta:

{ "success": true, "timestamp": 1234567890, "data": { "content": "string", // File content "start_line": number, // (Only if search used) Starting line of found section "end_line": number // (Only if search used) Ending line of found section } }
2. escribir_archivo_de_código

Escribir o actualizar líneas específicas en un archivo de código.

{ "project": "string", // Project name "path": "string", // Path to file relative to workspace "content": "string", // Content to write (just the lines being changed) "start_line": number, // Starting line number for the change "end_line": number // (Optional) Ending line number for the change }

Respuesta:

{ "success": true, "timestamp": 1234567890, "data": { "diff": { "changes": [ // List of changes made [string, number, number, number, number] // (type, old_start, old_end, new_start, new_end) ], "timestamp": number // When the change was made } } }
3. obtener_historial_de_código

Obtener el historial de cambios de un archivo de código.

{ "path": "string" // Path to file relative to workspace }

Respuesta:

{ "success": true, "timestamp": 1234567890, "data": { "history": [ { "changes": [ // List of changes made [string, number, number, number, number] ], "timestamp": number } ] } }
4. ejecutar_código_comando

Ejecutar un comando de shell relacionado con el código.

{ "command": "string", // Shell command to execute "timeout": number // (Optional) Command timeout in seconds (default: 30) }

Respuesta:

{ "success": true, "timestamp": 1234567890, "data": { "state": "success|error|timeout|cancelled", "output": "string", // Command output "error": "string", // Error message if any "runtime": number, // Execution time in seconds "exit_code": number // Command exit code } }
5. código_de_ejecución

Ejecutar código en el lenguaje especificado.

{ "code": "string", // Code to execute "language": "string", // Programming language ("python" or "node") "timeout": number // (Optional) Execution timeout in seconds (default: 30) }

Respuesta:

{ "success": true, "timestamp": 1234567890, "data": { "state": "success|error|timeout|cancelled", "output": "string", // Code execution output "error": "string", // Error message if any "runtime": number, // Execution time in seconds "exit_code": number // Execution exit code } }
6. revertir a la versión

Revertir un archivo de código a una versión específica.

{ "path": "string", // Path to file relative to workspace "timestamp": number // Timestamp of version to revert to }

Respuesta:

{ "success": true, "timestamp": 1234567890, "data": { "diff": { "changes": [ // List of changes made [string, number, number, number, number] ], "timestamp": number // When the reversion was made } } }
7. líneas de archivo de código de lectura

Leer líneas específicas de un archivo de código.

{ "project": "string", // Project name "path": "string", // Path to file relative to project workspace "start_line": number, // Starting line number to read "end_line": number // (Optional) Ending line number to read }

Respuesta:

{ "success": true, "timestamp": 1234567890, "data": { "content": "string" // Content of the specified lines } }

Manejo de errores

El servidor proporciona respuestas de error detalladas en el siguiente formato:

{ "success": false, "timestamp": 1234567890, "data": null, "error": "Error message" }

Los tipos de error incluyen:

  • CodeFileError : Errores de operación de archivo
  • CodeValidationError : Errores de validación de código
  • CodeExecutionError : Errores de ejecución de código

Soporte de idiomas

Idiomas actualmente admitidos para la ejecución de código:

  • Python (usando el intérprete del sistema Python)
  • Node.js (usando el comando node)

Cada ejecución de lenguaje crea un archivo temporal en el directorio del espacio de trabajo y lo ejecuta con el intérprete apropiado.

Contribuyendo

  1. Bifurcar el repositorio
  2. Crea tu rama de funciones
  3. Confirme sus cambios
  4. Empujar hacia la rama
  5. Crear una nueva solicitud de extracción

Licencia

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

Autor

Todd Wolven - ( https://github.com/twolven )

Expresiones de gratitud

  • Construido con el Protocolo de Contexto de Modelo (MCP) de Anthropic
  • Desarrollado para su uso con Claude de Anthropic
-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

Proporciona capacidades de manipulación, ejecución y control de versiones de código. Permite a los asistentes de IA leer, escribir y ejecutar código, manteniendo un historial de cambios.

  1. Características
    1. Instalación
      1. Estructura del directorio
        1. Referencia de herramientas
          1. Uso detallado
        2. Manejo de errores
          1. Soporte de idiomas
            1. Contribuyendo
              1. Licencia
                1. Autor
                  1. Expresiones de gratitud

                    Related MCP Servers

                    • A
                      security
                      A
                      license
                      A
                      quality
                      Shell and file edit capabilities tightly coupled to provide a powerful coding experience. You can work with different modes: architect and code-writer for separate plan and implementation phase. You can get it to invoke any cli command, e.g., compiling, type checking, linting, github cli, python
                      Last updated -
                      6
                      554
                      Python
                      Apache 2.0
                      • Apple
                      • Linux
                    • -
                      security
                      A
                      license
                      -
                      quality
                      Transform your local machine into a powerful code command center. Automate file handling, run terminal commands, and leverage AI to enhance your development workflows—all securely and instantly, without cloud latency.
                      Last updated -
                      11
                      Python
                      MIT License
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A powerful interface for extending AI capabilities through remote control, calculations, email operations, knowledge search, and more.
                      Last updated -
                      34
                      Python
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A personal AI coding assistant that connects to various development environments and helps automate tasks, provide codebase insights, and improve coding decisions by leveraging the Model Context Protocol.
                      Last updated -
                      Python
                      • Apple
                      • Linux

                    View all related MCP servers

                    MCP directory API

                    We provide all the information about MCP servers via our MCP API.

                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/twolven/mcp-codesavant'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server