itunes_next
Skip to the next track in Apple Music playback on macOS using MCP commands from the MCP-AppleMusic server.
Instructions
Skip to the next track.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- mcp_applemusic.py:31-35 (handler)The handler function for the 'itunes_next' tool. It uses AppleScript to tell the Music app to skip to the next track, via the run_applescript helper.@mcp.tool() def itunes_next() -> str: """Skip to the next track.""" script = 'tell application "Music" to next track' return run_applescript(script)
- mcp_applemusic.py:5-10 (helper)Supporting helper function used by 'itunes_next' (and other tools) to execute AppleScript commands.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()
- mcp_applemusic.py:31-31 (registration)The @mcp.tool() decorator registers the 'itunes_next' function as an MCP tool.@mcp.tool()