Skip to main content

A lightweight MCP server that exposes Hyprland functionality to language models

Project description

Hyprland MCP Server

License: MIT Python 3.10+ Platform Build Status MCP Server

https://github.com/user-attachments/assets/b4fc1d26-ec04-451a-b7c9-7f87b44d9c9e

A lightweight, unofficial Model Context Protocol (MCP) server that exposes all the functionality of hyprctl—the command-line interface for the Hyprland Wayland compositor—to language models.

This server enables natural language interfaces to query and control Hyprland's window management, layouts, inputs, and more.

Note: This project is experimental and in beta.

🚀 Quick Start

1. Clone the repository

git clone https://github.com/stefanoamorelli/hyprmcp.git
cd hyprmcp

2. Grab your HYPRLAND_INSTANCE_SIGNATURE

echo $HYPRLAND_INSTANCE_SIGNATURE

3. Install the server in your MCP client

For example, in Claude Desktop, modify the ~/.config/Claude/claude_desktop_config.json file as follows:

"Hyperland MCP Server": {
  "command": "uv",
  "args": [
    "run",
    "--with",
    "mcp[cli]",
    "--with",
    "subprocess",
    "mcp",
    "run",
   "<global path of the repo>/hyprmcp/hyprmcp/server.py"
  ],
  "env": {
    "PYTHONPATH": "<global path of the repo>/hyprmcp",
    "HYPRLAND_INSTANCE_SIGNATURE": "<your-hyprland-instance-signature>"
  }
},

🧰 Available Tools

Tool Name Description
run_hyprctl_command Executes arbitrary hyprctl commands.
get_version Retrieves the Hyprland version and build info.
list_monitors Lists all connected monitors and properties.
list_workspaces Lists all active workspaces.
list_clients Lists all windows and their properties.
list_devices Lists all connected input devices.
get_active_window Shows the currently active window details.
list_layers Displays all layers in the compositor.
get_splash Retrieves the current random splash message.
dispatch_command Dispatches a command to Hyprland.
set_keyword Dynamically sets a configuration keyword.
reload_config Forces a reload of the Hyprland config file.
enter_kill_mode Enables kill mode to terminate windows by click.

These tools allow language models to interact with Hyprland's features seamlessly.

💡 Example Usage

User Prompt: "Switch to workspace 2."

MCP Server Action: Executes hyprctl dispatch workspace 2.

User Prompt: "What is the current active window?"

MCP Server Action: Executes hyprctl activewindow -j and returns the details.

🛠️ Development

To run the server locally for development:

mcp dev server.py

Ensure that Hyprland is running and the necessary environment variables are set.

📚 References

📜 License

MIT License © 2025 Stefano Amorelli

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_stefanoamorelli_hyprmcp-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_stefanoamorelli_hyprmcp-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_stefanoamorelli_hyprmcp-0.1.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_stefanoamorelli_hyprmcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 43121b4172211624fadd7cae343b6f54c049852ae27cca8fa7c49f121a96c798
MD5 722e90a0fe4048e66056b44f4d37b405
BLAKE2b-256 bf0aeab7860dc10c593b114575ea622cd6c8d3a2468e64c53000112bf9997bce

See more details on using hashes here.

File details

Details for the file iflow_mcp_stefanoamorelli_hyprmcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_stefanoamorelli_hyprmcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_stefanoamorelli_hyprmcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bacd3310ea4b1999e5763111b8077a7bb29d2ddf0346c4071a694311e979d53a
MD5 9a50b378946cfe42ee953af4e01518d4
BLAKE2b-256 836ee59eb3ca194ab1bf4f4716abd40ff06b6cd7db8ea3124a458fd5ec31b5e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page