Sponsored by Deepsite.site

Development Safety System - MCP Server

Created By
fti99996 months ago
MCP server for session continuity and sandbox safety in LLM development workflows. Provides "pick up exactly where you left off" + "never break the main app" functionality.
Content

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.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Serper MCP ServerA Serper MCP Server
ChatWiseThe second fastest AI chatbot™
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Amap Maps高德地图官方 MCP Server
Playwright McpPlaywright MCP server
Tavily Mcp
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
DeepChatYour AI Partner on Desktop
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
CursorThe AI Code Editor