Spotify MCP Server
Provides OAuth-based authentication and playback control for Spotify, including play/pause, track navigation, volume control, device management, and search functionality for artists and songs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Spotify MCP Server play Taylor Swift's Love Story"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Spotify MCP Server
基于Spotify OAuth和MCP协议的Python服务器,提供Spotify音乐控制功能。
功能特性
✅ Spotify OAuth认证
✅ 获取当前播放状态
✅ 播放/暂停控制
✅ 上一首/下一首切换
✅ 音量控制
✅ 播放位置跳转
✅ 设备管理
Related MCP server: MCP Spotify Server
安装
安装依赖:
pip install -e .配置Spotify OAuth凭据:
创建应用并获取
Client ID和Client Secret设置重定向URI为
http://127.0.0.1:8000/callback
设置环境变量:
export SPOTIFY_CLIENT_ID="your_client_id"
export SPOTIFY_CLIENT_SECRET="your_client_secret"
export SPOTIFY_REDIRECT_URI="http://127.0.0.1:8000/callback" # 可选,默认值使用方法
1. 启动MCP服务器
服务器通过stdio通信,通常由MCP客户端(如Claude Desktop)自动启动。
2. 首次认证
调用
spotify_get_auth_url工具获取授权URL在浏览器中访问该URL并完成授权
从回调URL中提取授权码(
code参数)调用
spotify_authenticate工具,传入授权码完成认证
认证信息会保存在 ~/.spotify_mcp_token.json,后续使用会自动刷新token。
3. 使用控制功能
认证成功后,可以使用以下工具:
spotify_get_current_playback- 获取当前播放状态spotify_pause- 暂停播放spotify_next- 下一首spotify_previous- 上一首spotify_set_volume- 设置音量(0-100)spotify_seek- 跳转到指定位置spotify_get_devices- 获取可用设备列表spotify_play_artist- 搜索并播放指定艺术家的top 10 tracks,如 'Taylor Swift的歌曲'spotify_play_song- 根据歌手和歌曲名播放歌曲。例如:播放 Taylor Swift 的 Love Story
MCP客户端配置
在Claude Desktop的配置文件中添加:
{
"mcpServers": {
"spotify-mcp": {
"command": "python",
"args": ["-m", "spotify_mcp"],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id",
"SPOTIFY_CLIENT_SECRET": "your_client_secret",
"SPOTIFY_REDIRECT_URI"="http://127.0.0.1:8000/callback"
}
}
}
}或者使用uv
{
"mcpServers": {
"spotify-mcp": {
"command": "uv",
"args": ["run", "-m", "spotify_mcp"],
"env": {
"SPOTIFY_CLIENT_ID": "your_client_id",
"SPOTIFY_CLIENT_SECRET": "your_client_secret",
"SPOTIFY_REDIRECT_URI"="http://127.0.0.1:8000/callback"
}
}
}
}注意事项
确保Spotify应用已开启并正在播放音乐
某些功能需要Spotify Premium账户
Token会自动刷新,无需手动重新认证
设备ID参数为可选,不指定时使用当前活动设备
许可证
MIT
Available Tools
11 toolsspotify_authenticateA
使用授权码完成Spotify OAuth认证。需要先调用spotify_get_auth_url获取授权URL
Inputs: code (required).
spotify_get_auth_urlA
获取Spotify OAuth授权URL。用户需要访问此URL进行授权,然后将返回的授权码用于spotify_authenticate工具
Inputs: no named parameters.
spotify_get_current_playbackB
获取当前播放状态,包括当前歌曲、播放进度、设备等信息
Inputs: device_id.
spotify_get_devicesA
获取所有可用的Spotify设备列表
Inputs: no named parameters.
spotify_nextB
播放下一首歌曲
Inputs: device_id.
spotify_pauseC
暂停播放
Inputs: device_id.
spotify_play_artistB
搜索并播放指定艺术家的歌曲,如 'Taylor Swift的歌曲'
Inputs: artist (required).
spotify_play_songA
根据歌手和歌曲名播放歌曲。例如:播放 Taylor Swift 的 Love Story
Inputs: song (required), artist (required), device_id.
spotify_previousB
播放上一首歌曲
Inputs: device_id.
spotify_seekB
跳转到指定播放位置
Inputs: position_ms (required), device_id.
spotify_set_volumeA
设置音量,范围0-100
Inputs: volume_percent (required), device_id.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a clear, distinct purpose: auth, playback control (pause, next, previous, seek, volume), device lookup, and specific play actions. play_artist and play_song differ by target, preventing confusion.
All tools follow a consistent snake_case pattern with the 'spotify_' prefix, and verb phrases accurately describe actions. This makes the naming predictable and readable.
11 tools is well-scoped for a Spotify control server, covering essential playback and auth operations without being excessive or sparse.
The toolset covers core playback controls and auth, but lacks search, playlist management, and track/album details. It could be considered incomplete for a full-featured Spotify integration.
Maintenance
Related MCP Connectors
Full Spotify Web API coverage - albums, artists, playlists, player controls, and more.
Spotify MCP server for ChatGPT, Claude and any AI agent: search songs and artists, list playlists, read playlist songs, create playlist, add songs to playlist, remove songs from playlist, set playlist public or private and save to Liked Songs in your own Spotify account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Spotify yourself; Cotlet does not store your password and you need no Spotify API key. About the official Spotify API: Spotify has a full Web API and, since 23 Apr 2026, an official connector for Claude (checked 5 Nov 2026). The API needs an app you register, and in development mode the app owner must have Premium and the app allows 5 users; unlimited users need a registered business with at least 250,000 monthly users. Setup and FAQ: https://cotlet.dev/integrations/spotify-api-mcp-server
Spotify MCP — Web API via client_credentials OAuth
Spotify: Spotify Data API for Millions of songs & podcasts, artists, albums, playlists and more.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables control of Spotify through natural language by searching the catalog, managing playback and devices, controlling playlists, and managing saved songs. Includes OAuth authentication and streamable HTTP transport for remote connectivity.30 npm84MIT
- AlicenseAqualityDmaintenanceEnables interaction with Spotify through LLMs using OAuth2 authentication. Supports music search, playback control, playlist management, and device management through natural language commands.142MIT
- AlicenseAqualityDmaintenanceEnables interaction with Spotify through OAuth 2.0 authentication, supporting search for tracks/artists/albums/playlists, user profile access, and playlist management including creation and adding tracks.6MIT
- AlicenseCqualityDmaintenanceEnables natural language control of Spotify, including search, playback, and device management, with robust error handling and automatic token refresh.325 npmMIT