itunes.vim
This is MCP server for playing from Apple Music Library
claude mcp add --transport stdio chew-z-itunes.vim bin/mcp-itunes \ --env ITUNES_DB_PATH="Path to the primary iTunes/Apple Music SQLite database (default: ~/Music/iTunes/itunes_library.db)" \ --env ITUNES_SEARCH_LIMIT="Maximum number of search results (default: 15)" \ --env ITUNES_BACKUP_DB_PATH="Path to backup database (default: ~/Music/iTunes/itunes_library_backup.db)"
How to use
This MCP server exposes a set of tools that bridge your Apple Music library with AI-enabled workflows. The 14 tools include library search (search_itunes, search_advanced), playback actions (play_track, now_playing), audio controls (check_eq, set_eq, get_output_device, set_output_device), radio station access (search_stations, play_stream), and playlist/library exploration (list_playlists, get_playlist_tracks, refresh_library). You can query the server via MCP transport to perform fast FTS5-backed searches, control playback by track ID or playlist context, adjust EQ and output devices, and stream radio stations or streams. The tools are designed to work with LLM prompts and model-driven prompts, enabling AI-assisted music curation, context-aware playback, and dynamic audio routing. To begin, start the MCP server binary and use the MCP client tooling or your own integration to call the available tools in your automation pipeline.
How to install
Prerequisites:
- macOS (required for Apple Music integration)
- Go 1.24.4+ and a Go-enabled environment to build the binaries (or use prebuilt binaries if available)
- Apple Music app installed and configured
Install steps:
-
Clone the repository and navigate to it git clone <repository-url> cd itunes
-
Build the CLI, MCP server, and migration tool (bin outputs will be placed in bin/) go build -o bin/itunes itunes.go go build -o bin/mcp-itunes ./mcp-server go build -o bin/itunes-migrate ./cmd/migrate
-
Run the MCP server (example): ./bin/mcp-itunes
-
Verify binaries exist in bin/:
- bin/itunes (CLI tool)
- bin/mcp-itunes (MCP server)
- bin/itunes-migrate (migration tool)
Optional: set up aliases or integration scripts to start both the MCP server and the CLI in your environment.
Additional notes
Environment variables can significantly alter behavior:
- ITUNES_DB_PATH controls the primary database location. Ensure the path exists and is writable by the process.
- ITUNES_BACKUP_DB_PATH defines where backups are stored for library refreshes.
- ITUNES_SEARCH_LIMIT caps the number of results returned by search operations; adjust based on UI needs or AI prompt requirements. If you encounter slow startup or library refresh times, ensure macOS permissions allow AppleScript/JXA automation and that the Apple Music app is accessible by the system user. For debugging, run the MCP server in verbose mode if supported by your build, and consult the logs to diagnose tool availability or transport issues. No external dependencies beyond standard Go tooling are required for the MCP server when built from source.
Related MCP Servers
melrose
interactive programming of melodies, producing MIDI
sandbox
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
github-brain
An experimental GitHub MCP server with local database.
mcp-tts
MCP Server for Text to Speech
tasker
An MCP server for Android's Tasker automation app.
rod
Model Context Protocol Server of Rod