Screenshot MCP server

Capture website screenshots and save them to a file path specified by the user.
Back to servers
Provider
Kunihiro Setogawa
Release date
Apr 03, 2025
Language
Python

This MCP server is designed to capture screenshots from Windows systems and make them available to other processes, particularly for AI assistants running in WSL. It specializes in saving screenshots to specified file paths, enabling seamless interaction between different environments.

Installation and Setup

Prerequisites

  • Python 3.x installed on Windows
  • UV package manager

Installation Steps

Install the required dependencies using UV:

uv sync

This will install the necessary packages including mcp[cli]>=1.4.1, pyautogui, and Pillow.

Configuration for WSL

For the most common use case (AI Assistant running in WSL that needs to capture Windows screenshots):

  1. Place the screenshot-server project folder on your Windows filesystem (e.g., C:\Users\YourUser\projects\screenshot-server)
  2. Install Python, UV, and project dependencies directly on Windows
  3. Configure your MCP Host (in WSL) to launch the server through PowerShell by editing your mcp_settings.json:
{
  "mcpServers": {
    "Screenshot-server": {
      "command": "powershell.exe",
      "args": [
        "-Command",
        "Invoke-Command -ScriptBlock { cd 'C:\\Users\\YourUser\\projects\\screenshot-server'; & 'C:\\path\\to\\uv.exe' run screenshot.py }"
      ]
    }
  }
}

Using the Screenshot Server

Available Tools

1. Save Screenshot to Host Workspace (Recommended)

save_screenshot_to_host_workspace(host_workspace_path: str, name: str = "workspace_screenshot.jpg")

Parameters:

  • host_workspace_path: The absolute WSL path of the Host's workspace (e.g., /home/user/project)
  • name: Filename (optional, defaults to "workspace_screenshot.jpg")

Returns: String - "success" or "failed: [error message]"

2. Take Screenshot and Return Path

take_screenshot_and_return_path(name: str = "latest_screenshot.jpg")

Parameters:

  • name: Filename (optional, defaults to "latest_screenshot.jpg")

Returns: String - Absolute path to the saved screenshot or "failed: [error message]"

3. Take Screenshot to Specific Path

take_screenshot_path(path: str = "./", name: str = "screenshot.jpg")

Parameters:

  • path: Target directory (Windows or UNC path, defaults to server's working directory)
  • name: Filename (optional, defaults to "screenshot.jpg")

Returns: String - "success" or "failed: [error message]"

Workflow Example

For an AI Assistant running in WSL:

  1. Identify the current workspace path (e.g., /home/user/current_project)
  2. Call the screenshot server:
result = use_mcp_tool("Screenshot-server", "save_screenshot_to_host_workspace", {
    "host_workspace_path": "/home/user/current_project",
    "name": "my_screenshot.jpg"
})
  1. Check if the result is "success"
  2. Access the screenshot at /home/user/current_project/my_screenshot.jpg
  3. Use this path with an image analysis server/tool also running in WSL

Troubleshooting

  • Ensure the server is running on Windows (not in WSL) to capture the Windows screen
  • Verify path conversions are working properly when using WSL
  • Check file permissions if screenshots aren't being saved correctly
  • Examine the server.log file for detailed error information

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later