A comprehensive Model Context Protocol (MCP) server providing advanced file system operations, command execution, and project analysis capabilities.
- Complete file and directory management (create, read, write, edit, delete, move, copy)
- Advanced file editing with line-specific operations
- Batch file operations and renaming with patterns
- File comparison and difference analysis
- Smart file searching with glob patterns and text search
- Standard command execution with configurable timeouts
- Long-running command support with auto-detection
- Process management and monitoring
- Automatic cleanup of running processes
- Extended timeout handling for development servers
- Visual project structure with Unicode tree display
- Comprehensive project type detection (Python, Node.js, Reflex, etc.)
- File type analysis and statistics
- Large file identification and optimization insights
- Customizable exclusion patterns
- Built-in version control system for project snapshots
- Compare versions and track file history
- Backup and restore functionality
- Automatic and manual version creation
- System information and performance metrics
- Process listing and management
- Network interface information
- Environment variable access
- File permissions and access control
- Clone the repository:
git clone <repository-url>
cd mcp_backup- Install dependencies:
pip install -r requirements.txt- Run the server:
python main.pyThe server provides 25+ tools accessible through the MCP protocol:
# File operations
execute_command("ls -la")
read_file("config.py")
get_project_structure(".", format_type="tree")
# Long-running commands (auto-detected)
execute_command("reflex run") # Uses 5-minute timeout
execute_command("npm start") # Auto-detected long runner
# Process management
list_running_processes()
kill_running_process(pid=12345)
# Project analysis
get_project_structure(".", format_type="summary")
analyze_dependencies(".")| Tool | Description |
|---|---|
list_directory |
List directory contents |
read_file / write_file |
File I/O operations |
edit_file |
Line-specific file editing |
create_directory |
Create directories |
delete_item / move_item / copy_item |
File management |
search_files |
Find files with glob patterns |
find_in_files |
Search text within files |
compare_files |
File difference analysis |
batch_rename |
Bulk file renaming |
| Tool | Description |
|---|---|
execute_command |
Run system commands |
list_running_processes |
Show active processes |
kill_running_process |
Terminate processes |
get_command_help |
Command documentation |
| Tool | Description |
|---|---|
get_project_structure |
Visual project tree and analysis |
find_project_root |
Locate project root directory |
analyze_dependencies |
Project dependency analysis |
check_formatting |
Code syntax and formatting validation |
| Tool | Description |
|---|---|
initialize_version_control |
Set up project versioning |
create_version |
Create project snapshots |
list_versions / restore_version |
Version management |
compare_versions |
Compare project states |
get_file_history |
File change tracking |
| Tool | Description |
|---|---|
system_info |
Comprehensive system metrics |
get_environment_vars |
Environment variable access |
check_permissions |
File access permissions |
process_list |
System process information |
network_info |
Network interface details |
Automatically detects and handles development servers:
# Auto-detected long runners (5-minute timeout)
reflex run, reflex dev
npm start, npm run dev, yarn start
flask run, python -m flask run
uvicorn, gunicorn
webpack-dev-server, vite dev
next dev, nuxt dev, ng serve
gatsby develop, hugo serverGenerates comprehensive project insights:
{
"statistics": {
"total_files": 45,
"total_directories": 12,
"total_size": "234.5KB"
},
"analysis": {
"project_type": "Python + Reflex",
"file_types": {".py": 15, ".md": 3, ".json": 2},
"large_files": ["data.json (2.4MB)"]
}
}Automatically excludes common build and cache directories:
__pycache__,.git,.DS_Storenode_modules,.vscode,.ideadist,build,.next,.nuxtcoverage,.pytest_cache,.mypy_cache
CONSOLE_TIMEOUT = 15 # Default timeout (seconds)
LONG_RUNNER_TIMEOUT = 300 # Long runner timeout (5 minutes)
MAX_TIMEOUT = 1800 # Maximum allowed timeout (30 minutes)timeout- Custom timeout in seconds (overrides defaults)long_runner- Force long-runner mode (5-minute timeout)working_directory- Set command execution directoryapprove_dangerous- Allow potentially dangerous commands
mcp_backup/
├── src/
│ ├── server.py # MCP server implementation
│ ├── config.py # Configuration settings
│ ├── tool_schemas.py # Tool schema definitions
│ ├── utils.py # Utility functions
│ └── tools/
│ ├── file_operations.py # Core file operations
│ ├── file_editor.py # Advanced file editing
│ ├── command_executor.py # Command execution engine
│ ├── project_structure.py # Project analysis tools
│ ├── version_control.py # Version management
│ ├── system_tools.py # System monitoring
│ ├── advanced_file_ops.py # Advanced file operations
│ ├── project_tools.py # Project utilities
│ └── code_checker.py # Code validation
├── main.py # Server entry point
├── requirements.txt # Dependencies
└── README.md # This file
psutil>=5.9.0- Process managementmcp>=1.0.0- MCP protocol implementation- Standard library modules for file operations
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Run development servers with automatic timeout handling
- Monitor and manage running processes
- Analyze project structure and dependencies
- Version control for project snapshots
- Project structure visualization
- File type distribution analysis
- Large file identification
- Code formatting validation
- File system operations and monitoring
- Process management and cleanup
- System information gathering
- Batch file operations
- Generate project structure trees
- Create comprehensive project overviews
- Track project evolution over time
- Memory Efficient: Processes files incrementally
- Smart Exclusions: Automatically skips irrelevant directories
- Process Safety: Robust cleanup of running processes
- Cross-Platform: Works on Windows, macOS, and Linux
- Error Recovery: Graceful handling of permission issues
- Maximum timeout limits prevent infinite processes
- Multiple process killing strategies ensure cleanup
- Permission checking handles restricted directories
- Path validation prevents unsafe operations
- Structured error handling with detailed messages
This project is licensed under the MIT License - see the LICENSE.txt file for details.
- Create an Issue for bug reports or feature requests
- Fork the project and submit a Pull Request
- Star the repository if you find it useful!
Ready for production use with comprehensive file system interaction capabilities.