apple-music

apple-music

Enables control of Apple Music on macOS, including playback, track info, volume, and more.

Category
访问服务器

README

Apple Music MCP Server

A Model Context Protocol (MCP) server that provides tools to control Apple Music via AppleScript on macOS.

Features

This MCP server provides comprehensive control over Apple Music, including:

Playback Control

  • Play, pause, and toggle play/pause
  • Skip to next/previous track
  • Play specific tracks, albums, or playlists
  • Search and play tracks

Player Information

  • Get current track details (name, artist, album, duration, year, genre)
  • Get player state (playing, paused, stopped)
  • Get current volume and position

Player Settings

  • Set volume (0-100)
  • Set track position
  • Enable/disable repeat and shuffle
  • Get repeat and shuffle status

Track Interaction

  • Like/dislike current track
  • Get liked status of current track

Quick Start

For Claude Users

  1. Clone the repository:

    git clone https://github.com/thebarbican19/AppleMusic-MCP.git
    cd AppleMusic-MCP
    
  2. Install dependencies:

    npm install
    
  3. Make the script executable:

    chmod +x index.js
    
  4. Configure Claude Desktop:

    • Open Claude Desktop
    • Go to Settings (gear icon)
    • Navigate to "Model Context Protocol" section
    • Add a new MCP server with:
      • Name: apple-music
      • Command: node
      • Arguments: ["/path/to/your/AppleMusic-MCP/index.js"]
      • Environment: Leave empty
  5. Restart Claude and start using Apple Music commands!

For Other MCP Clients

Add this to your MCP client configuration (e.g., .cursorrules for Cursor):

{
  "mcpServers": {
    "apple-music": {
      "command": "node",
      "args": ["/path/to/your/AppleMusic-MCP/index.js"],
      "env": {}
    }
  }
}

Replace /path/to/your/AppleMusic-MCP/ with the actual path to this directory.

Available Tools

apple_music_play

Resume playback.

apple_music_pause

Pause playback.

apple_music_playpause

Toggle play/pause.

apple_music_next_track

Skip to the next track.

apple_music_previous_track

Skip to the previous track.

apple_music_play_track

Start playback of a track by name and artist.

Parameters:

  • track_name (string, required): The name of the track to play
  • artist_name (string, required): The artist of the track to play

apple_music_play_album

Start playback of an album by name and artist.

Parameters:

  • album_name (string, required): The name of the album to play
  • artist_name (string, required): The artist of the album to play

apple_music_play_playlist

Start playback of a playlist by name.

Parameters:

  • playlist_name (string, required): The name of the playlist to play

apple_music_get_current_track

Get information about the current playing track.

apple_music_get_player_state

Get the current player state (playing, paused, stopped).

apple_music_set_volume

Set the sound output volume.

Parameters:

  • volume (integer, required): Volume level (0-100)

apple_music_get_volume

Get the current volume.

apple_music_set_position

Set the player position within the current track.

Parameters:

  • position (number, required): Position in seconds

apple_music_get_position

Get the player position within the current track.

apple_music_set_repeat

Turn repeat on or off.

Parameters:

  • enabled (boolean, required): Enable or disable repeat

apple_music_get_repeat

Get repeat status.

apple_music_set_shuffle

Turn shuffle on or off.

Parameters:

  • enabled (boolean, required): Enable or disable shuffle

apple_music_get_shuffle

Get shuffle status.

apple_music_like_track

Like the current track.

apple_music_dislike_track

Dislike the current track.

apple_music_get_liked_status

Get the liked status of the current track.

apple_music_search_and_play

Search for a track and play it.

Parameters:

  • query (string, required): Search query for track, artist, or album

Usage Examples

Once configured, you can use these tools in your MCP client. For example, in Cursor you might say:

  • "Play the next track"
  • "What's currently playing?"
  • "Set volume to 50%"
  • "Play the album 'Abbey Road' by The Beatles"
  • "Search for and play 'Bohemian Rhapsody'"

Requirements

  • macOS (required for AppleScript support)
  • Apple Music app installed
  • Node.js (version 14 or higher)

Troubleshooting

  1. Permission Issues: Make sure the script has execute permissions (chmod +x index.js)

  2. Apple Music Not Found: Ensure Apple Music is installed and running on your Mac

  3. AppleScript Errors: Some AppleScript commands may fail if Apple Music is not in the expected state. The server will return error messages for debugging.

  4. Timeout Issues: The server has a 30-second timeout for AppleScript execution. If operations take longer, they will fail.

License

MIT License - feel free to modify and distribute as needed.

Contributing

Feel free to submit issues and enhancement requests!

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选
mcp-server-qdrant

mcp-server-qdrant

这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。

官方
精选
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选