MCP PLAYLIST SERVER
An MCP server that provides intelligent playlist curation tools using Spotify track data and audio feature analysis. It enables AI assistants to create mood-based playlists, find similar songs, analyze audio characteristics, and curate personalized music collections.
README
๐ต MCP PLAYLIST SERVER
A Model Context Protocol (MCP) server that provides intelligent playlist curation tools using Spotify track data and audio feature analysis. This server enables AI assistants to create mood-based playlists, find similar songs, analyze audio characteristics, and curate personalized music collections.
๐ Features
Core MCP Tools
create_mood_playlist: Generate playlists based on emotional states (happy, sad, energetic, calm, party, chill)find_similar_songs: Discover songs with similar audio characteristics using cosine similarity analysisanalyze_song: Get comprehensive audio feature breakdown for any trackcreate_genre_playlist: Build genre-focused playlists with customizable diversity levelsget_dataset_stats: View detailed dataset statistics and insights
Advanced Audio Analysis
The server analyzes multiple sophisticated audio characteristics:
- Energy: Track intensity and power measurement
- Valence: Musical positivity spectrum (happiness to sadness)
- Danceability: Rhythmic suitability for dancing
- Acousticness: Acoustic vs electronic instrumentation balance
- Tempo: Beats per minute analysis
- Speechiness: Spoken word content detection
- Instrumentalness: Vocal vs instrumental content ratio
- Liveness: Live performance detection
- Popularity: Track mainstream appeal metrics
๐๏ธ Architecture
โโโ server/
โ โโโ main.py # FastMCP server implementation
โ โโโ engine.py # Playlist curation engine with ML algorithms
โโโ spotify_songs.csv # Spotify dataset (32K+ songs)
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
๐ Requirements
- Python: 3.10 or higher
- Dataset: Spotify tracks CSV with audio features
- Dependencies: Listed in
requirements.txt
Core Dependencies
fastmcp>=1.2.0- Modern MCP server frameworkpandas>=2.0.0- Data manipulation and analysisnumpy>=1.24.0- Numerical computingscikit-learn>=1.3.0- Machine learning algorithms
๐ ๏ธ Installation
1. Clone Repository
git clone https://github.com/alee2602/MCP-SERVER
2. Environment Setup
# Using Anaconda (recommended)
conda create -n mcp-playlist python=3.11
conda activate mcp-playlist
# Or using venv
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# .venv\Scripts\activate # Windows
3. Install dependencies
pip install -r requirements.txt
๐งช Run the server
python server/main.py
๐ง Usage with MCP Hosts
Claude Desktop Integration
- Add to your
claude_desktop_config.json:
{
"mcpServers": {
"mcp-playlist": {
"command": "python",
"args": ["server/main.py"],
"cwd": "/absolute/path/to/your/project"
}
}
}
-
Restart Claude Desktop <br>
-
Below are examples the assistant understands.
Mood Playlist:
- Create a happy playlist of 30 minutes in the rap genre
- Make a chill playlist with 10 songs (min popularity 60).
Similar Songs:
- Give me 7 songs similar to โPillowtalkโ by ZAYN.
- Find songs like โWorldwideโ by Big Time Rush.
Song analysis:
- Analyze the audio features of โBohemian Rhapsodyโ by Queen.
Genre playlist:
- Create a rock, pop playlist with 12 songs, diversity high
Dataset stats:
- Show me dataset stats
- What are the top genres in this dataset
Other MCP Clients
Configure with:
- Protocol: STDIO
- Command: python server/main.py
- Working Directory: Project root
๐ API Examples
- Create a mood-based playlist
{
"method": "tools/call",
"params": {
"name": "create_mood_playlist",
"arguments": {
"mood": "energetic",
"size": 15,
"genre": "rock",
"min_popularity": 50,
"duration_minutes": 30
}
}
}
- Create Genre Playlist
{
"method": "tools/call",
"params": {
"name": "create_genre_playlist",
"arguments": {
"genres": ["pop", "edm"],
"size": 20,
"diversity": "high"
}
}
}
- Find similar songs
{
"method": "tools/call",
"params": {
"name": "find_similar_songs",
"arguments": {
"song_name": "Blinding Lights",
"artist": "The Weeknd",
"count": 8
}
}
}
- Comprehensive Song Analysis
{
"method": "tools/call",
"params": {
"name": "analyze_song",
"arguments": {
"song_name": "Hotel California",
"artist": "Eagles"
}
}
}
- Get Dataset Statistics
{
"method": "tools/call",
"params": {
"name": "get_dataset_stats",
"arguments": {}
}
}
๐ Troubleshooting
1. "Dataset empty" Error
- Verify
spotify_songs.csvexists in project root - Check file permissions and format
- Ensure required columns are present
2. "Import Error" Messages
pip install --upgrade fastmcp pandas scikit-learn
Debug mode
# Enable verbose logging
python server/main.py --debug
๐ Acknowledgments
- Anthropic MCP Protocol - Protocol specification
- FastMCP Framework - Python MCP implementation
- Spotify Web API - Audio feature reference
- Kaggle Dataset - 30,000 Spotify Songs dataset by JoeBeachCapital
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.