Run the server once with the `--auth` flag to authenticate with Spotify. This will open a browser window where you authorize the app to access your Spotify account. The access token is cached locally at `.cache` in the project directory for subsequent runs.
```bash
python server.py --auth
```
You should see: `Authentication successful! Token cached.`
### Step 4: Register with Claude Code
Add the MCP server to your Claude Code configuration by editing `~/.claude/settings.json`:
**Note:** Replace the path and fill in the env values with your actual Spotify app credentials. The `env` block is required because Claude Code launches the server as a subprocess from a different working directory where `load_dotenv()` may not find your `.env` file.
Replace `/absolute/path/to/mcp-spotify` with the actual path to your project. To find it, run `pwd` in the project directory: