Vulpes Spotify 控制器
STDIO允许AI助手控制Spotify的MCP服务器
允许AI助手控制Spotify的MCP服务器
A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with Spotify, allowing them to search for and play tracks.
To install Vulpes Spotify Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @ejfox/vulpes-spotify-mcp --client claude
Clone this repository:
git clone https://github.com/yourusername/spotify-mcp.git cd spotify-mcp
Install dependencies:
npm install
Create a .env
file with your Spotify API credentials:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REDIRECT_URI=http://localhost:8888
# Optional: For playback control
SPOTIFY_REFRESH_TOKEN=your_refresh_token
You can get your Client ID and Secret from the Spotify Developer Dashboard.
Generate a refresh token (required for playback control):
There are two ways to get a refresh token:
Option 1: Use the built-in script
npm run get-token
This will start a local server and provide instructions in the terminal.
Option 2: Use the simple script (if option 1 doesn't work)
node src/simple-auth.js
This will give you a URL to open in your browser. After authorizing, you'll be redirected to a URL. Copy that URL back to the terminal, and it will show you a curl command to get the refresh token.
Required scopes (already included in the scripts):
user-read-playback-state
user-modify-playback-state
user-read-currently-playing
playlist-read-private
playlist-read-collaborative
Add the refresh token to your .env
file:
SPOTIFY_REFRESH_TOKEN=your_refresh_token
Build the project:
npm run build
First, ensure Spotify is open and playing on your device
Add this server to your Claude Desktop configuration:
Edit your claude_desktop_config.json
file (typically in ~/Library/Application Support/Claude/
on macOS or %APPDATA%\\Claude\\
on Windows):
{ "mcpServers": { "spotify": { "command": "node", "args": ["/absolute/path/to/vulpes-spotify-mcp/dist/index.js"], "env": { "SPOTIFY_CLIENT_ID": "your_client_id", "SPOTIFY_CLIENT_SECRET": "your_client_secret", "SPOTIFY_REDIRECT_URI": "http://localhost:8888", "SPOTIFY_REFRESH_TOKEN": "your_refresh_token" } } } }
Make sure to replace /absolute/path/to/vulpes-spotify-mcp
with the actual path to your project.
Restart Claude Desktop
You should now see the Spotify tools available when you click on the hammer icon in Claude Desktop
.env
file and Claude Desktop config must matchMIT