This project is a custom MCP server that integrates Spotify to generate playlists based on user emotions.
Follow these steps to set up and run the project:
Install uv using Homebrew:
brew install uvClone this repository to a directory of your choice:
git clone https://github.com/dldnlee/custom_spotify_mcp.git custom_spotify_mcp
cd custom_spotify_mcpOpen a terminal in the cloned directory and run:
uv initYou can get the required tokens from Spotify for Developers
SPOTIFY_CLIENT_ID=your-spotify-client-id
SPOTIFY_CLIENT_SECRET=your-spotify-client-secret
SPOTIFY_REDIRECT_URI=http://127.0.0.1:8888/callback (Needs to be identical with the URI saved in Spotify Developer's App Settings)Run
python3 util/spotify_auth.pyor
python util/spotify_auth.pyTo generate the access tokens. Needs to be created every hour
mcp install server.pyIf uv init doesn't work, manually add the required libraries:
uv add "mcp[cli]"
uv add "requests"Ensure you have created a Spotify Developer App and configured:
- Client ID
- Client Secret
- Redirect URI
- These credentials should be securely added in spotify_auth.py.