Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

controlling-spotify控制 Spotify

Agent Skill

controlling-spotify 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

760

周安装

32

GitHub Stars

118

下载量

266
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:controlling-spotify(控制 Spotify)
来源仓库:https://github.com/oaustegard/claude-skills
仓库路径:skills/controlling-spotify
安装命令:
npx skills add https://github.com/oaustegard/claude-skills --skill controlling-spotify
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/oaustegard/claude-skills --skill controlling-spotify

简介

controlling-spotify 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词、任务场景或来源线索快速定位候选结果。

  • 适用于 Spotify 播放控制、音乐搜索与播放列表管理,需用户提供凭证完成初始化。
  • 支持播放/暂停、曲目搜索、专辑管理与库收藏操作。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 可结合来源仓库、安装命令和原始 README 继续核验具体用法。

SKILL.md

Controlling Spotify

Control Spotify playback, search for music, and manage playlists using the Spotify MCP Server with full user account access.

When to Use

Invoke this skill when users request:

  • Playing, pausing, or skipping music on Spotify
  • Searching for songs, albums, artists, or playlists
  • Creating or modifying playlists
  • Viewing currently playing track or playback status
  • Managing their Spotify library (saved tracks, albums)
  • Queuing songs or albums

Prerequisites

CRITICAL: This skill requires user-provided credentials. The user must complete a one-time setup:

One-Time User Setup

  1. Create Spotify Developer Application

- Go to https://developer.spotify.com/dashboard/ - Create an app and note the Client ID and Client Secret - Add redirect URI: http://127.0.0.1:8888/callback

  1. Obtain Refresh Token

- User must run the helper script locally (see references/setup-guide.md) - Script exchanges OAuth code for a long-lived refresh token - Refresh token is saved as credential in skill configuration

  1. Configure Credentials Alternative: Credentials can also be provided via a Project Knowledge file. Ensure the file contains a .env style block with the keys above.

- Add three credentials to this skill: - SPOTIFY_CLIENT_ID: From Spotify Developer Dashboard - SPOTIFY_CLIENT_SECRET: From Spotify Developer Dashboard - SPOTIFY_REFRESH_TOKEN: From helper script output

Without these credentials, the skill cannot function. If credentials are missing, guide the user through the setup process detailed in references/setup-guide.md.

MCP Server Installation

The Spotify MCP Server must be installed in the compute environment. Use the provided installation script which handles cloning, patching, and building the server.

# Run the installation script
bash scripts/install-mcp-server.sh

MCP Server Configuration

Configure the MCP client to connect to the Spotify MCP server. Note the logic to support credentials from Project Knowledge.

from mcp import Client
import asyncio
import re

# 1. Try to get credentials from skill configuration
env_vars = {
    "SPOTIFY_CLIENT_ID": credentials.get("SPOTIFY_CLIENT_ID"),
    "SPOTIFY_CLIENT_SECRET": credentials.get("SPOTIFY_CLIENT_SECRET"),
    "SPOTIFY_REFRESH_TOKEN": credentials.get("SPOTIFY_REFRESH_TOKEN")
}

# 2. If missing, look in Project Knowledge / Context for .env style block
if not all(env_vars.values()):
    # Heuristic: Scan context/files for VAR=VALUE patterns
    # (Pseudo-code: Implement based on available context access)
    pass

# Server configuration
mcp_config = {
    "command": "node",
    "args": ["/home/claude/spotify-mcp-server/build/index.js"],
    "env": env_vars
}

# Initialize client
async def initialize_spotify_mcp():
    client = Client()
    await client.connect_stdio(
        mcp_config["command"],
        mcp_config["args"],
        mcp_config["env"]
    )
    return client

Available Tools

Read Operations

  1. searchSpotify - Search for tracks, albums, artists, or playlists result = await client.call_tool("searchSpotify", {"query": "bohemian rhapsody", "type": "track", "limit": 10})
  2. getNowPlaying - Get currently playing track information result = await client.call_tool("getNowPlaying", {})
  3. getMyPlaylists - List user's playlists result = await client.call_tool("getMyPlaylists", {"limit": 20, "offset": 0})
  4. getPlaylistTracks - Get tracks from a playlist result = await client.call_tool("getPlaylistTracks", {"playlistId": "37i9dQZEVXcJZyENOWUFo7"})
  5. getRecentlyPlayed - Get recently played tracks result = await client.call_tool("getRecentlyPlayed", {"limit": 10})
  6. getUsersSavedTracks - Get user's liked songs result = await client.call_tool("getUsersSavedTracks", {"limit": 50, "offset": 0})

Playback Control

  1. playMusic - Start playing track/album/artist/playlist # Play by URI result = await client.call_tool("playMusic", {"uri": "spotify:track:6rqhFgbbKwnb9MLmUQDhG6"}) # Or by type and ID result = await client.call_tool("playMusic", {"type": "track", "id": "6rqhFgbbKwnb9MLmUQDhG6"})
  2. pausePlayback - Pause current playback result = await client.call_tool("pausePlayback", {})
  3. skipToNext - Skip to next track result = await client.call_tool("skipToNext", {})
  4. skipToPrevious - Skip to previous track result = await client.call_tool("skipToPrevious", {})
  5. addToQueue - Add track/album to playback queue result = await client.call_tool("addToQueue", {"uri": "spotify:track:6rqhFgbbKwnb9MLmUQDhG6"})

Playlist Management

  1. createPlaylist - Create new playlist result = await client.call_tool("createPlaylist", {"name": "My Workout Mix", "description": "High energy tracks", "public": False})
  2. addTracksToPlaylist - Add tracks to existing playlist result = await client.call_tool("addTracksToPlaylist", {"playlistId": "3cEYpjA9oz9GiPac4AsH4n", "trackUris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:6rqhFgbbKwnb9MLmUQDhG6"]})

Album Operations

  1. getAlbums - Get album details result = await client.call_tool("getAlbums", {"albumIds": ["4aawyAB9vmqN3uQ7FjRGTy"]})
  2. getAlbumTracks - Get tracks from album result = await client.call_tool("getAlbumTracks", {"albumId": "4aawyAB9vmqN3uQ7FjRGTy"})
  3. saveOrRemoveAlbumForUser - Save/remove albums result = await client.call_tool("saveOrRemoveAlbumForUser", {"albumIds": ["4aawyAB9vmqN3uQ7FjRGTy"], "action": "save"})

Workflow Examples

Example 1: Play User's Favorite Song

# 1. Search for the song
search_result = await client.call_tool("searchSpotify", {
    "query": "user's favorite song name",
    "type": "track",
    "limit": 1
})

# 2. Extract track URI from results
track_uri = search_result["tracks"][0]["uri"]

# 3. Play the track
await client.call_tool("playMusic", {
    "uri": track_uri
})

Example 2: Create Playlist from Genre

# 1. Search for tracks in genre
search_result = await client.call_tool("searchSpotify", {
    "query": "genre:rock year:2020-2024",
    "type": "track",
    "limit": 20
})

# 2. Create new playlist
playlist_result = await client.call_tool("createPlaylist", {
    "name": "Modern Rock Mix",
    "description": "Recent rock tracks",
    "public": False
})

# 3. Extract track URIs
track_uris = [track["uri"] for track in search_result["tracks"]]

# 4. Add tracks to playlist
await client.call_tool("addTracksToPlaylist", {
    "playlistId": playlist_result["id"],
    "trackUris": track_uris
})

Example 3: Show What's Playing

# Get current playback state
now_playing = await client.call_tool("getNowPlaying", {})

# Format and display
print(f"Now Playing: {now_playing['track']['name']}")
print(f"Artist: {now_playing['track']['artists'][0]['name']}")
print(f"Album: {now_playing['track']['album']['name']}")
print(f"Progress: {now_playing['progress_ms']} / {now_playing['duration_ms']} ms")

Important Notes

Spotify Premium Required

Playback control operations (play, pause, skip, queue) require Spotify Premium. Read operations (search, get playlists, view tracks) work with free accounts.

Active Device Required

For playback commands to work, the user must have an active Spotify session (web player, desktop app, mobile app) with a device available. If no active device, playback commands will fail.

Rate Limits

Spotify API has rate limits (typically 180 requests per minute). For bulk operations, implement appropriate delays or batching.

Token Security

  • Refresh tokens grant full access to user's Spotify account
  • Never log or expose refresh tokens
  • Treat them with the same security as passwords
  • Users can revoke tokens from https://www.spotify.com/account/apps/

URI Format

Spotify uses URIs in the format:

  • Track: spotify:track:ID
  • Album: spotify:album:ID
  • Artist: spotify:artist:ID
  • Playlist: spotify:playlist:ID

Most tools accept either URIs or separate type + id parameters.

Troubleshooting

"Spotify configuration not found"

Cause: Missing environment variables

Solution: Verify credentials are properly configured:

import os
print(os.getenv("SPOTIFY_CLIENT_ID"))  # Should not be None
print(os.getenv("SPOTIFY_CLIENT_SECRET"))  # Should not be None
print(os.getenv("SPOTIFY_REFRESH_TOKEN"))  # Should not be None

"No active device"

Cause: No Spotify client is currently running/active

Solution: Guide user to:

  1. Open Spotify on any device (web, desktop, mobile)
  2. Start playing something (can pause immediately)
  3. Try the playback command again

"Premium required"

Cause: User has Spotify Free account

Solution: Playback control requires Spotify Premium. Only search and read operations available for free accounts.

MCP Server Won't Start

Cause: Missing dependencies or incorrect installation

Solution:

# Re-run installation script
bash scripts/install-mcp-server.sh

Best Practices

  1. Always search before playing - Don't assume URIs, search for content first
  2. Check playback state - Use getNowPlaying to verify device availability
  3. Handle errors gracefully - Provide helpful messages when operations fail
  4. Batch operations - When adding multiple tracks, use single call with array
  5. Respect rate limits - Add delays for bulk operations

References

Security

This skill requires sensitive credentials. Ensure:

  • Credentials are stored securely in skill configuration
  • Never expose credentials in responses to users
  • Never log credentials
  • Users understand they can revoke access anytime

See references/setup-guide.md for detailed security best practices.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.5%
按下载量换算102

Claude

28.95%
按下载量换算77

Cursor

17.51%
按下载量换算47

Gemini CLI

9%
按下载量换算24

安全审计

Gen Agent Trust Hub

可疑

Socket

可疑

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills