
MCP-Server
Il s'agit d'une implémentation de serveur de protocole de contexte de modèle (MCP) qui permet aux assistants AI d'interagir avec l'API de Spotify.
1
Github Watches
0
Github Forks
0
Github Stars
Spotify MCP Server (Express.js)
This is a Model Context Protocol (MCP) server implementation that allows AI assistants to interact with Spotify's API. The server provides endpoints for searching tracks, getting artist information, and managing playlists.
Setup
- Create a Spotify Developer account and create a new application at Spotify Developer Dashboard.
- Get your Client ID and Client Secret from your Spotify application.
- Create a
.env
file in the root directory with the following content:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REDIRECT_URI=http://localhost:3000/callback
- Install dependencies:
npm install
- Run the server:
npm start
Available Endpoints
The server implements the following MCP endpoints:
-
POST
/mcp/search
- Search for tracks, artists, or albums. -
GET
/mcp/artist/{artistId}
- Get detailed information about an artist. -
GET
/mcp/track/{trackId}
- Get detailed information about a track. -
GET
/mcp/playlist/{playlistId}
- Get playlist information. -
GET
/mcp/me/top-tracks
- Get user's top tracks (requires authentication). -
GET
/mcp/me/playlists
- Get user's playlists (requires authentication). -
GET
/mcp/me/tracks
- Get user's saved tracks (requires authentication). -
GET
/mcp/auth/login
- Generate a Spotify login URL for user authentication. -
GET
/callback
- Handle Spotify OAuth callback and exchange authorization code for an access token. -
POST
/mcp/auth/refresh
- Refresh a user's access token.
Example Usage
Here's an example of how an AI assistant can interact with the server:
// Search for a track
const searchResponse = await fetch('http://localhost:3000/mcp/search', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
query: 'Bohemian Rhapsody',
type: 'track'
})
});
const searchData = await searchResponse.json();
// Get artist information
const artistResponse = await fetch('http://localhost:3000/mcp/artist/1dfeR4HaWDbWqJHLk5g1d1');
const artistData = await artistResponse.json();
MCP Protocol Implementation
This server implements the Model Context Protocol, allowing AI assistants to:
- Authenticate with Spotify.
- Search for music content.
- Retrieve detailed information about artists, tracks, and playlists.
- Access personalized user data (with proper authentication).
Security Note
Make sure to keep your .env
file secure and never commit it to version control. The server uses environment variables to manage sensitive credentials.
相关推荐
I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.
I find academic articles and books for research and literature reviews.
Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.
Confidential guide on numerology and astrology, based of GG33 Public information
Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.
Advanced software engineer GPT that excels through nailing the basics.
Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.
Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.
L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.
Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX
Plateforme d'automatisation de workflow à code équitable avec des capacités d'IA natives. Combinez le bâtiment visuel avec du code personnalisé, de l'auto-hôte ou du cloud, 400+ intégrations.
🧑🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.
Une liste organisée des serveurs de protocole de contexte de modèle (MCP)
Reviews

user_SXI4lUxE
MCP-server by addy07s is an outstanding tool for centralized server management. Its seamless integration and robust features make it indispensable for administrators. The GitHub repository is well-documented and easy to navigate. Highly recommended for anyone looking for a reliable server management solution!