Skip to main content
Glama
alderban107

hyprland-mcp

by alderban107

get_active_window

Retrieve details about the currently focused window in Hyprland desktop environments to enable automated window management and interaction.

Instructions

Get details about the currently focused window.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler for 'get_active_window' queries the Hyprland active window status via hyprctl and returns a formatted string with window details.
    @mcp.tool()
    async def get_active_window() -> str:
        """Get details about the currently focused window."""
        w = await hyprctl.query("activewindow")
        if not w or not w.get("class"):
            return "No window is currently focused."
        return (
            f"Active window: [{w['class']}] \"{w['title']}\"\n"
            f"Size: {w['size'][0]}x{w['size'][1]}, Position: ({w['at'][0]},{w['at'][1]})\n"
            f"Workspace: {w['workspace']['name']}, Monitor: {w['monitor']}\n"
            f"Floating: {w['floating']}, Fullscreen: {w['fullscreen']}"
        )

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