hyprland-mcp-server
Provides tools for interacting with the Hyprland Wayland compositor, enabling screen capture, window management, and desktop manipulation.
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., "@hyprland-mcp-servertake a screenshot of my screen"
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.
hyprland-mcp-server
MCP server (Model Context Protocol) for capturing screenshots and querying window/monitor/workspace state in the Hyprland Wayland compositor.
Enables LLMs to see your screen, inspect open windows, and navigate your desktop layout.
Requirements
Binary | Source |
| Bundled with Hyprland |
| https://sr.ht/~emersion/grim/ ( |
The server must run inside an active Hyprland session with WAYLAND_DISPLAY set.
Related MCP server: astra-linux-agent
Installation
cd hyprland-mcp-server
npm install
npm run buildMCP Client Configuration
Claude Desktop / opencode
{
"mcpServers": {
"hyprland": {
"command": "node",
"args": ["/absolute/path/to/hyprland-mcp-server/dist/index.js"]
}
}
}Run manually (for testing)
node dist/index.js
# or during development:
npm run devTools
Tool | Description |
| List all open windows with class, title, address, geometry, workspace |
| Get metadata for the currently focused window |
| Capture a PNG of a specific window (by address, class, title, or PID) |
| Capture a PNG of the currently focused window |
| Capture a full monitor screenshot |
| List monitors with resolution, refresh rate, position, scale |
| List workspaces with window counts and monitor assignments |
| Simulates a mouse click at absolute global coordinates in Hyprland. Useful for programmatically interacting with specific screen positions. |
| Targets the center of a specific window in Hyprland for a mouse click, with optional offsets. |
| Clicks inside a selected window using window-local coordinates ( |
| Performs click with optional bounded retries and returns active-window screenshot for immediate verification. |
| Moves the mouse cursor to specified global coordinates without clicking. |
| Retrieves the current cursor position in the global layout coordinates. |
| Types a text string into the currently focused window using Wayland-native input injection. |
| Sends a single keypress event (e.g., Enter, Tab, Escape) to the currently focused window. |
| Sends a key or a key combination (e.g., "Ctrl+C") to a specific window or the active window. |
| Brings keyboard and compositor focus to a specific window, enabling further interactions. |
Example Usage
"Screenshot the terminal window"
-> hyprland_screenshot_window(class="Alacritty")
"What apps are open on workspace 2?"
-> hyprland_list_windows(workspace_id=2)
"Take a screenshot of my screen"
-> hyprland_screenshot_monitor()
"What am I looking at right now?"
-> hyprland_get_active_window()Screenshot Response
Screenshot tools return:
A text block with geometry, file path, and window info
An image block (base64 PNG) so the LLM can visually inspect the content
A structuredContent block with JSON metadata
Screenshots are saved to a temporary directory under /tmp/hyprland-mcp-*.
Click Precision Notes
hyprland_click_atexpects global monitor coordinates.hyprland_screenshot_windowis naturally read as window-local pixels.Convert local → global when needed:
global_x = window_x + local_x
global_y = window_y + local_yTo avoid coordinate-space mistakes, prefer:
hyprland_click_window_relativewhen targeting UI points from a window screenshot.hyprland_click_windowwhen clicking near window center with offsets.hyprland_click_and_screenshot_activewhen you want click+verify loop in one call.
Development
npm run dev # tsx watch mode
npm run build # compile TypeScript
npm run clean # remove dist/Architecture
src/
index.ts # Server init, dependency check, tool registration
types.ts # TypeScript interfaces for Hyprland IPC structs
schemas/index.ts # Shared Zod schemas (ResponseFormat, WindowSelector)
services/
hyprland.ts # hyprctl wrapper, grim capture, window/monitor queries
tools/
list-windows.ts
get-active-window.ts
screenshot-window.ts
screenshot-active-window.ts
screenshot-monitor.ts
list-monitors.ts
list-workspaces.tsThis server cannot be deployed
Maintenance
Related MCP Connectors
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
- ZionDeskOAuthapp.ziondesk
Connect ChatGPT, Claude, Cursor or VS Code to your Windows PC: files, terminal, browser, apps.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to control a Hyprland Wayland desktop by listing windows, capturing screenshots, and sending input to a dedicated agent workspace without disrupting the user's screen.1MIT
- AlicenseNot gradedqualityDmaintenanceEnables an AI agent to see and control a Linux desktop via Wayland/Hyprland, providing screenshots, structured desktop state, pointer/keyboard input, semantic window/workspace tools, and a policy engine for safe execution.Apache 2.0
- AlicenseBqualityBmaintenanceEnables AI assistants to automate Hyprland desktop environments through screenshots, mouse/keyboard input, window management, workspaces, clipboard, app launching, and OCR.271MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to inspect and control an Omarchy/Hyprland desktop by taking screenshots, focusing windows, moving/clicking the mouse, scrolling, typing text, and sending keyboard shortcuts.MIT