codesavant coding assistant.com
codesavant coding assistant.com logo

CodeSavant Coding Assistant

Provides a robust code management and execution interface for reading, writing, versioning, and running code across mult...

Created byApr 23, 2025

MCP-CodeSavant

CodeSavant is a WIP project.
CodeSavant is a Model Context Protocol (MCP) server that provides code manipulation, execution, and version control capabilities. It allows AI assistants to read, write, and execute code while maintaining a history of changes.

Features

  • Read and write code files with line-specific operations
  • Execute code in multiple programming languages (Python, Node.js)
  • Execute shell commands in a controlled environment
  • Track and manage code changes with version control
  • Search within code files
  • Revert to previous versions of code

Installation

  1. Clone the repository:
  1. Install the required dependencies:
  1. Add the server configuration to your Claude Desktop config.json:

Directory Structure

The server creates and manages the following directory structure:

Tool Reference

Detailed Usage

1. read_code_file

Read contents of a code file, optionally searching for specific sections.
Response:

2. write_code_file

Write or update specific lines in a code file.
Response:

3. get_code_history

Get change history for a code file.
Response:

4. execute_code_command

Execute a code-related shell command.
Response:

5. execute_code

Execute code in specified language.
Response:

6. revert_to_version

Revert a code file to a specific version.
Response:

7. read_code_file_lines

Read specific lines from a code file.
Response:

Error Handling

The server provides detailed error responses in the following format:
Error types include:
  • `CodeFileError`: File operation errors
  • `CodeValidationError`: Code validation errors
  • `CodeExecutionError`: Code execution errors

Language Support

Currently supported languages for code execution:
  • Python (using system Python interpreter)
  • Node.js (using node command)
Each language execution creates a temporary file in the workspace directory and executes it with appropriate interpreter.

Contributing

  1. Fork the repository
  1. Create your feature branch
  1. Commit your changes
  1. Push to the branch
  1. Create a new Pull Request

License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Author

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

Acknowledgments

  • Built with the Model Context Protocol (MCP) by Anthropic
  • Developed for use with Anthropic's Claude