hyprland-mcp
This server provides an MCP interface to control the Hyprland Wayland compositor via Claude, enabling full window manager automation and configuration.
Window Management: List, get active, focus, close, kill, move to workspace, resize, toggle floating/fullscreen, and pin windows.
Workspace Management: List, get active, switch, move to monitor, rename, and toggle special/scratchpad workspaces.
Monitor Control: List, focus, and configure monitor settings (resolution, position, scale, enable/disable).
System Configuration: Get/set Hyprland config options at runtime, reload the config file, get version info, and list all keybindings.
Screenshots: Capture the full screen, a specific monitor, an interactively selected region, or the active window.
Notifications: Send desktop notifications and dismiss Hyprland's built-in on-screen notifications.
App Launcher: Toggle hyprlauncher open/closed and pre-warm its daemon for instant launches.
Window Grouping: Create/ungroup tabbed containers, cycle through windows in a group, and lock/unlock groups.
Window Tagging: Add, remove, or toggle tags on windows for grouping and rule matching.
Cursor Control: Move the cursor to absolute screen coordinates or to a specific corner of a window.
Blue-Light Filter (hyprsunset): Set color temperature, adjust gamma, disable the filter, reset to scheduled profile, and view the active profile.
Wallpaper (hyprpaper): Set wallpapers per-monitor or as a global fallback, and list currently active wallpapers.
Escape Hatches: Use hyprland_dispatch to call any Hyprland dispatcher or hyprctl_raw to execute any raw hyprctl subcommand for operations not covered by dedicated tools.
Allows AI agents (like Claude) to control the Hyprland window manager, including managing windows, workspaces, monitors, keybinds, notifications, screenshots, app launcher, tags, groups, cursor, blue light filter, and wallpaper.
Click on "Install 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-mcpSwitch to workspace 3"
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
An MCP server that lets Claude control Hyprland through hyprctl.
Talks to Hyprland over its IPC socket via hyprctl/hyprctl -j, and shells out to
grim/slurp/notify-send for screenshots and notifications. Runs over stdio, so
it only works when launched inside your Hyprland session (or with
HYPRLAND_INSTANCE_SIGNATURE forwarded to it).
Tools
Windows:
list_windows,get_active_window,focus_window,close_window,kill_active_window,move_window_to_workspace,move_active_window,resize_active_window,toggle_floating,toggle_fullscreen,pin_windowWorkspaces:
list_workspaces,get_active_workspace,switch_workspace,move_workspace_to_monitor,rename_workspaceMonitors:
list_monitors,focus_monitor,set_monitor_configConfig:
get_config_option,set_config_option,reload_hyprland_config,get_hyprland_versionKeybinds:
list_keybindsNotifications:
send_notification,dismiss_notificationsScreenshots:
take_screenshot,take_region_screenshot(interactive, via slurp),screenshot_active_windowApp launcher:
toggle_launcher,prewarm_launcher_daemon(controls hyprlauncher, Hyprland's first-party app picker — a self-toggling daemon, not a hyprctl dispatcher)Tags:
tag_windowGroups (tabbed containers):
toggle_group,group_cycle,toggle_group_lock,deny_window_from_groupCursor:
move_cursor,move_cursor_to_cornerhyprsunset (blue light filter):
set_sunset_temperature,disable_sunset_filter,set_sunset_gamma,reset_sunset,get_sunset_profilehyprpaper (wallpaper):
set_wallpaper,list_active_wallpapershypridle (idle management):
start_hypridle,stop_hypridle,get_hypridle_statushyprlock (screen lock):
lock_screen,unlock_screen,refresh_lockscreen,get_lock_statushyprpicker (color picker):
pick_colorEscape hatches:
hyprland_dispatch(anyhyprctl dispatch <dispatcher>),hyprctl_raw(any rawhyprctlsubcommand)
Related MCP server: hyprland-mcp
Requirements
Node.js 18+
Hyprland (obviously) with
hyprctlonPATHOptional:
grim+slurpfor screenshots,notify-send(mako/dunst/similar) for notifications,hyprlauncherfor the app launcher tools,hyprsunsetfor blue-light filter tools,hyprpaper(withipc = true, the default, inhyprpaper.conf) for wallpaper tools,hypridle/hyprlockfor idle/lock tools,hyprpicker(+wl-clipboardfor its autocopy option) for the color picker tool,pgrep/pkill(procps/procps-ng, virtually always preinstalled) for the hypridle/hyprlock and hyprlauncher tools — these all degrade gracefully or error clearly if missing
Build
npm install
npm run buildThis produces build/index.js.
Wire it up
Claude Code
claude mcp add hyprland -- node /absolute/path/to/hyprland-mcp/build/index.jsClaude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"hyprland": {
"command": "node",
"args": ["/absolute/path/to/hyprland-mcp/build/index.js"]
}
}
}Claude Desktop on Linux is launched by your session, so HYPRLAND_INSTANCE_SIGNATURE
should already be in its environment. If you ever run this from a context that doesn't
have it (e.g. a systemd unit, SSH session, or this same tool running Claude Code from
inside a sandbox), export it first, e.g.:
export HYPRLAND_INSTANCE_SIGNATURE=$(ls /tmp/hypr | head -n1)Hyprland 0.55+ Lua dispatch syntax
Hyprland 0.55 replaced hyprlang config with a Lua-based one, and — independent of
which config format your own hyprland.conf/.lua uses — the running 0.55+ binary
now parses hyprctl dispatch <arg> as a single Lua expression rather than the old
<dispatcher-name> <args> positional form. hyprctl dispatch workspace 3 will error
on 0.55+; the equivalent is hyprctl dispatch 'hl.dsp.workspace.change({workspace=3})'.
This project targets that new syntax throughout (src/hyprctl.ts has luaCall() /
dispatchLua() / evalLua() helpers; src/dispatch-expressions.ts holds every
generated expression as a pure, unit-tested function). Confidence tiers, now backed
by real testing against Hyprland 0.55.4 (see scripts/test-flagged-dispatchers*.sh):
A documentation lesson learned building this:
wiki.hypr.land's un-versioned pages track gitmain, not the latest tagged release — they can (and did) describe features not yet in any shipped 0.55.x build.hyprctl replis one confirmed example: documented on the rolling wiki, absent on a real 0.55.4 session. When verifying a specific version's behavior, prefer version-pinned docs (wiki.hypr.land/<version>/...) or a real session over the rolling pages, and treat anything from the rolling wiki that isn't independently corroborated (a working example, a dated GitHub PR/issue, multiple converging sources) as "probably true for the latest release, not guaranteed."
Confirmed against the wiki, a working example, or a real 0.55.4 session:
hl.dsp.focus(including{ monitor = ... }),hl.dsp.window.{close,kill,move, resize,float,fullscreen,tag,deny_from_group,pin},hl.dsp.workspace.{change, rename,move_to_monitor,toggle_special},hl.dsp.group.{toggle,next,prev,lock},hl.dsp.cursor.{move,move_to_corner},hl.dsp.exec_cmd,hl.dsp.submap,hl.dsp.pass,hl.dsp.send_shortcut.window.pin()specifically: confirmed by a semantic rejection ("Window does not qualify to be pinned" — Hyprland's own pin logic rejecting a non-floating window) rather than the "attempt to call a nil value" error a wrong path produces, which is what distinguishes "right path, wrong preconditions" from "guessed wrong".Confirmed BROKEN against a real session, since fixed: a bare
hl.dsp.pin()errored withattempt to call a nil valueon Hyprland 0.55.4; corrected tohl.dsp.window.pin().Notifications: fixed by using a different mechanism entirely. The first pass at this project used the newer
hl.notification.create/get()Lua API, which a real Hyprland 0.55.4 session confirmed produces no visible on-screen effect at all (call succeeds, nothing renders).send_notification's fallback anddismiss_notificationsnow usehyprctl notify <icon> <time_ms> <color> <message>/hyprctl dismissnotify [amount]instead — plain, non-Lua hyprctl subcommands that predate the 0.55 rewrite by about two years (dismissnotifymerged in hyprwm/Hyprland#4790,and are documented with exact parameter meanings on the wiki's Notifications page. See
src/tools/notify.tsfor the confirmed icon/color parameter mapping. Confirmed working end-to-end on a real session: notification created and visibly appeared, thendismissnotifyvisibly cleared it.
hyprctl keyword/getoption/reload/version/notify/dismissnotify(used byconfig.ts/notify.ts) are all plain, non-dispatch subcommand families and remain unaffected — confirmed by omission for the first three, and by direct wiki documentation predating 0.55 for the notification pair.
This is a fast-moving part of Hyprland (0.55.0 → 0.55.4 shipped within about a month, with dispatcher-behavior bugfixes in each). If something that used to work here breaks after a Hyprland update, check the dispatcher's current signature on the wiki before assuming the MCP server itself regressed.
Real-session testing status (Hyprland 0.55.4, as of this writing): every
dispatch-based tool is confirmed correct, and the non-Lua tools (notify/
dismissnotify, hyprsunset, hyprpaper) are confirmed working end-to-end via
scripts/test-notify-sunset-paper.sh — notification create/dismiss, temperature/
gamma/identity, and listactive all behaved as expected on a real session. Every
tool in this project has now been verified against a real Hyprland instance.
Testing
src/dispatch-expressions.ts holds pure, side-effect-free builders for every Lua
expression this project sends to hyprctl dispatch — no hyprctl/child_process
calls, so they're unit-testable without a real Hyprland session:
npm testThis runs tsc then Node's built-in test runner over
src/__tests__/dispatch-expressions.test.ts, asserting the exact string each
builder produces — including the two verbatim wiki examples (window.tag with a
target, workspace.toggle_special's bare-string argument). This is what actually
catches syntax drift: when a future Hyprland release changes an hl.dsp.* shape,
update the builder and its test together rather than only touching the call site
buried inside a tool handler.
It already caught one real bug during development: denyWindowFromGroupExpr()
with no target was emitting hl.dsp.window.deny_from_group({ }) (an empty table)
instead of a clean (), because the builder always passed an args object even when
every key in it was undefined. Worth knowing if you add a new builder where a
target/selector is the only possible key — build the whole args object
conditionally rather than relying on luaCall's undefined-key filtering to save you.
Security note: unlock_screen
hyprlock has no password-aware IPC — its only documented unlock mechanism is
SIGUSR1 (pkill -USR1 hyprlock), which this project's unlock_screen tool uses
directly. That means it bypasses PAM/password authentication entirely: anything
able to invoke this MCP tool can unlock a locked session without knowing the
password. This isn't a bug or an oversight, it's the only unlock mechanism hyprlock
exposes — but it does mean access to this MCP server should be treated as
equivalent in sensitivity to your screen lock's own security boundary. Don't wire
this server up somewhere a lock screen is meant to be a real barrier (e.g. a
shared/untrusted machine) without accounting for that.
Design notes
hyprsunsetandhyprpaperare controlled through their ownhyprctl <name> <args>subcommand families (hyprctl hyprsunset ...,hyprctl hyprpaper ...) — likekeyword/getoption, these are untouched by the 0.55 Lua dispatch rewrite, sosrc/tools/hyprsunset.tsandhyprpaper.tscallrunHyprctl()directly with no Lua expression involved.All
hyprctlcalls go throughexecFile(never a shell), so arguments can never be used for shell injection.Read commands (
list_*,get_*) always go throughhyprctl -jand get parsed as JSON so Claude gets structured data, not text to eyeball.Every dedicated tool is a thin wrapper around a specific dispatcher/subcommand.
hyprland_dispatchandhyprctl_rawexist as escape hatches for anything not yet wrapped (Hyprland adds dispatchers between releases) — checkhyprctl dispatch --helpor the Hyprland wiki for the full list.Screenshot tools write to a temp dir, base64-encode, and clean up after themselves.
Move/resize tools use Hyprland's
exact/relative dispatcher argument conventions (moveactive,resizeactive) rather than reimplementing geometry math.
Extending
Add a new file under src/tools/, export a register*Tools(server) function, and
call it from src/index.ts. Keep one hyprctl concern (e.g. layers, devices,
pin/special-workspaces) per file so the project stays easy to navigate.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityDmaintenanceAn MCP server that provides Claude with comprehensive desktop automation capabilities including browser control, window management, and native mouse/keyboard input on Windows. It enables users to capture screenshots, launch applications, and interact with the system clipboard through natural language.Last updated20
- AlicenseAqualityDmaintenanceAn MCP server for Hyprland desktop automation that allows AI assistants to see the screen, control mouse and keyboard, and manage windows using native Wayland tools. It integrates OCR for text-based interaction and supports complex multi-monitor setups with pixel-accurate coordinate mapping.Last updated275MIT
- Alicense-qualityBmaintenanceAn MCP server that lets Claude Desktop and Claude Code control your PC — take screenshots, click, type, manage windows, and more.Last updatedMIT
- Alicense-qualityBmaintenanceMCP server that gives Claude human-like control of a Windows PC with its own virtual cursor, an emergency stop, and a manager UI.Last updated1MIT
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/keanehatescoding/hyprland-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server