SleepBlocker MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@SleepBlocker MCP Keep my Mac awake for 30 minutes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
š«š¤ Sleep Blocker MCP Server
Control your Mac's sleep settings through AI assistants using the Model Context Protocol (MCP)
Sleep Blocker MCP Server enables AI assistants like Claude Code to prevent your Mac from sleeping using natural language commands. Built on the Model Context Protocol, it provides seamless integration with various AI development tools.
⨠Features
šÆ Natural Language Control - "Keep my Mac awake for 2 hours"
š§ Multiple Sleep Modes - Display, idle, disk, AC power, and all
ā° Flexible Duration - Preset durations or custom times
š Status Monitoring - Check active prevention and remaining time
š”ļø Safe Operation - Automatic cleanup and error handling
š Universal MCP Compatibility - Works with Claude Code, Cursor, and more
Related MCP server: computer-use-mcp
š Quick Start
1-Minute Setup
# Clone this repository
git clone https://github.com/yourusername/SleepBlocker-MCP.git
cd SleepBlocker-MCP
# Run the installer
./install.sh
# Follow the setup instructionsManual Setup
# Make server executable
chmod +x mcp_server.py
# Test the server
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {}}' | python3 mcp_server.pyConfigure Your AI Assistant
For Claude Code, add to your MCP settings:
{
"mcpServers": {
"sleep-blocker": {
"command": "python3",
"args": ["/path/to/SleepBlocker-MCP/mcp_server.py"]
}
}
}š¬ Usage Examples
Once configured, you can use natural language with your AI assistant:
"Prevent my Mac from sleeping for the next hour"
"Keep my screen on during this presentation"
"Stop sleep prevention"
"What's my current sleep status?"
"Show me all available sleep modes"
š ļø Available Tools
Tool | Description | Example |
| Start preventing sleep with mode and duration | "Keep system awake for 2 hours" |
| Stop active sleep prevention | "Allow my Mac to sleep again" |
| Check current status and remaining time | "How much time is left?" |
| Show all available prevention modes | "What sleep modes are available?" |
| Use preset durations (30min, 1hr, 2hr, 4hr) | "Set to 1 hour preset" |
šÆ Sleep Prevention Modes
š„ļø Display - Keep screen on, allow system sleep
š¤ Idle - Keep system awake, allow display sleep (default)
š¾ Disk - Keep hard drives spinning
š AC Power - Only prevent sleep when plugged in
š« All - Prevent all sleep (display + system + disk)
š Requirements
macOS (any version with
caffeinatecommand)Python 3.7+
MCP-compatible client (Claude Code, Cursor, etc.)
š Documentation
š User Guide - Complete setup and usage guide
š” Examples - Real-world usage scenarios
š§ Troubleshooting - Common issues and solutions
āļø Technical Details - MCP implementation details
š¦ Distribution Guide - Packaging and distribution
šŖ Real-World Use Cases
šØāš¼ Professional
Presentations - Keep screen on during demos
Long Downloads - Prevent sleep during file transfers
Video Calls - Maintain display during meetings
Development - Keep system active during builds
šµ Creative
Music Production - Keep drives spinning for sample libraries
Video Editing - Prevent interruptions during renders
Live Streaming - Maintain system during broadcasts
š® Personal
Gaming - Extended gaming sessions
Movie Nights - Keep display on for movies
File Organization - System stays awake during large operations
š Security & Privacy
ā 100% Local - No network connections or data sharing
ā Standard Tools - Uses only macOS built-in
caffeinatecommandā Process Safety - Automatic cleanup and proper termination
ā No Permissions - No special system permissions required
šÆ Quick Test
After installation, test with your AI assistant:
"What sleep prevention modes are available?"
"Start sleep prevention for 5 minutes"
"Check my sleep status"
"Stop sleep prevention"
š Need Help?
Installation Issues: Run
./install.shand follow the colored outputConnection Problems: Check Troubleshooting Guide
Usage Questions: See Examples for inspiration
Technical Details: Review MCP Documentation
š Compatible AI Assistants
Claude Code ā
Cursor ā
Claude Desktop ā
Windsurf ā
Any MCP-compatible client ā
š¦ What's Included
SleepBlocker-MCP/
āāā mcp_server.py # Main MCP server
āāā install.sh # Automated installer
āāā package.json # MCP configuration
āāā README.md # This file
āāā USER_GUIDE.md # Complete user guide
āāā EXAMPLES.md # Usage examples
āāā TROUBLESHOOTING.md # Problem solving
āāā README_MCP.md # Technical documentation
āāā DISTRIBUTION.md # Distribution guide
āāā LICENSE # MIT Licenseš Getting Started in 30 Seconds
# 1. Clone and setup
git clone https://github.com/yourusername/SleepBlocker-MCP.git
cd SleepBlocker-MCP
./install.sh
# 2. Add to your AI assistant's MCP config
# (Path shown by installer)
# 3. Restart your AI assistant
# 4. Try it out!
# Say: "Keep my Mac awake for 30 minutes"š Why Sleep Blocker MCP?
š£ļø Natural Language - No complex commands to remember
š§ Flexible Control - Multiple modes for different needs
ā” Instant Setup - Working in minutes, not hours
š”ļø Rock Solid - Proper error handling and cleanup
š Great Docs - Clear guides for every skill level
š Universal - Works with any MCP-compatible AI assistant
š¤ Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Acknowledgments
Built with the Model Context Protocol
Uses macOS built-in
caffeinatecommandInspired by the need for AI-controlled system management
Ready to take control of your Mac's sleep settings with AI?
ā Start with the installation script ā
Made with ā¤ļø for the MCP community. Questions? Check the User Guide or Troubleshooting docs!
Available Tools
5 toolsget_sleep_statusA
Get current sleep prevention status and remaining time
Inputs: no named parameters.
list_sleep_modesA
List all available sleep prevention modes with descriptions
Inputs: no named parameters.
set_duration_presetB
Set duration using preset values (30min, 1hr, 2hr, 4hr, indefinite)
Inputs: preset (required).
start_sleep_preventionC
Start preventing system sleep with specified mode and duration
Inputs: mode, duration_minutes.
stop_sleep_preventionB
Stop active sleep prevention
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: status check, listing modes, setting presets, starting, and stopping. No overlap between tools.
All tool names follow a consistent verb_noun pattern (e.g., get_sleep_status, start_sleep_prevention) using snake_case throughout.
5 tools is well-scoped for a sleep prevention utility, covering core actions without excess or deficiency.
The tool set covers the full lifecycle: start, stop, check status, list modes, and set duration. No obvious gaps in functionality.
Maintenance
Related MCP Connectors
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Gives your AI assistant persistent memory and intelligence about your work patterns.
A butler for your AI agent: iCloud Calendar, Mail and Contacts, and your Mac.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to automate macOS desktop tasks including mouse control, keyboard input, screenshots, window management, and UI interaction.418MIT
- AlicenseNot gradedqualityDmaintenanceGives AI assistants full macOS desktop control via screenshots, mouse, keyboard, scrolling, and app management.MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to keep a Mac from sleeping during long-running work, optionally keep the display on, and release the hold automatically after task completion, idle timeout, or a safety cap with macOS notifications.MIT
- FlicenseNot gradedqualityBmaintenanceLets an AI agent keep a MacBook awake with the lid closed while a long task runs, through the Keep Mac Awake app on the Mac. Three tools: status, start (1 to 168 hours or no time limit after the user agrees) and stop.2-