fti9999/dev-safety-mcp
If you are the rightful owner of dev-safety-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Development Safety System - MCP Server is designed to ensure session continuity and sandbox safety for LLM development workflows, providing a seamless and secure environment for AI-assisted development.
Development Safety System - MCP Server
An MCP (Model Control Protocol) server that enables session continuity and sandbox safety for LLM development workflows.
๐ฏ Core Goal
Create an MCP server that provides "pick up exactly where you left off" + "never break the main app" functionality for AI-assisted development.
โจ Key Features
- Session State Persistence: Save and restore complete development session context
- Sandbox Management: Isolated development environments for safe experimentation
- Activity Detection: File-based monitoring to suggest when to save session state
- Safe Synchronization: Controlled copying of approved changes back to main project
๐ Quick Start
Installation
# Clone the repository
git clone <repository-url>
cd dev-safety-mcp
# Install dependencies
pip install -r requirements.txt
# Install the package
pip install -e .
Basic Usage
- Create a sandbox for safe development:
# Through MCP client
await create_sandbox("F:/my-project")
- Save your session state when taking a break:
await save_session_state(
operation="Add payment feature",
current_step="Created component files",
next_steps=["Add API endpoints", "Test integration"],
sandbox_path="F:/my-project-sandbox-session-20250604-143022",
context={"feature": "payment", "priority": "high"}
)
- Continue where you left off:
session = await load_session_state()
print(session['continuation_prompt'])
- Sync approved changes to main project:
await sync_to_main(
sandbox_path="F:/my-project-sandbox-session-20250604-143022",
main_path="F:/my-project",
files=["src/components/Payment.jsx", "src/api/payment.js"]
)
๐ ๏ธ Available MCP Tools
create_sandbox
Creates an isolated copy of your project for safe development.
Parameters:
project_path
(str): Path to the main projectsandbox_name
(str, optional): Custom name for the sandbox
save_session_state
Saves complete session context for later continuation.
Parameters:
operation
(str): Description of what you're working oncurrent_step
(str): What was just completednext_steps
(List[str]): What needs to be done nextsandbox_path
(str): Path to the sandbox being usedcontext
(Dict): Additional context information
load_session_state
Loads the most recent session state and provides continuation prompt.
check_activity
Monitors file activity in the sandbox to suggest when to save state.
Parameters:
sandbox_path
(str): Path to monitorminutes
(int, optional): Time window to check (default: 10)
sync_to_main
Safely copies approved changes from sandbox to main project.
Parameters:
sandbox_path
(str): Source sandbox pathmain_path
(str): Destination main project pathfiles
(List[str], optional): Specific files to sync (default: all changed files)
commit_progress
Manually commit current progress to prevent work loss.
Parameters:
sandbox_path
(str): Path to the sandboxmessage
(str, optional): Commit message describing progress
check_mcp_status
NEW: Check the health and status of the MCP server monitoring system.
Returns:
- Server status and heartbeat information
- Process ID and startup time
- Health warnings if server appears down
๐ Project Structure
dev-safety-mcp/
โโโ README.md
โโโ requirements.txt
โโโ setup.py
โโโ config/
โ โโโ project_types.json
โโโ src/
โ โโโ __init__.py
โ โโโ mcp_server.py # Main MCP server
โ โโโ sandbox_manager.py # Sandbox creation/management
โ โโโ session_manager.py # Session state persistence
โ โโโ activity_monitor.py # File-based activity detection
โ โโโ utils.py # Helper functions
โโโ tests/
โ โโโ test_basic_functionality.py
โ โโโ test_with_real_project.py
โโโ examples/
โโโ basic_workflow_example.py
๐ง Development Workflow
- Start development - Create sandbox with
create_sandbox
- Work safely - All changes happen in isolated sandbox
- Save progress - Use
save_session_state
when taking breaks - Continue seamlessly - Load session state to pick up exactly where you left off
- Deploy changes - Use
sync_to_main
to copy approved changes back
๐ก๏ธ Safety Features
- Sandbox Isolation: Main project never touched during development
- Automatic Backups: Backups created before any sync operations
- Activity Monitoring: Suggests saving state during periods of inactivity
- Version Control: Git branching used in sandboxes for change tracking
- Server Health Monitoring: Built-in status monitoring with heartbeat files
- External Status Checking: Standalone script to verify MCP server health
๐ Server Monitoring
The dev-safety MCP server includes built-in monitoring to detect when the server goes down, ensuring you never lose protection without knowing.
Status Monitoring Features:
- Automatic heartbeat files - Updates every 30 seconds
- Startup notifications - Clear indication when server starts
- External status checker - Standalone monitoring script
- Health warnings - Alerts when server appears down
Using the External Status Checker:
# Check if MCP server is running
python tools/check-mcp-status.py
# Example outputs:
# โ
MCP server is ACTIVE (last seen: 15s ago)
# ๐ด MCP server appears DOWN โ ๏ธ (last seen: 5m ago)
Status File Location:
- File:
~/.dev-safety/mcp_status.json
- Updates: Every 30 seconds while server is running
- Content: PID, startup time, tool count, health status
๐งช Testing
# Run basic functionality tests
python -m pytest tests/test_basic_functionality.py
# Test with a real project
python -m pytest tests/test_with_real_project.py
# Run example workflow
python examples/basic_workflow_example.py
๐ Requirements
- Python 3.8+
- Git (for sandbox version control)
- MCP compatible client (Claude Desktop, etc.)
๐ง Implementation Status
โ Phase 1: Core Value (Current)
- MCP Server with session continuity tools
- Sandbox Management for safe development
- Session State Persistence
- File-Based Activity Detection
- Manual Session Continuation
๐ฎ Future Phases
- Phase 2: Smart Hints (timer-based monitoring, auto-suggestions)
- Phase 3: Simple Automation (auto-save, health checking)
- Phase 4: Advanced Features (multi-interface support, visual monitoring)
๐ License
MIT License - see LICENSE file for details.
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
๐ Support
For issues and questions, please use the GitHub issue tracker.