🖼️ MCP Screenshot Server

by margusmartsepp

166 downloads
Not rated
GitHub

About

A lightweight MCP-compatible Python server for capturing Windows screenshots via REST API. Supports full screen, region-based, or window-specific captures. Ideal for AI agent integrations and automation workflows.

Details

Author
margusmartsepp
Downloads
166
Categories
Automation

- Capture full-screen screenshots
- Capture specific windows by title
- Capture custom screen regions
- MCP-compliant REST API
- Returns images as PNG or base64
- Built with FastAPI for production readiness

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name 🖼️ MCP Screenshot Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, create a Python virtual environment, install dependencies from requirements.txt, and run the server with uvicorn main:app --reload. Send a POST request to the /screenshot endpoint with an optional JSON body containing region, window_title, or base64 parameters.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "\ud83d\uddbc\ufe0f mcp screenshot server": {
            "mcp-screenshot-server-margusmartsepp": {
                "command": "python",
                "args": [
                    "-m",
                    "venv",
                    ".venv"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-screenshot-server-margusmartsepp": {
        "command": "python",
        "args": [
            "-m",
            "venv",
            ".venv"
        ]
    }
}

🖼️ MCP Screenshot Server

A lightweight, MCP-compatible screenshot microservice built with FastAPI for Windows.
It allows AI agents and automation tools to capture full-screen, region-based, or window-specific screenshots via simple HTTP calls.

MCP Compatible License: MIT Python

---

🔧 Features

- 📸 Capture full-screen screenshots
- 🪟 Capture specific window by title
- 🔲 Capture custom regions [x, y, width, height]
- 🧠 MCP-compliant REST API
- 🖼️ Returns images as PNG or base64
- 🚀 Built with FastAPI, ready for production or LLM use

---

🧠 Use Cases

- Integrating with LLMs using Model Context Protocol (MCP)
- QA test automation pipelines
- Monitoring and remote capture tools
- Visual logging/debugging tools for agents

---

📦 Installation

git clone https://github.com/yourusername/mcp-screenshot-server.git
cd mcp-screenshot-server
python -m venv .venv
source .venv/bin/activate   # or .venv\Scripts\activate on Windows
pip install -r requirements.txt
uvicorn main:app --reload

---

🔌 API Usage

POST /screenshot

Request JSON body:

{
  "region": [0, 0, 1280, 720],        // optional
  "window_title": "Untitled - Notepad", // optional
  "base64": true                      // optional (default: false)
}

Response (base64 mode):

{
"status": "ok",
"mode": "region",
"image_format": "base64",
"image": "<base64-encoded-image>"
}

---

🛠️ Tech Stack

- Python 3.11+
- FastAPI
- mss or pyautogui for screenshot
- pillow for image processing
- pygetwindow for window matching (optional)

---

📄 License

MIT License.
Feel free to use, fork, and integrate — commercial or personal.
See LICENSE for details.

---

📬 Contributing

Pull requests and issues welcome!
Open a PR to add features or improve compatibility across platforms (e.g., Mac/Linux support).

---

🙋 FAQ

- Does it work on Linux/macOS?
Not yet. This version is Windows-focused, but you’re welcome to extend it.

- Is it MCP-certified?
This project aims to follow the MCP spec as closely as possible for maximum compatibility with LLM agents.

---

🧠 Inspired By

- Anthropic’s Model Context Protocol
- Real-world automation use cases powered by LLMs and Python

---

```

Would you like me to tailor a specific section to emphasize AI agent use (e.g., “how to use with o1 or GPT-4o via plugin”)?

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.