itunes_pause
Pause Apple Music playback on macOS using MCP commands. This tool integrates with MCP-AppleMusic to control iTunes/Music via AppleScript, enabling precise playback management.
Instructions
Pause playback in Music (iTunes).
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp_applemusic.py:24-28 (handler)The handler function for the 'itunes_pause' tool. It uses AppleScript to pause playback in the Music app (formerly iTunes). Relies on the run_applescript helper.@mcp.tool() def itunes_pause() -> str: """Pause playback in Music (iTunes).""" script = 'tell application "Music" to pause' return run_applescript(script)
- mcp_applemusic.py:5-10 (helper)Shared helper function that executes AppleScript via subprocess.call to osascript. Used by itunes_pause and other tools to interact with Music app.def run_applescript(script: str) -> str: """Execute an AppleScript command via osascript and return its output.""" result = subprocess.run(["osascript", "-e", script], capture_output=True, text=True) if result.returncode != 0: return f"Error: {result.stderr.strip()}" return result.stdout.strip()