Cover image
Try Now
2025-03-15

Une implémentation du serveur de protocole de contexte de modèle (MCP) qui fournit des capacités de sauvegarde et de restauration des fichiers

3 years

Works with Finder

1

Github Watches

1

Github Forks

2

Github Stars

MCP Backup Server

A specialized MCP server that provides backup and restoration capabilities for AI agents and code editing tools. Tested in both Cursor and Windsurf editors.

Repository: https://github.com/hexitex/MCP-Backup-Server

Why Use This (Not Git)

This system serves a different purpose than Git:

Pros:

  • Creates instant, targeted backups with agent context
  • Simpler than Git for single-operation safety
  • Preserves thought process and intent in backups
  • No commit messages or branching required
  • Better for AI agents making critical changes
  • Works without repository initialization
  • Faster for emergency "save points" during edits

Cons:

  • Not for long-term version tracking
  • Limited collaboration features
  • No merging or conflict resolution
  • No distributed backup capabilities
  • Not a replacement for proper version control
  • Stores complete file copies rather than diffs

When to use: Before risky edits, folder restructuring, or when you need quick safety backups with context.

When to use Git instead: For proper version history, collaboration, and project management.

Features

  • Preserves agent context and reasoning
  • Creates targeted, minimal backups
  • Supports file and folder operations
  • Maintains version history
  • Provides restore safety
  • Uses pattern filtering
  • Tracks operations
  • Allows cancellation

Setup

# Install dependencies
npm install

# Build TypeScript files
npm run build

# Start the backup server
npm start

Config

Env:

  • BACKUP_DIR: Backup directory (./.code_backups)
  • EMERGENCY_BACKUP_DIR: Emergency backups (./.code_emergency_backups)
  • MAX_VERSIONS: Version limit (10)

Configure in editor:

Windsurf MCP config:

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

Cursor: Create .cursor/mcp.json with similar config.

Tools

File Operations

  • backup_create: Create backup with context
  • backup_list: List available backups
  • backup_restore: Restore with safety backup

Folder Operations

  • backup_folder_create: Backup with pattern filtering
  • backup_folder_list: List folder backups
  • backup_folder_restore: Restore folder structure

Management

  • backup_list_all: List all backups
  • mcp_cancel: Cancel operations

When to Use Backups

Only create backups when truly needed:

  1. Before Refactoring: When changing important code
  2. Before Removing Folders: When reorganizing project structure
  3. Multiple Related Changes: When updating several connected files
  4. Resuming Major Work: When continuing significant changes
  5. Before Restores: Create safety backup before restoring

Keep backups minimal and purposeful. Document why each backup is needed.

Rules for Copy-Paste

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.

For Human Users

Simple commands like these at the start you may have to mention MCP tool

# 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"

Agent Examples

Quick Backups

// 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"
  }
}

Resume Session

// 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
  }
}

Core Changes

// 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"
  }
}

Restore Points

// 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
  }
}

Manage

// List recent
{
  "name": "mcp0_backup_list_all",
  "parameters": {
    "include_pattern": "src/**/*.js"
  }
}

// Stop backup
{
  "name": "mcp0_mcp_cancel",
  "parameters": {
    "operationId": "backup_1234"
  }
}

License

MIT

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • INFOLAB OPERATIONS 2
  • A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • apappascs
  • Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.

  • ShrimpingIt
  • Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX

  • OffchainLabs
  • Aller la mise en œuvre de la preuve de la participation Ethereum

  • huahuayu
  • Une passerelle API unifiée pour intégrer plusieurs API d'explorateur de blockchain de type étherscan avec la prise en charge du protocole de contexte modèle (MCP) pour les assistants d'IA.

  • deemkeen
  • Contrôlez votre MBOT2 avec un combo d'alimentation: MQTT + MCP + LLM

  • zhaoyunxing92
  • 本项目是一个钉钉 MCP (Protocole de connecteur de message) 服务 , 提供了与钉钉企业应用交互的 API 接口。项目基于 Go 语言开发 , 支持员工信息查询和消息发送等功能。

  • pontusab
  • La communauté du curseur et de la planche à voile, recherchez des règles et des MCP

    Reviews

    4 (1)
    Avatar
    user_6MbS3EM6
    2025-04-15

    The MCP Snowflake Reader by fnf-deepHeading is an exceptional tool for data enthusiasts. It seamlessly integrates with Snowflake, providing a smooth and intuitive user experience. The product effectively enhances data handling capabilities, making it an invaluable addition to my daily workflow. Highly recommended for anyone working with Snowflake!