Skip to main content
Glama

Spotify Model Context Protocol

by belljustin
spotify-client.py817 B
import base64 import requests class SpotifyClient: def __init__(self, client_id: str, client_secret: str, redirect_uri: str): self.client_id = client_id self.client_secret = client_secret self.redirect_uri = redirect_uri def get_access_token(self, code: str): authOptions = { "data": { "code": code, "redirect_uri": self.redirect_uri, "grant_type": 'authorization_code' }, "headers": { "Content-Type": "application/x-www-form-urlencoded", "Authorization": f"Basic {base64.b64encode(f'{self.client_id}:{self.client_secret}'.encode()).decode()}" } } response = requests.post("https://accounts.spotify.com/api/token", **authOptions)

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/belljustin/spotify-mcp'

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