Skip to main content
Glama

Spotify MCP Server

by gentiku
setup.py•2.34 kB
#!/usr/bin/env python3 """Setup script for Spotify MCP Server.""" import os import sys import subprocess from pathlib import Path def run_command(command, description): """Run a command and handle errors.""" print(f"šŸ”„ {description}...") try: result = subprocess.run(command, shell=True, check=True, capture_output=True, text=True) print(f"āœ… {description} completed") return True except subprocess.CalledProcessError as e: print(f"āŒ {description} failed: {e}") print(f"Error output: {e.stderr}") return False def main(): """Main setup function.""" print("šŸš€ Setting up Spotify MCP Server...") # Check Python version if sys.version_info < (3, 8): print("āŒ Python 3.8 or higher is required") sys.exit(1) print(f"āœ… Python {sys.version_info.major}.{sys.version_info.minor} detected") # Install dependencies if not run_command("pip install -r requirements.txt", "Installing dependencies"): sys.exit(1) # Create .env file if it doesn't exist env_file = Path(".env") if not env_file.exists(): print("šŸ“ Creating .env file...") with open(".env", "w") as f: f.write("""# Spotify API Credentials SPOTIFY_CLIENT_ID=your_spotify_client_id_here SPOTIFY_CLIENT_SECRET=your_spotify_client_secret_here SPOTIFY_REDIRECT_URI=http://localhost:8888/callback # MCP Server Configuration MCP_SERVER_NAME=spotify-mcp-server MCP_SERVER_VERSION=1.0.0 MCP_SERVER_DESCRIPTION=Spotify API integration via MCP # Optional: Cache settings CACHE_TTL=3600 """) print("āœ… .env file created") print("āš ļø Please edit .env file with your Spotify API credentials") else: print("āœ… .env file already exists") # Make scripts executable scripts = ["main.py", "test_connection.py", "setup.py"] for script in scripts: if os.path.exists(script): os.chmod(script, 0o755) print("šŸŽ‰ Setup completed successfully!") print("\nšŸ“‹ Next steps:") print("1. Get Spotify API credentials from https://developer.spotify.com/dashboard") print("2. Edit .env file with your credentials") print("3. Run: python test_connection.py") print("4. Run: python main.py") if __name__ == "__main__": main()

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

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