Skip to main content
Glama

Spotify Playlist MCP Server

by kylestratis
.env.example3.67 kB
# Spotify MCP Server Configuration # Copy this file to .env and fill in your values # ============================================ # SPOTIFY API CREDENTIALS # ============================================ # Your Spotify Access Token # This token is used to authenticate all requests to the Spotify Web API SPOTIFY_ACCESS_TOKEN=your_access_token_here # ============================================ # HOW TO GET YOUR SPOTIFY CREDENTIALS # ============================================ # # 1. Go to the Spotify Developer Dashboard: # https://developer.spotify.com/dashboard # # 2. Log in with your Spotify account (or create one if you don't have it) # # 3. Click "Create App" and fill in the required information: # - App Name: Choose any name (e.g., "My MCP Playlist Server") # - App Description: Describe your use case # - Redirect URI: http://localhost:8888/callback (for local development) # - Check the Developer Terms of Service agreement # - Click "Save" # # 4. After creating the app, you'll see your Client ID and Client Secret. # Click "Settings" to view them. # # 5. Generate an Access Token: # # METHOD A: Using the Spotify Web Console (Quick Testing) # - Go to: https://developer.spotify.com/console/ # - Navigate to any endpoint (e.g., "Get Current User's Profile") # - Click "Get Token" and select required scopes: # * playlist-modify-public # * playlist-modify-private # * playlist-read-private # - Copy the generated token # - Note: Console tokens expire after 1 hour # # METHOD B: Authorization Code Flow (Recommended for Production) # - Use the Authorization Code with PKCE flow # - Required scopes: # * playlist-modify-public - Modify public playlists # * playlist-modify-private - Modify private playlists # * playlist-read-private - Read private playlists # * user-read-private - Read user profile data # - Follow the OAuth flow guide: # https://developer.spotify.com/documentation/web-api/tutorials/code-pkce-flow # # METHOD C: Using spotipy library (Python Helper) # - Install: pip install spotipy # - Use the following script to get a token: # # import spotipy # from spotipy.oauth2 import SpotifyOAuth # # scope = "playlist-modify-public playlist-modify-private playlist-read-private user-read-private" # sp = spotipy.Spotify(auth_manager=SpotifyOAuth( # client_id="YOUR_CLIENT_ID", # client_secret="YOUR_CLIENT_SECRET", # redirect_uri="http://localhost:8888/callback", # scope=scope # )) # # # After authenticating in browser, get the token: # token_info = sp.auth_manager.get_access_token() # print(token_info['access_token']) # # 6. Copy your access token and paste it above in SPOTIFY_ACCESS_TOKEN # # ============================================ # IMPORTANT NOTES # ============================================ # # - Access tokens expire after 1 hour. You'll need to refresh them regularly # in production environments. # - Never commit your .env file to version control (it's in .gitignore) # - For production use, implement proper token refresh logic using refresh tokens # - Keep your Client Secret secure and never expose it in client-side code # # ============================================ # REQUIRED SCOPES # ============================================ # # This MCP server requires the following Spotify API scopes: # - playlist-modify-public: Create and modify public playlists # - playlist-modify-private: Create and modify private playlists # - playlist-read-private: Read private playlists # - user-read-private: Read user profile information #

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kylestratis/spotify-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server