MCP Spotify Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Provides access to the Spotify Web API, enabling search for tracks, albums, artists, and playlists, as well as accessing artist information, top tracks, related artists, album information, new releases, recommendations, audiobook information, and playlist management.

艺术家镜头

一个强大的模型上下文协议 (MCP) 服务器,提供对 Spotify Web API 的访问。ArtistLens 支持与 Spotify 音乐目录的无缝交互,包括搜索曲目、专辑和艺术家,以及访问特定于艺术家的信息,例如热门曲目和相关艺术家。

当前版本: 0.4.12

安装

通过 Smithery 安装

要通过Smithery自动安装 ArtistLens for Claude Desktop:

npx -y @smithery/cli install @superseoworld/artistlens --client claude

手动安装

您可以全局安装该包:

npm install -g @thomaswawra/artistlens

或者直接用 npx 运行:

npx -y @thomaswawra/artistlens

配置

添加到您的 MCP 设置文件(例如, claude_desktop_config.jsoncline_mcp_settings.json ):

{ "mcpServers": { "spotify": { "command": "npx", "args": ["-y", "@thomaswawra/artistlens"], "env": { "SPOTIFY_CLIENT_ID": "your_client_id", "SPOTIFY_CLIENT_SECRET": "your_client_secret" }, "disabled": false, "autoApprove": [] } } }

您需要提供您的 Spotify API 凭证:

  1. 前往Spotify 开发者仪表板
  2. 创建新应用程序
  3. 获取您的客户端 ID 和客户端密钥
  4. 将它们添加到配置中,如上所示

特征

  • 搜索曲目、专辑、艺术家和播放列表
  • 获取艺术家信息,包括热门曲目和相关艺术家
  • 获取专辑信息和曲目
  • 获取新版本和推荐
  • 获取包含特定市场内容和章节的有声读物信息
  • 注意:有声读物端点可能需要额外的身份验证或特定于市场的访问权限
  • 获取和修改播放列表信息(名称、描述、公开/私人状态)
  • 通过分页支持访问播放列表曲目和项目
  • 支持 Spotify ID 和 URI
  • 使用客户端凭证流进行自动令牌管理
  • 针对所有功能的综合测试套件
  • 组织良好、关注点分离的代码

可用工具

  • get_access_token :获取有效的 Spotify 访问令牌
  • search :搜索曲目、专辑、艺术家或播放列表
  • get_artist :获取艺术家信息
  • get_artist_top_tracks :获取艺术家的热门曲目
  • get_artist_related_artists :获取与给定艺术家相似的艺术家
  • get_artist_albums :获取艺术家的专辑
  • get_album :获取专辑信息
  • get_album_tracks :获取专辑的曲目
  • get_track :获取轨道信息
  • get_available_genres :获取可供推荐的类型列表
  • get_new_releases :获取新专辑发行
  • get_recommendations :根据种子曲目、艺术家或流派获取曲目推荐
  • get_audiobook :使用可选的市场参数获取有声读物信息
  • get_multiple_audiobooks :获取多本有声读物的信息(最多 50 本)
  • get_audiobook_chapters :获取有声读物的章节,支持分页(每个请求 1-50 个章节)
  • get_playlist :获取 Spotify 用户拥有的播放列表
  • get_playlist_tracks :获取播放列表曲目的完整详细信息(每个请求 1-100 个曲目)
  • get_playlist_items :获取播放列表项目的完整详细信息(每个请求 1-100 个项目)
  • modify_playlist :更改播放列表详细信息(名称、描述、公开/私人状态、协作状态)
  • add_tracks_to_playlist :将一个或多个曲目添加到播放列表,位置可选
  • remove_tracks_from_playlist :从播放列表中删除一个或多个曲目,可选位置和快照 ID
  • get_current_user_playlists :获取当前 Spotify 用户拥有或关注的播放列表列表(每个请求 1-50 个播放列表)
  • get_featured_playlists :获取 Spotify 精选播放列表,并提供可选的语言环境和分页支持
  • get_category_playlists :获取带有特定类别标签的 Spotify 播放列表列表

更新

要更新到最新版本:

# If installed globally npm update -g @thomaswawra/artistlens # If using npx, it will automatically use the latest version npx -y @thomaswawra/artistlens

发展

该项目是开源的,可以在 GitHub 上找到,网址为https://github.com/superseoworld/artistlens

项目结构

代码库组织到以下目录中:

  • src/handlers/ :包含不同 Spotify API 端点的处理程序类
  • src/types/ :请求和响应对象的 TypeScript 接口
  • src/utils/ :用于 API 通信的实用函数和类
  • src/__tests__/ :所有功能的 Jest 测试文件

测试

该项目使用 Jest 进行测试。要运行测试,请执行以下操作:

npm test

在开发期间以监视模式运行测试:

npm run test:watch

贡献

贡献:

  1. 分叉存储库
  2. 创建你的功能分支( git checkout -b feature/amazing-feature
  3. 为您的更改添加测试
  4. 提交您的更改( git commit -m 'Add some amazing feature'
  5. 推送到分支( git push origin feature/amazing-feature
  6. 打开拉取请求

执照

MIT 许可证

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

通过 Spotify Web API 实现与 Spotify 音乐目录的交互,支持搜索、艺术家信息检索、播放列表管理和自动令牌处理。

  1. Installation
    1. Installing via Smithery
    2. Manual Installation
  2. Configuration
    1. Features
      1. Available Tools
        1. Updating
          1. Development
            1. Project Structure
            2. Testing
            3. Contributing
          2. License
            ID: mmrvuig6tp