Skip to main content
Glama

screen-mcp

An MCP (Model Context Protocol) server that gives AI agents eyes on an Omarchy / Hyprland Wayland desktop. It captures screenshots via grim and offers optional image analysis powered by the Gemini API — useful when the calling model has no native vision encoder.

Features

Tool

What it does

Returns

list_windows

Enumerate Hyprland windows via hyprctl

Text listing with addresses, titles, workspaces, sizes

screenshot_region

Capture a pixel rectangle (x, y, width, height)

Inline PNG image (base64)

screenshot_window

Capture a window by title, class, address, or "focused"

Inline PNG image (base64)

screenshot_fullscreen

Capture the entire screen

Inline PNG image (base64)

analyze_image

Send an image (base64 or file path) to Gemini for reasoning

Text response

screenshot_and_analyze

Capture a region and analyze it in one call

Text (Gemini response)

Screenshots use grim (wlroots screencopy protocol) — no X11 required.

Related MCP server: Wayland MCP Server

Prerequisites

  • Omarchy, Hyprland, or any wlroots-based Wayland compositor

  • grim — Wayland screenshot tool

  • slurp — (optional) interactive region selection helper

  • hyprctl — Hyprland window/query CLI

  • jq — (optional) used by some helper scripts

Check with:

grim --help && hyprctl clients -j | head -c 20

For image analysis (optional)

export GEMINI_API_KEY="your-api-key-here"

Without the key, the screenshot tools still work; only analyze_image and screenshot_and_analyze will return an error.

Installation

Via Claude Desktop

Add this to your Claude Desktop claude_desktop_config.json:

{
  "mcpServers": {
    "screen-mcp": {
      "command": "npx",
      "args": ["-y", "screen-mcp"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here"
      }
    }
  }
}

Via npx

npx -y screen-mcp

# Or install globally:
npm install -g screen-mcp

Usage examples

Capture a screen region

screenshot_region(x=100, y=200, width=800, height=600, include_cursor=true)

Capture a specific window

First list available windows to get an address or title:

list_windows()

Then capture by title (substring match), address, or "focused":

screenshot_window(window="Spotify")
screenshot_window(window="focused")
screenshot_window(window="0x557ba79b4900")

Analyze an image with Gemini

analyze_image(
  image_path="/tmp/my-screenshot.png",
  prompt="What applications are visible in this screenshot?",
  model="gemini-2.5-flash"
)

Or pass base64-encoded image data directly:

analyze_image(
  image="<base64-encoded-image>",
  prompt="Describe what you see in this image.",
  mime_type="image/png"
)

Capture and analyze in one call

screenshot_and_analyze(
  x=0, y=0, width=1920, height=1080,
  prompt="Count the number of windows open and list their titles.",
  scale=0.5,
  model="gemini-2.5-flash"
)

Development

# Install deps
npm install

# Build
npm run build

# Run
npm start

# Development (recompile on change)
npm run dev

How it works

  • Capture: src/capture.ts wraps grim (screenshots) and hyprctl (window enumeration). Window capture first tries grim -T <stableId> (foreign-toplevel handle), falling back to grim -g "<x>,<y> <w>x<h>" (geometry from hyprctl).

  • Analysis: src/gemini.ts uses the official @google/genai SDK. Images are passed inline as base64 to the Gemini API's interactions.create endpoint.

  • Server: src/index.ts wires everything together as a stdio-transported MCP server using @modelcontextprotocol/server.

License

MIT

Available Tools

6 tools
analyze_imageAnalyze Image (Gemini)A
Read-only

Send an image to the Gemini API for visual reasoning. Useful when the calling model has no native image encoder. Provide either a base64-encoded image or a local file path.

ParametersJSON Schema
NameRequiredDescriptionDefault
imageNoBase64-encoded image data
modelNoGemini model to use (default: gemini-2.5-flash)
promptYesWhat to analyze or ask about the image
mime_typeNoMIME type of the image (e.g. image/png, image/jpeg)image/png
image_pathNoPath to a local image file

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only and non-destructive behavior, lowering the bar for description. The description adds that it uses the Gemini API and accepts either base64 or file path, which is useful but does not disclose potential external API costs, rate limits, or error behaviors. No contradiction with annotations; score reflects minimal but adequate transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with purpose and a clear use case. No wasted words; every clause adds value (purpose, use case, input methods). Perfectly concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (5 params, 1 required) with good annotations and full schema coverage. The description adequately covers the essential input options and purpose. It does not mention edge cases or error handling, but given the simplicity and existing structured metadata, it is complete enough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema descriptions cover all parameters (100% coverage), setting a baseline of 3. The description adds a note about providing either base64 or file path, which clarifies the mutual exclusivity of image and image_path, but this is a minor addition. It does not significantly enhance understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool sends an image to the Gemini API for visual reasoning, with specific input methods (base64 or file path). This distinguishes it from sibling screenshot tools, which capture images rather than analyze existing ones, and aligns with the context signal that the calling model may lack an image encoder.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use the tool ('when the calling model has no native image encoder') but does not explicitly name alternatives or state when not to use it. This meets the 'clear context, no exclusions' criterion but stops short of the top score.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_windowsList WindowsA
Read-onlyIdempotent

List all visible windows on the Hyprland desktop via hyprctl. Use the returned address with screenshot_window, or use "focused" to target the active window.

ParametersJSON Schema
NameRequiredDescriptionDefault
workspaceNoFilter to a specific workspace ID or name

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description aligns with these by describing a listing operation with no side effects. It adds context about the return value being used for screenshots, which does not contradict the annotations. No contradictions present.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and to the point. It conveys the core functionality and a usage tip in two short sentences, with no unnecessary fluff. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that there is no output schema, the description does not need to explain exact return types. However, it does hint at the return content ('returned address'), which is useful context. It is complete enough for typical usage, but could benefit from a note about the format of the window data (e.g., if it returns a list of objects with addresses and titles). Otherwise, it adequately covers the tool's purpose.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There is only one parameter, 'workspace', and its description ('Filter to a specific workspace ID or name') is clear and complete. The parameter's purpose and expected format are explicitly stated, providing full semantic coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: 'List all visible windows on the Hyprland desktop via hyprctl.' This is a specific verb (list) and resource (windows), and it distinguishes from sibling tools by the fact that siblings are screenshot and analysis tools, while this one is for listing window information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear usage hint: 'Use the returned address with screenshot_window, or use "focused" to target the active window.' This implies when to use the tool (before taking screenshots) and highlights a parameter-specific behavior. However, it does not explicitly mention when not to use it or alternative scenarios, so it is not fully explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

screenshot_and_analyzeScreenshot & AnalyzeA
Read-only

Capture a screen region and immediately send it to Gemini for analysis in a single call. Combines screenshot_region and analyze_image. Useful for agents without native vision.

ParametersJSON Schema
NameRequiredDescriptionDefault
xYesTop-left X coordinate in pixels
yYesTop-left Y coordinate in pixels
modelNoGemini model to use (default: gemini-2.5-flash)
scaleNoDownscale factor for the screenshot before sending to Gemini
widthYesRegion width in pixels
heightYesRegion height in pixels
promptYesWhat to analyze or ask about the screenshot
include_cursorNoInclude the mouse cursor in the screenshot

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds context by revealing it is a composite operation ('Combines screenshot_region and analyze_image') and explains its utility for agents without native vision. It does not contradict annotations, and it adds useful behavioral context beyond the structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary action, and contains no fluff. Every sentence adds value: the first explains what it does, the second provides context and usage guidance. It is appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 8 parameters, no output schema, and is a composite of two tools, the description is mostly complete. It explains the purpose, usage context, and composition. However, it does not explicitly state what the tool returns (the Gemini analysis), though this is implied by 'send it to Gemini for analysis.' Minor gap, but adequate for an agent to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all 8 parameters are already well-documented in the input schema. The description adds minimal parameter-specific meaning—it implicitly clarifies that x, y, width, height define the region and prompt is the analysis question, but this is already evident from the schema. It does not elaborate on scale or model, but the schema covers those. Baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action: 'Capture a screen region and immediately send it to Gemini for analysis in a single call.' It specifies the resource (screen region) and the purpose (analysis), and distinguishes itself by noting it combines screenshot_region and analyze_image, setting it apart from sibling tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear use case: 'Useful for agents without native vision.' This indicates when to prefer this tool over alternatives. However, it does not explicitly state when not to use it or mention alternative tools like calling screenshot_region and analyze_image separately, so it lacks exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

screenshot_fullscreenScreenshot FullscreenA
Read-onlyIdempotent

Capture the entire screen using grim. Returns the image inline as base64.

ParametersJSON Schema
NameRequiredDescriptionDefault
include_cursorNoInclude the mouse cursor in the screenshot

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, covering the safety profile. The description adds valuable context by stating 'Returns the image inline as base64', which informs the agent about the return format without contradicting any annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences, front-loaded with the action, and contains zero waste. It efficiently communicates the tool's core purpose and output format.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one optional parameter, no output schema, and strong annotations, the description is complete. It covers the action, scope, implementation, and return format, which is sufficient for an agent to select and use the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the parameter include_cursor is fully documented in the schema. The description itself adds no extra meaning about the parameter, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Capture the entire screen using grim', which is a specific verb (capture) and resource (entire screen), and distinguishes it from sibling tools like screenshot_window and screenshot_region by explicitly stating the full-screen scope. It also mentions the output format, making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool (when you need the entire screen) but does not explicitly mention alternatives or when not to use it. The context is clear from the phrase 'entire screen', which sets it apart from window- or region-specific tools, but it lacks explicit exclusion or alternative guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

screenshot_regionScreenshot RegionA
Read-onlyIdempotent

Capture a rectangular screen region by pixel coordinates using grim (Wayland wlroots screencopy). Coordinates are in layout pixels. Returns the image inline as base64.

ParametersJSON Schema
NameRequiredDescriptionDefault
xYesTop-left X coordinate in pixels
yYesTop-left Y coordinate in pixels
scaleNoDownscale factor (e.g. 0.5 for half resolution) to reduce image size
widthYesRegion width in pixels
heightYesRegion height in pixels
include_cursorNoInclude the mouse cursor in the screenshot

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only, idempotent, and non-destructive behavior. The description adds valuable transparency by specifying that it uses grim (Wayland wlroots screencopy) and returns the image as base64, but it does not disclose potential errors or side effects beyond what annotations cover.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences with no filler. It efficiently conveys the core functionality, coordinate system, and output format, making it easy to scan and understand.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given that no output schema is provided, the description's note about returning the image inline as base64 is essential context. It also clarifies the coordinate system (layout pixels). However, it lacks information about error handling or edge cases (e.g., out-of-bounds coordinates), which prevents a perfect score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All parameters (x, y, width, height, scale, include_cursor) have clear descriptions in the schema, covering 100% of the input semantics. The description adds no additional parameter information, so the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it captures a rectangular screen region via pixel coordinates, explicitly differentiating from sibling tools like screenshot_window (window capture) and screenshot_fullscreen (fullscreen capture). The verb 'Capture' and specific resource 'rectangular screen region' make the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Description mentions pixel coordinates and base64 output, but does not explicitly state when to choose this tool over alternatives like screenshot_window or screenshot_fullscreen. The coordinate-based approach implies region capture, but there is no direct 'use when' or 'use instead' guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

screenshot_windowScreenshot WindowA
Read-onlyIdempotent

Capture a specific window by title, class, address, or the keyword "focused". Uses hyprctl to resolve the window and grim -T to capture it. Returns the image inline as base64.

ParametersJSON Schema
NameRequiredDescriptionDefault
windowYesWindow to capture: "focused" for the active window, an exact address (0x...), or a substring matched against window title and class
include_cursorNoInclude the mouse cursor in the screenshot

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, so the description does not need to repeat safety guarantees. It adds valuable behavioral context by revealing the underlying commands (hyprctl, grim) and the return format (base64 inline), which helps the agent understand execution behavior and output handling without contradicting the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no redundancy. It opens with the core purpose, then specifies implementation details and output format. Every sentence carries meaningful information, achieving maximum conciseness without sacrificing clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with only two well-documented parameters and no output schema. The description sufficiently explains that the image is returned inline as base64, which is the critical behavioral output. Given the annotations and schema richness, the description covers all necessary aspects for correct invocation and interpretation of results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Since schema description coverage is 100%, both parameters are thoroughly documented in the input schema. The description restates the window selection logic (title, class, address, focused) but does not add new information beyond the schema. This meets the baseline of 3 for high schema coverage; no extra semantic value is provided.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Capture a specific window') and the resource (window), while specifying the matching methods (title, class, address, or 'focused'). It distinguishes itself from siblings like screenshot_region and screenshot_fullscreen by focusing on a single window, making the purpose unmistakable.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool (capturing a specific window) and mentions the technical approach (hyprctl, grim). It does not explicitly contrast with sibling tools (e.g., 'use screenshot_region for arbitrary areas'), but the specificity of 'a specific window' implies its use case over alternatives, earning a 4 rather than a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.1.0
    • First observedanalyze_image
    • First observedlist_windows
    • First observedscreenshot_and_analyze
    • First observedscreenshot_fullscreen
    • First observedscreenshot_region
    • First observedscreenshot_window

TDQS

A4.3/5.0

Scored across 6 tools

Disambiguation4/5

Each tool has a distinct purpose: listing windows, capturing by target (window/region/fullscreen), analyzing an existing image, and a combined capture+analyze convenience. The overlap between screenshot_and_analyze and screenshot_region+analyze_image is intentional but creates slight ambiguity for agents choosing between them.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern (list_windows, screenshot_window, analyze_image). The compound screenshot_and_analyze is well-formed and consistent with the style, maintaining a clear and predictable naming convention.

Tool Count5/5

With 6 tools, the server is well-scoped and each tool serves a clear, non-redundant function for screen capture and image analysis. The count is ideal for a focused utility server.

Completeness4/5

The tool surface covers the core lifecycle of capturing and analyzing screenshots, including window enumeration and multiple capture modes. Minor gaps exist, such as no explicit monitor listing or image format options, but the essential workflows are fully supported.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers