name = "spotify-mcp"
main = "src/worker.ts"
compatibility_date = "2025-06-18"
workers_dev = true
compatibility_flags = ["nodejs_compat"]
[vars]
# MCP protocol
MCP_PROTOCOL_VERSION = "2025-11-25"
MCP_TITLE = "Spotify Music"
MCP_VERSION = "1.0.0"
# Auth - MUST be enabled for Spotify OAuth
AUTH_ENABLED = "true"
AUTH_REQUIRE_RS = "true"
AUTH_ALLOW_DIRECT_BEARER = "false"
# Spotify API endpoints
SPOTIFY_ACCOUNTS_URL = "https://accounts.spotify.com"
SPOTIFY_API_URL = "https://api.spotify.com/v1"
# Spotify scopes (playback, playlists, library)
OAUTH_SCOPES = "playlist-read-private playlist-read-collaborative playlist-modify-public playlist-modify-private user-read-playback-state user-modify-playback-state user-read-currently-playing user-library-read user-library-modify"
# Redirect configuration
# Add your client's callback URIs here
OAUTH_REDIRECT_ALLOW_ALL = "false"
OAUTH_REDIRECT_ALLOWLIST = "alice://oauth/callback,https://claude.ai/api/mcp/auth_callback,https://claude.com/api/mcp/auth_callback,https://example.com/mcp/oauth/spotify/callback"
OAUTH_REDIRECT_URI = "https://your-worker.your-subdomain.workers.dev/oauth/callback"
# Environment
NODE_ENV = "production"
# ─────────────────────────────────────────────────────────────────────────────
# SECRETS - Set via wrangler secret put (NEVER in [vars]!)
# ─────────────────────────────────────────────────────────────────────────────
#
# Spotify OAuth (from https://developer.spotify.com/dashboard):
# wrangler secret put SPOTIFY_CLIENT_ID
# wrangler secret put SPOTIFY_CLIENT_SECRET
#
# Token encryption (recommended for production):
# openssl rand -base64 32 | tr -d '=' | tr '+/' '-_'
# wrangler secret put TOKENS_ENC_KEY
#
# ─────────────────────────────────────────────────────────────────────────────
[[kv_namespaces]]
binding = "TOKENS"
# Create with: wrangler kv:namespace create TOKENS
# Replace with your KV namespace ID:
id = "YOUR_KV_NAMESPACE_ID"
# Preview KV namespace (for wrangler dev --remote)
# Create with: wrangler kv:namespace create TOKENS --preview
# [[kv_namespaces]]
# binding = "TOKENS"
# preview_id = "YOUR_PREVIEW_KV_NAMESPACE_ID"