Skip to main content
Glama
alderban107

hyprland-mcp

by alderban107

close_window

Close windows in Hyprland desktop environments. Specify a target window or close the active window directly. Sends WM_CLOSE signal, allowing applications to show save dialogs when needed.

Instructions

Close a window (sends WM_CLOSE — apps can show save dialogs).

Args: target: Window selector (e.g. "class:firefox"). If omitted, closes the active window.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetNo

Implementation Reference

  • The `close_window` function is defined here as an MCP tool, which calls `hyprctl.dispatch("closewindow", target or "")` to interface with the Hyprland compositor.
    @mcp.tool()
    async def close_window(target: str | None = None) -> str:
        """Close a window (sends WM_CLOSE — apps can show save dialogs).
    
        Args:
            target: Window selector (e.g. "class:firefox"). If omitted, closes the active window.
        """
        await hyprctl.dispatch("closewindow", target or "")
        return f"Closed window{f' matching {target!r}' if target else ' (active)'}"

Latest Blog Posts

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/alderban107/hyprland-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server