M

MCP文件编辑审核服务器

@8grackles/file-edit-check-server
0 Stars 477 次浏览 8grackles 更新于 2026-08-23

该MCP服务器通过强制执行预读检查和详细的提交文档,防止未经授权的文件修改,确保写入和差异操作之前有明确的读取操作。

该服务暂未提供标准配置,请参考 README 手动接入

可用工具 (4 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

checked_read_file 1 个参数 需填 1 项

Read a file and mark it as read for future editing

必填参数:path

checked_write_to_file 3 个参数 需填 3 项

Write to a file, requiring it to have been read first if it exists

必填参数:path、content、line_count

checked_apply_diff 2 个参数 需填 2 项

Apply a diff to a file, requiring it to have been read first

必填参数:path、diff

list_my_tools

List the tools registered in this server

该工具无需必填参数,直接调用即可

服务介绍

文件编辑检查 MCP 服务器

一个强制执行预读检查和详细提交文档的MCP服务器。此服务器通过在任何写入或差异操作之前要求显式的读取操作,来防止对文件的盲目修改。

特性

  • 在文件修改前强制进行预读验证
  • 防止盲目写入和差异
  • 提供详细的提交信息指导
  • 使用TypeScript实现,并具备适当的错误处理

工具

  • checked_read_file:读取文件并将其标记为已读,以便后续编辑
  • checked_write_to_file:向文件中写入内容,如果该文件已存在,则要求先读取它
  • checked_apply_diff:将差异应用到文件,要求先读取文件
  • list_my_tools:列出在此服务器上注册的所有工具

安装

npm install
npm run build

使用方法

添加到您的MCP设置文件中:

{
  "mcpServers": {
    "file-edit-check": {
      "command": "node",
      "args": ["/path/to/file-edit-check-server/build/index.js"],
      "disabled": false,
      "alwaysAllow": []
    }
  }
}

相关 MCP 服务