MCP-CodeSavant
CodeSavant 是一个 WIP 项目。
CodeSavant 是一个模型上下文协议 (MCP) 服务器,提供代码操作、执行和版本控制功能。它允许 AI 助手读取、写入和执行代码,同时保留更改历史记录。
特征
- 使用特定于行的操作来读取和写入代码文件
- 使用多种编程语言(Python、Node.js)执行代码
- 在受控环境中执行 shell 命令
- 使用版本控制跟踪和管理代码更改
- 在代码文件中搜索
- 恢复到以前版本的代码
安装
- 克隆存储库:
- 安装所需的依赖项:
- 将服务器配置添加到您的 Claude Desktop config.json:
目录结构
服务器创建并管理以下目录结构:
工具参考
详细使用方法
1. 读取代码文件
读取代码文件的内容,可选择搜索特定部分。
回复:
2. 写入代码文件
写入或更新代码文件中的特定行。
回复:
3. 获取代码历史记录
获取代码文件的更改历史记录。
回复:
4. 执行代码命令
执行与代码相关的shell命令。
回复:
5. 执行代码
以指定语言执行代码。
回复:
6. 恢复到版本
将代码文件恢复到特定版本。
回复:
7. 读取代码文件行
从代码文件中读取特定行。
回复:
错误处理
服务器以以下格式提供详细的错误响应:
错误类型包括:
CodeFileError
:文件操作错误CodeValidationError
:代码验证错误CodeExecutionError
:代码执行错误
语言支持
目前支持的代码执行语言:
- Python(使用系统 Python 解释器)
- Node.js(使用 node 命令)
每种语言的执行都会在工作区目录中创建一个临时文件,并使用适当的解释器执行它。
贡献
- 分叉存储库
- 创建你的功能分支
- 提交你的更改
- 推送到分支
- 创建新的 Pull 请求
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
作者
托德·沃尔文 - ( https://github.com/tolven )
致谢
- 使用 Anthropic 的模型上下文协议 (MCP) 构建
- 专为与 Anthropic 的 Claude 配合使用而开发
Related MCP Servers
- AsecurityAlicenseAqualityShell 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, pythonLast updated -6554PythonApache 2.0
- -securityAlicense-qualityTransform 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 -11PythonMIT License
- -securityFlicense-qualityA powerful interface for extending AI capabilities through remote control, calculations, email operations, knowledge search, and more.Last updated -34Python
- -securityFlicense-qualityA 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