π₯οΈ Desktop MCP
A Model Context Protocol (MCP) server for desktop operations, providing AI assistants with the ability to capture and analyze screen content across multi-monitor setups.
Features
πΈ Multi-Monitor Screenshot Support: Capture screenshots from any region across all connected displays
π₯οΈ Screen Information: Get detailed information about all connected monitors (resolution, position, dimensions)
π¨ Smart Image Optimization: Automatic compression and resizing for AI context efficiency
π Dual Mode Operation: Run as an MCP server or as a standalone web API
β‘ FastAPI Powered: Built on modern, fast, and well-documented FastAPI framework
Installation
Prerequisites
Python 3.8 or higher
Windows, macOS, or Linux
Setup
Clone the repository:
Install dependencies:
Usage
MCP Mode (Default)
Run as an MCP server for use with AI assistants like Claude Desktop:
Web Mode
Run as a standalone web API with interactive documentation:
This will:
Start the server at
http://localhost:8000
Automatically open the interactive API docs in your browser
Enable live reload for development
Configuration
Adding to Claude Desktop
Add this configuration to your Claude Desktop MCP settings file (typically at ~/.cursor/mcp.json
or %APPDATA%/.cursor/mcp.json
):
API Reference
Endpoints
GET /desktop/screens
Get information about all connected monitors.
Response:
POST /desktop/screenshot
Capture a screenshot of a specific region.
Parameters:
x
(int): X coordinate of top-left cornery
(int): Y coordinate of top-left cornerwidth
(int): Width of capture regionheight
(int): Height of capture regioncontext_mode
(string, optional): Image quality modeminimal
(default): 600px max, 30% quality - for basic UI detectionnormal
: 800px max, 50% quality - for detailed UI inspectiondetailed
: 1200px max, 70% quality - for pixel-perfect UI analysis
Request Body:
Response:
Usage Examples
Example 1: Capture Primary Monitor
Example 2: Capture Specific Region
Example 3: Multi-Monitor Setup
Use Cases with AI Assistants
When integrated with AI assistants like Claude:
Visual Debugging: "Can you see what error message is on my screen?"
UI/UX Analysis: "What do you think of this design layout?"
Tutorial Assistance: "I'm stuck on this step, can you see what I'm doing wrong?"
Code Review: "Can you review the code visible on my screen?"
Accessibility Testing: "Is this UI accessible and well-organized?"
Development
Project Structure
Running Tests
Requirements
fastapi
- Modern web frameworkfastmcp
- MCP protocol implementationuvicorn
- ASGI serverscreeninfo
- Monitor information retrievalpyautogui
- Screenshot capturepillow
- Image processingpydantic
- Data validation
Security Considerations
β οΈ Important: This tool provides direct access to screen content. When deploying:
Only expose to trusted networks
Consider authentication mechanisms for production use
Be mindful of sensitive information in screenshots
Use appropriate context modes to minimize data transfer
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - feel free to use this project for personal or commercial purposes.
Troubleshooting
Screenshot Capture Fails
Linux: Ensure you have the required X11 libraries installed
macOS: Grant screen recording permissions in System Preferences
Windows: Run with appropriate privileges if capturing protected content
Multi-Monitor Issues
Use
GET /desktop/screens
first to verify monitor coordinatesRemember that coordinates are based on virtual desktop layout
Monitors may be arranged horizontally, vertically, or in custom configurations
Performance Optimization
Use
minimal
context mode for frequent capturesCapture only the necessary region instead of full screens
Consider caching screen information instead of querying repeatedly
Support
For issues, questions, or suggestions, please open an issue on GitHub.
Made with β€οΈ for enhancing AI assistant capabilities
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
Enables AI assistants to capture and analyze screen content across multi-monitor setups with smart image optimization. Provides screenshot capabilities and detailed monitor information for visual debugging, UI analysis, and desktop assistance.