Skip to main content
Glama

Spotify MCP

Spotify 的 FastMCP 工具。

演示

链接: https ://drive.google.com/file/d/1jGGQBzeXSKSJijeUwFZLdvrKPmPuogGd/

Related MCP server: Spotify MCP Server

先决条件

安装

  • 克隆此存储库

  • 在存储库的根目录中创建一个.env文件并添加您的 Spotify API 凭据(从.env.example复制过来)

  • 您可以通过前往Spotify 开发者仪表板并创建应用程序来获取您的凭据。

  • 前往“光标设置”>“功能”>“MCP 服务器”>“+ 添加新的 MCP 服务器”

  • 名称:Spotify,类型:命令,命令:uv --directory <path-to-repository/mcp-spotify> run main.py

您现在应该看到该工具已安装。安装的_mcp

尝试一下

  • 以“代理”模式打开Composer ,瞧,您就可以使用光标控制您的 Spotify 播放器了。(确保您已在活动设备上打开了 spotify)

特征

下面是一个示例对话,展示了如何通过 Cursor Composer 与 Spotify MCP 工具进行交互:

  1. 用户: “显示我的播放列表。”
    回复: “这是你的播放列表:Chill Vibes、Workout Mix、Top Hits。”

  2. 用户: “播放我的‘Chill Vibes’播放列表。”

  3. 用户: “暂停歌曲。”
    响应: “播放暂停。”

  4. 用户: “继续播放歌曲。”
    响应: “恢复播放...”

  5. 用户: “这是什么歌?”
    回应: “您正在听艾伦·沃克的《Faded》。”

  6. 用户: “告诉我有关这位艺术家的信息并给我展示一些流行曲目。”
    回复: “艺术家信息:艾伦·沃克。”

  7. 用户: “向我展示过去 6 个月内我最喜欢的艺术家。”
    回复: “这些是你播放次数最多的艺术家……”

  8. 用户: “搜索酷玩乐队。”
    回复: “找到艺术家:酷玩乐队。以下是他们的热门曲目……”

  9. 用户: “播放歌曲‘Fix You’。”
    回应: “开始播放‘Fix You’...”

  10. 用户: “显示我的队列。”
    响应: “当前队列:曲目 1、曲目 2、曲目 3...”

  11. 用户: “将‘天堂’添加到我的队列中。”
    回复: “已将酷玩乐队的《天堂》添加到您的队列中。”

  12. 用户: “将‘天堂’移到队列的上部。”

  13. 用户: “设置为重复播放。”

  14. 用户: “我喜欢这首歌。推荐一些类似的曲目。”
    回复: “以下是根据这首歌提出的一些建议……”

  15. 用户: “将这首曲目添加到我的‘Chill Vibes’播放列表中。”

其他可用功能:

  • 寻找到轨道中的特定位置

  • 查看详细播放状态

  • 一次跳过多个曲目

如果您希望支持更多功能,请随时提出问题!

Available Tools

21 tools
add_to_playlistC
Add tracks to a playlist
Args:
    playlist_id: Spotify playlist ID
    track_ids: List of track IDs to add

Inputs: playlist_id (required), track_ids (required).

add_to_queueC
Add a track to the queue
Args:
    track_id: Spotify track ID to add

Inputs: track_id (required).

get_artist_top_tracksC
Get top tracks for an artist
Args:
    artist_id: Spotify artist ID

Inputs: artist_id (required).

get_current_trackB

Get information about the currently playing track

Inputs: no named parameters.

get_item_infoC
Get detailed information about a Spotify item
Args:
    item_id: Spotify ID
    type: One of 'track', 'album', 'artist', 'playlist'

Inputs: item_id (required), type.

get_my_playlistsC

FastMCP tool to get user playlists using SpotifyClient.

Inputs: no named parameters.

get_playback_stateB

Get current playback information

Inputs: no named parameters.

get_queueB

Get the current queue of tracks

Inputs: no named parameters.

get_recommendationsB
Get Spotify recommendations based on seeds
Args:
    seed_artists: Comma-separated artist IDs
    seed_tracks: Comma-separated track IDs
    seed_genres: Comma-separated genres
    limit: Number of recommendations

Inputs: seed_artists, seed_tracks, seed_genres, limit.

get_top_artistsB
Get user's top artists from Spotify
Args:
    limit: Number of artists (max 50)
    time_range: One of 'short_term' (4 weeks), 'medium_term' (6 months), 'long_term' (all time)

Inputs: limit, time_range.

next_trackA

Skip to next track in queue

Inputs: no named parameters.

pause_playbackB

FastMCP tool to pause playback on spotify.

Inputs: no named parameters.

previous_trackB

Go back to previous track

Inputs: no named parameters.

reorder_queueB
Reorder tracks in queue by moving a track to a different position
Args:
    range_start: Position of track to move
    insert_before: Position to insert the track

Inputs: range_start (required), insert_before (required).

search_spotifyC
Search Spotify for tracks, artists, albums, or playlists.
Args:
    query: Search term
    type: One of 'track', 'artist', 'album', 'playlist'
    limit: Max number of results

Inputs: query (required), type, limit.

seek_positionC
Seek to position in current track
Args:
    position_ms: Position in milliseconds

Inputs: position_ms (required).

set_repeat_modeB
Set repeat mode for playback
Args:
    state: One of 'track', 'context', or 'off'

Inputs: state (required).

skip_tracksC
Skip multiple tracks at once
Args:
    num_skips: Number of tracks to skip (default: 1)

Inputs: num_skips.

start_playbackB

FastMCP tool to resume playback on the currently active Spotify device.

Inputs: no named parameters.

start_playback_trackC
Start playback of a specific track on Spotify
Args:
    track_uri: Spotify URI of the track (e.g. 'spotify:track:1234...')
    device_id: Optional device to play on

Inputs: track_uri (required), device_id.

start_playlist_playbackC
Start playback of a specific playlist
Args:
    playlist_id: Spotify playlist ID
    device_id: Optional device to play on

Inputs: playlist_id (required), device_id.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 21 tools

    Disambiguation4/5

    Most tools have distinct purposes targeting specific Spotify resources and actions, with clear boundaries between playback control, queue management, and content retrieval. However, some overlap exists between 'skip_tracks' and 'next_track'/'previous_track', and 'start_playback' vs 'start_playback_track'/'start_playlist_playback' could cause confusion about which to use for resuming vs starting specific content.

    Naming Consistency4/5

    The server maintains strong consistency with snake_case naming throughout and mostly follows verb_noun patterns (e.g., 'get_current_track', 'add_to_queue', 'search_spotify'). Minor deviations include 'get_item_info' (noun_verb) and some tools using 'playback' while others use 'track'/'playlist' in similar contexts, but the overall pattern remains clear and predictable.

    Tool Count3/5

    With 21 tools, this feels borderline heavy for a music streaming interface. While Spotify's API is feature-rich, the tool set includes some redundancy (e.g., multiple skip/playback variants) that could potentially be consolidated. The count is manageable but approaches the upper limit of what feels well-scoped for this domain.

    Completeness5/5

    The tool surface provides comprehensive coverage of Spotify's core functionality including playback control (play/pause/skip/seek/repeat), queue management, content retrieval (tracks/artists/playlists/recommendations), search capabilities, and user data access. There are no obvious gaps for typical agent workflows, with CRUD-like operations well-represented across the music streaming domain.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Spotify through natural language for music discovery, playback control, library management, and playlist creation. Supports searching for music, controlling playback, managing saved tracks, and getting personalized recommendations based on mood and preferences.
      5
      ISC
    • A
      license
      A
      quality
      D
      maintenance
      MCP server for Spotify that enables playlist building and music discovery through 19 tools, allowing LLM agents to search tracks/artists/albums, manage playlists, control playback, and access personal listening data.
      20
      31 PyPI
      1
      MIT