Back to MCP directory
publicPublicdnsLocal runtime

file-edit-check-mcp-server

一个强制执行预读检查和详细提交文档的MCP服务器,防止对文件进行盲目修改。

article

README

🚀 文件编辑检查 MCP 服务器

本项目是一个用于强制执行预读检查和详细提交文档的MCP服务器。它通过要求在任何写入或差异应用之前显式地进行读取操作,有效防止了盲目文件修改,提升了文件操作的安全性和规范性。

🚀 快速开始

将该服务器添加到您的 MCP 设置文件,即可开始使用:

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

✨ 主要特性

  • 强制执行文件修改前的预读验证,确保操作的准确性。
  • 防止盲写和差异生成,避免不必要的错误。
  • 提供详细的提交消息指导,便于后续维护。
  • 使用 TypeScript 实现,带详细错误处理,增强了系统的稳定性。

📦 安装指南

npm 安装
npm 运行构建

💻 使用示例

基础用法

本服务器提供了多个实用工具,以下是部分工具的使用说明:

checked_read_file

读取文件并标记为已读以便后续编辑:

# 调用 checked_read_file 工具的示例代码
checked_read_file your_file.txt

checked_write_to_file

写入文件,要求在文件存在的情况下必须先进行读取操作:

# 调用 checked_write_to_file 工具的示例代码
checked_write_to_file your_file.txt "new content"

checked_apply_diff

应用文件差异,要求在应用之前必须先进行读取操作:

# 调用 checked_apply_diff 工具的示例代码
checked_apply_diff your_file.txt diff.patch

list_my_tools

列出此服务器中注册的工具:

# 调用 list_my_tools 工具的示例代码
list_my_tools
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client