MCP PLAYLIST SERVER

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.

Category
访问服务器

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 analysis
  • analyze_song: Get comprehensive audio feature breakdown for any track
  • create_genre_playlist: Build genre-focused playlists with customizable diversity levels
  • get_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 framework
  • pandas>=2.0.0 - Data manipulation and analysis
  • numpy>=1.24.0 - Numerical computing
  • scikit-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

  1. Add to your claude_desktop_config.json:
{
  "mcpServers": {
    "mcp-playlist": {
      "command": "python",
      "args": ["server/main.py"],
      "cwd": "/absolute/path/to/your/project"
    }
  }
}
  1. Restart Claude Desktop <br>

  2. 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

  1. 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
    }
  }
}
  1. Create Genre Playlist
{
  "method": "tools/call",
  "params": {
    "name": "create_genre_playlist",
    "arguments": {
      "genres": ["pop", "edm"],
      "size": 20,
      "diversity": "high"
    }
  }
}
  1. Find similar songs
{
  "method": "tools/call",
  "params": {
    "name": "find_similar_songs",
    "arguments": {
      "song_name": "Blinding Lights",
      "artist": "The Weeknd",
      "count": 8
    }
  }
}
  1. Comprehensive Song Analysis
{
  "method": "tools/call",
  "params": {
    "name": "analyze_song",
    "arguments": {
      "song_name": "Hotel California",
      "artist": "Eagles"
    }
  }
}
  1. Get Dataset Statistics
{
  "method": "tools/call",
  "params": {
    "name": "get_dataset_stats",
    "arguments": {}
  }
}

🔍 Troubleshooting

1. "Dataset empty" Error

  • Verify spotify_songs.csv exists 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选