Skip to main content
Glama

MCP Backup Server

MCP 备份服务器

专用的 MCP 服务器,为 AI 代理和代码编辑工具提供备份和恢复功能。已在 Cursor 和 Windsurf 编辑器中测试。

存储库: https://github.com/hexitex/MCP-Backup-Server

为什么要使用这个(而不是 Git)

该系统的用途与 Git 不同:

优点:

  • 使用代理上下文创建即时、有针对性的备份
  • 比 Git 更简单,确保单操作安全
  • 在备份中保留思考过程和意图
  • 无需提交消息或分支
  • 更适合进行重大改变的人工智能代理
  • 无需初始化存储库即可工作
  • 编辑期间更快地获取紧急“保存点”

缺点:

  • 不适用于长期版本跟踪
  • 有限的协作功能
  • 没有合并或冲突解决
  • 没有分布式备份功能
  • 不能替代适当的版本控制
  • 存储完整的文件副本而不是差异

**何时使用:**在进行有风险的编辑、文件夹重组之前,或者当您需要使用上下文进行快速安全备份时。

**何时使用 Git:**为了正确的版本历史记录、协作和项目管理。

特征

  • 保留代理上下文和推理
  • 创建有针对性的、最小的备份
  • 支持文件和文件夹操作
  • 维护版本历史记录
  • 提供恢复安全
  • 使用模式过滤
  • 轨道操作
  • 允许取消

设置

通过 Smithery 安装

要通过Smithery自动安装 Claude Desktop 的备份服务器:

npx -y @smithery/cli install @hexitex/MCP-Backup-Server --client claude

手动安装

# Install dependencies npm install # Build TypeScript files npm run build # Start the backup server npm start

配置

环境:

  • BACKUP_DIR :备份目录(./.code_backups)
  • EMERGENCY_BACKUP_DIR :紧急备份(./.code_emergency_backups)
  • MAX_VERSIONS :版本限制(10)

在编辑器中配置:

Windsurf MCP 配置:

{ "mcpServers": { "backup": { "command": "node", "args": ["./dist/index.js"], "env": { "BACKUP_DIR": "./.code_backups", "EMERGENCY_BACKUP_DIR": "./.code_emergency_backups", "MAX_VERSIONS": "20" } } } }

Cursor:创建具有类似配置的.cursor/mcp.json

工具

文件操作

  • backup_create :使用上下文创建备份
  • backup_list :列出可用的备份
  • backup_restore :使用安全备份恢复

文件夹操作

  • backup_folder_create :使用模式过滤进行备份
  • backup_folder_list :列出文件夹备份
  • backup_folder_restore :恢复文件夹结构

管理

  • backup_list_all :列出所有备份
  • mcp_cancel :取消操作

何时使用备份

仅在真正需要时创建备份:

  1. 重构之前:更改重要代码时
  2. 删除文件夹之前:重组项目结构时
  3. 多个相关更改:更新多个相关文件时
  4. 恢复主要工作:继续进行重大变更时
  5. 恢复前:恢复前创建安全备份

保持备份的最小化和目的性。记录每次备份的必要性。

复制粘贴规则

Always try to use the backup MCP server for operations that require a backup, listing backups and restoring backups. Only backup before critical code changes, folder removal, changes to multiple related files, resuming major work, or restoring files. Keep backups minimal and focused only on files being changed. Always provide clear context for why a backup is being created. Use pattern filters to exclude irrelevant files from folder backups. Use relative file paths when creating backups. Create emergency backups before restore operations. Clean up old backups to maintain system efficiency. Backup tools: backup_create, backup_list, backup_restore, backup_folder_create, backup_folder_list, backup_folder_restore, backup_list_all, mcp_cancel.

对于人类用户

一开始你可能要提到这些简单的命令,比如 MCP 工具

# Back up an important file "Back up my core file before refactoring" # Back up a folder before changes "Create backup of the API folder before restructuring" # Find previous backups "Show me my recent backups" # Restore a previous version "Restore my core file from this morning"

代理示例

快速备份

// Before project changes { "name": "mcp0_backup_folder_create", "parameters": { "folder_path": "./src", "include_pattern": "*.{js,ts}", "exclude_pattern": "{node_modules,dist,test}/**", "agent_context": "Start auth changes" } } // Before core fix { "name": "mcp0_backup_create", "parameters": { "file_path": "./src/core.js", "agent_context": "Fix validation" } }

恢复会话

// View recent work { "name": "mcp0_backup_list_all", "parameters": { "include_pattern": "src/**/*.js" } } // Get last version { "name": "mcp0_backup_restore", "parameters": { "file_path": "./src/core.js", "timestamp": "20250310-055950-000", "create_emergency_backup": true } }

核心变化

// Critical update { "name": "mcp0_backup_create", "parameters": { "file_path": "./src/core.js", "agent_context": "Add validation" } } // Module update { "name": "mcp0_backup_folder_create", "parameters": { "folder_path": "./src/api", "include_pattern": "*.js", "exclude_pattern": "test/**", "agent_context": "Refactor modules" } }

还原点

// Check versions { "name": "mcp0_backup_list", "parameters": { "file_path": "./src/core.js" } } { "name": "mcp0_backup_folder_list", "parameters": { "folder_path": "./src/api" } } // File restore { "name": "mcp0_backup_restore", "parameters": { "file_path": "./src/core.js", "timestamp": "20250310-055950-000", "create_emergency_backup": true } } // Folder restore { "name": "mcp0_backup_folder_restore", "parameters": { "folder_path": "./src/api", "timestamp": "20250310-055950-000", "create_emergency_backup": true } }

管理

// List recent { "name": "mcp0_backup_list_all", "parameters": { "include_pattern": "src/**/*.js" } } // Stop backup { "name": "mcp0_mcp_cancel", "parameters": { "operationId": "backup_1234" } }

执照

麻省理工学院

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

为 AI 代理和代码编辑工具提供备份和恢复功能的专用服务器,创建具有上下文保存的即时目标备份。

  1. 为什么要使用这个(而不是 Git)
    1. 特征
      1. 设置
        1. 通过 Smithery 安装
        2. 手动安装
      2. 配置
        1. 工具
          1. 文件操作
          2. 文件夹操作
          3. 管理
        2. 何时使用备份
          1. 复制粘贴规则
            1. 对于人类用户
              1. 代理示例
                1. 快速备份
                2. 恢复会话
                3. 核心变化
                4. 还原点
                5. 管理
              2. 执照

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  Provides code manipulation, execution, and version control capabilities. It allows AI assistants to read, write, and execute code while maintaining a history of changes.
                  Last updated -
                  8
                  Python
                  MIT License
                • A
                  security
                  A
                  license
                  A
                  quality
                  A server that enhances AI assistants with the ability to update your JSON Resume by analyzing your coding projects, automatically extracting skills and generating professional descriptions.
                  Last updated -
                  3
                  32
                  39
                  TypeScript
                  The Unlicense
                  • Apple
                  • Linux
                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server that enables AI agents to retrieve and understand entire codebases at once, providing tools to analyze local workspaces or remote GitHub repositories.
                  Last updated -
                  9
                  TypeScript
                  MIT License
                  • Linux
                  • Apple
                • -
                  security
                  F
                  license
                  -
                  quality
                  A server that enables AI assistants to execute JavaScript code with persistent context through stateful REPL sessions, file operations, and package management features.
                  Last updated -
                  TypeScript
                  • Linux
                  • Apple

                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/hexitex/MCP-Backup-Server'

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