dev-safety-mcp

fti9999/dev-safety-mcp

3.1

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.

Tools
7
Resources
0
Prompts
0

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

  1. Create a sandbox for safe development:
# Through MCP client
await create_sandbox("F:/my-project")
  1. 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"}
)
  1. Continue where you left off:
session = await load_session_state()
print(session['continuation_prompt'])
  1. 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 project
  • sandbox_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 on
  • current_step (str): What was just completed
  • next_steps (List[str]): What needs to be done next
  • sandbox_path (str): Path to the sandbox being used
  • context (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 monitor
  • minutes (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 path
  • main_path (str): Destination main project path
  • files (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 sandbox
  • message (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

  1. Start development - Create sandbox with create_sandbox
  2. Work safely - All changes happen in isolated sandbox
  3. Save progress - Use save_session_state when taking breaks
  4. Continue seamlessly - Load session state to pick up exactly where you left off
  5. 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

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests for new functionality
  5. Submit a pull request

📞 Support

For issues and questions, please use the GitHub issue tracker.