Apple Music MCP server

Integrates with Apple Music API to enable song searching and playback link generation for music discovery applications
Back to servers
Provider
UEDA Akira
Release date
Apr 03, 2025
Language
Rust
Stats
1 star

The Apple Music MCP server provides a convenient interface for interacting with the Apple Music API through the Model Context Protocol. It offers functionality for searching songs and generating playback links, making it easier to integrate Apple Music content into your applications.

Requirements

  • Rust (nightly, because of rmcp)
  • Apple Developer account with Apple Music API access
  • Apple Music API Key (.p8 file)

Installation

You can install the Apple Music MCP server using Cargo:

# Build the project
cargo install --path .

Configuration

The server requires authentication credentials to access the Apple Music API. You'll need to provide these through command-line arguments when starting the server.

Required Credentials

  • Team ID: Your Apple Developer Team ID
  • Key ID: Your Apple Music Key ID
  • Private Key: Path to your Apple Music private key file (.p8)

Running the Server

Start the server with your authentication credentials:

cargo run -- --team-id YOUR_TEAM_ID --key-id YOUR_KEY_ID --private-key-path /path/to/AuthKey.p8

Command-line Options

Options:
--team-id <TEAM_ID>                    Apple Developer Team ID
--key-id <KEY_ID>                      Apple Music Key ID
--private-key-path <PRIVATE_KEY_PATH>  Path to the Apple Music private key file (.p8)
--storefront <STOREFRONT>              Storefront for Apple Music (e.g. us, jp) [default: jp]
-h, --help                             Print help
-V, --version                          Print version

Available API Functions

Search for Songs

The searchSongs function allows you to search for songs by title, album name, or artist name.

Parameters:

  • query: (string) - The search query text

Returns:

  • Array of Song objects containing details such as:
    • Title
    • Artist
    • Album
    • Duration
    • URLs

Generate Playback Links

The generatePlaybackLink function creates deep links for songs or playlists that can be used for playback.

Parameters:

  • Either song_id or playlist_id (one must be provided)

Returns:

  • Object containing the Apple Music URL for the specified content

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later