Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
HS_MCP_TOOLSNoWhich tiers to register. 'all' adds the unsafe tier (hs_eval).safe
HS_MCP_HS_PATHNoAbsolute path to the hs binary. Set this if your install is somewhere unusual.
HS_MCP_DOCS_PATHNoAbsolute path to Hammerspoon's bundled API documentation JSON, used by hs_api_search.
HS_MCP_LOG_LEVELNoVerbosity of the stderr log. Logs never touch stdout, which carries the protocol.info

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
hs_healthA

Verify that Hammerspoon is running and reachable, and report its version. Call this first when any other tool fails, because it distinguishes a setup problem from a tool problem.

hs_api_searchA

Search Hammerspoon's own API documentation for functions, methods, constants, and modules. Returns exact signatures. Use this before writing Lua so calls are correct the first time, rather than discovering a wrong name from a runtime error.

hs_list_windowsA

List every visible window with its id, owning application, title, frame, and screen. Window ids are what hs_focus_window and hs_move_window operate on, so call this first.

hs_focus_windowA

Bring a window to the front, selected by id (exact) or by a substring of its title. The matched window is returned so you can confirm the right one was chosen.

hs_move_windowA

Set the position and/or size of a window by id, in screen pixels. Omitted fields keep their current value. The returned frame is read back after the move settles, so it is the real placement; adjusted=true means macOS or the app put the window somewhere other than requested. Use hs_screens to learn the available coordinate space.

hs_window_layoutA

Snap a window to a named position such as left-half or quarter-top-left, computed from the screen size so no pixel arithmetic is needed. Defaults to the focused window. Positions respect the menu bar and Dock.

hs_list_appsA

List running applications with pid, bundle identifier, window count, and which one is frontmost.

hs_launch_appA

Launch an application by name, or focus it if it is already running. Use the name as it appears in Finder, for example "Safari".

hs_focus_appA

Bring an already-running application to the front. Unlike hs_launch_app this never starts anything, so it fails if the application is not running.

hs_screensA

List connected screens with their coordinate frames. frame excludes the menu bar and Dock, fullFrame includes them. Use these bounds when computing arguments for hs_move_window.

hs_list_spacesA

List macOS Spaces across all screens with their id, type, and which one is current. User desktops also carry a 1-based position, which is the number people mean by "desktop 2" and what the Ctrl+N shortcuts match. Fullscreen app spaces have no position.

hs_goto_spaceA

Switch to another macOS desktop, either by its id from hs_list_spaces or by its 1-based position. The result reports where the switch actually landed: arrived=false with landedOn set means the system did not end up on the requested desktop, which can happen when macOS auto-rearranges Spaces mid-switch. Verified, not assumed.

hs_audio_devicesA

List audio output and input devices, showing which is currently the default plus its volume and mute state. Call this before hs_audio_set_device to learn the exact device names.

hs_audio_set_deviceA

Make an audio device the system default, for example switching output to headphones or a display. Matches the name exactly first, then falls back to a case-insensitive substring, and lists the available devices when nothing matches.

hs_audio_volumeA

Read or change the volume and mute state of the default audio device. Called with no arguments it only reports the current state, so it is safe to use as a query.

hs_brightnessA

Read or change the built-in display brightness, 0 to 100. Called with no arguments it only reports. Most external displays do not support software brightness control and will report an error.

hs_media_controlA

Send a system media key: play or pause, next track, previous track. Works with whichever application currently owns media playback (Music, Spotify, a browser tab), the same as pressing the key on the keyboard.

hs_machine_statusA

One call for the state of the machine: host name and OS version, idle time, battery level and charging state, display brightness and screen count, current wifi network, and default audio device with its volume. Fields are null where the hardware does not provide them.

hs_peripheralsA

List USB devices, cameras (including whether one is currently in use), and mounted volumes with free space. Answers questions like whether an external drive is mounted or whether the webcam is active.

hs_wifiA

Report the wifi radio state, the current network, and scan for available ones. radio="off" means no scan was attempted. scanned=false with the radio on means the scan was blocked or failed, in which case the current network is still reported.

hs_notificationA

Post a real macOS notification. Delivery cannot be verified from here: an active Focus mode silently suppresses or files the banner, so posted=true means handed to Notification Center, not necessarily seen. Use this when the user should see something after stepping away. For a transient on-screen message that ignores Focus modes and leaves no trace, use hs_notify instead.

hs_keep_awakeA

Stop the Mac from sleeping, or let it sleep again. Called with no arguments it reports the current state. Useful before a long build or download.

hs_lock_screenA

Lock the Mac immediately, as if you pressed the lock shortcut. Applications keep running and nothing is closed, so this is safe to do at any time.

hs_list_shortcutsA

List the user's macOS Shortcuts by name. These are automations the user wrote themselves, so they are often the best way to do something specific to this machine.

hs_run_shortcutA

Run one of the user's macOS Shortcuts by name. Input cannot be passed; a shortcut that needs input will run without it. The shortcut runs in the background, so this reports that it started rather than what it produced; a shortcut that fails after starting logs to the console, visible via hs_console_tail. Call hs_list_shortcuts first to get exact names.

hs_ui_inspectA

Read an application's accessibility tree: the buttons, menus, fields, and their labels, with the actions each supports. This is how you find out what is clickable in an app and what it is called. Returns structure and labels only, never the contents of text fields or documents. Each node carries a path you can pass to hs_ui_press.

hs_open_urlA

Open a URL in the default handler for its scheme, or in a specific application by bundle id (for example com.google.Chrome or com.apple.Safari). The result names the application that actually received the URL. Errors when nothing handles the scheme or macOS refuses. Use hs_list_apps to find bundle ids.

hs_default_browserA

Report which application handles http, https, and mailto links, and optionally change the http and https handler. Called with no arguments it only reports. Changing it may make macOS ask the user to confirm.

hs_music_statusA

Report the current track, artist, album, position, and playback state for Spotify and the Music app. A player that is not running is reported as such rather than being launched, so this is safe to call as a plain query.

hs_music_controlA

Play, pause, or skip in Spotify or the Music app specifically. Use this instead of hs_media_control when more than one player could respond to a media key. The reported state is read back after the action settles, so it reflects what the player is now doing. Errors rather than launching the app if it is not already running.

hs_speakA

Say something out loud through the Mac speech synthesiser. Returns as soon as speech starts rather than waiting for it to finish. Calling again interrupts whatever is currently being spoken.

hs_list_voicesA

List the installed speech synthesiser voices with name, language, gender where the system reports it, and the full identifier. Names repeat across languages (fourteen Eddys), so pass the identifier to hs_speak when the name alone is ambiguous.

hs_networkA

Report the primary network interface, its IP addresses and router, the current wifi network, and optionally whether a given host is reachable. Reachability is a routing check, not a ping, so it answers instantly and does not prove the host is up.

hs_caps_lockA

Read or change the caps lock state, including its keyboard light. Called with no arguments it only reports.

hs_settingsA

Store small values that survive Hammerspoon restarts, for remembering things between sessions. Keys are namespaced so this can never read or overwrite the user's own Hammerspoon settings. Values must be JSON-compatible.

hs_console_tailA

Return the most recent lines from the Hammerspoon console. This is where Lua errors and print output from the user configuration appear, so it is the first place to look when a config change misbehaves.

hs_notifyA

Display a transient alert on screen through Hammerspoon. Useful for telling the user something without stealing focus.

hs_reload_configA

Reload ~/.hammerspoon/init.lua. Use after editing the user configuration. The reload is scheduled a moment ahead so this call can return first, and it resets all in-memory state held by the configuration. Speech started by hs_speak is stopped first; a speech callback landing after the reload would crash Hammerspoon.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

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/vukvukovich/hammerspoon-mcp'

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