spotify-mcpb
Copilot instructions0 starsChanged 14 months agoMITView on GitHub
Project Name: Spotify MCPB Version: 0.2.2 Type: MCPB Bundle (Model Context Protocol Bundle) for Claude Desktop Purpose: Cross-platform Spotify control and playlist management using Spotify Web API Important: This directory is named spotify-mcpb matching the project name. The project was rebranded from spotify-dxt to spotify-mcpb. See BUNDLE.md for details.
- Reads credentials
- Installs packages
- Commits and pushes
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
37 rules. About 0 are common, 26 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈26
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 162
All 16 tool handlers are in this file
- Distinctive: line 164
Follow existing patterns for new tools
- Very specific: line 165
Always validate inputs using validation.js
- Very specific: line 167
CRITICAL: All handler methods MUST call ensureReady() before operations
- Very specific: line 171
Keep package.json in sync with actual usage
- Distinctive: line 172
Only include production dependencies in bundle
- Distinctive: line 173
Test after adding new dependencies
- Distinctive: line 177
Update tool list when adding/removing tools
- Very specific: line 187
Add tool definition in ListToolsRequestSchema handler
- Very specific: line 188
Add case in CallToolRequestSchema switch statement
- Very specific: line 192
Add tool to tools array
- Distinctive: line 195
Add tool to README.md tool list
- Distinctive: line 208
When updating docs, ensure consistency across:
- Distinctive: line 223
Update all version references across documentation
- Distinctive: line 224
Update bundle filename references
- Distinctive: line 225
Update download links and examples
- Distinctive: line 234
Verify all tools work
- Distinctive: line 235
Check documentation is complete
- Distinctive: line 236
Test authentication flow without refresh token
- Distinctive: line 275
Benefit: No more manual OAuth flow, automated token exchange
- Distinctive: line 289
Verify all required fields are present
- Distinctive: line 295
Check all imports are valid
- Very specific: line 298
Verify credentials in .env
- Distinctive: line 299
Check refresh token is valid
- Distinctive: line 300
Ensure proper OAuth scopes
- Very specific: line 307
Use ES modules (import/export)
- Very specific: line 308
Use async/await for promises
- Distinctive: line 314
Use Markdown for all docs
- Distinctive: line 315
Keep line length reasonable
- Distinctive: line 316
Use clear section headers
- Distinctive: line 321
Use conventional commits format
- Distinctive: line 323
Keep commits focused and atomic
- Very specific: line 358
Always specify bundle output name: when running mcpb pack
- Distinctive: line 361
Update all documentation: when making changes
- Very specific: line 362
Validate manifest: after any changes to manifest.json
- Distinctive: line 363
Test locally: before creating distribution bundle
- Distinctive: line 370
If you're new to this project, read in this order:
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Spotify MCPB Project Instructions
Project Overview
Project Name: Spotify MCPB
Version: 0.2.2
Type: MCPB Bundle (Model Context Protocol Bundle) for Claude Desktop
Purpose: Cross-platform Spotify control and playlist management using Spotify Web API
Important: This directory is named spotify-mcpb matching the project name. The project was rebranded from spotify-dxt to spotify-mcpb.
🚨 Critical Project Guidelines
Project Naming
- ✅ Use "Spotify MCPB" or "spotify-mcpb" when referring to this project
- ✅ Repository URL:
github.com/fabioc-aloha/spotify-mcpb - ❌ Do NOT call this project "spotify-dxt" (that's the original macOS project by Kenneth Lien)
- ✅ Credit Original: Always acknowledge Kenneth Lien's spotify-dxt as the original inspiration
Authentication & Setup (Final v0.2.2 - Simplified)
- ✅ All Three Parameters Required: manifest.json now requires client_id, client_secret, and refresh_token
- ✅ Simple Token Generation: Users run
npm run get-tokenscript before installation - ✅ One-Step Setup: Enter all credentials during Claude Desktop installation
- ✅ Use 127.0.0.1: Always use 127.0.0.1 instead of localhost for OAuth redirects
- ✅ No Complex OAuth: Removed automatic OAuth flow from MCP server, use standalone script
Bundle Creation
✅ Directory renamed: The directory is now named spotify-mcpb, so mcpb pack creates correctly named bundles!
# ✅ CORRECT - Simple command now works
mcpb pack
# ✅ ALSO CORRECT - Specify version explicitly
mcpb pack . spotify-mcpb-0.2.2.mcpbSee BUNDLE.md for details.
📚 Essential Documentation Files
Quick Reference
- README.md - Project overview and quick start
- SETUP.md - Spotify API credential setup guide
- LOCAL_TESTING.md - Local development and testing guide
Development
- BUNDLE.md - Bundle creation, installation & distribution
- CONTRIBUTING.md - Contribution guidelines
Distribution
- CHANGELOG.md - Version history
Administrative
- LICENSE.md - MIT License
- SECURITY.md - Security policy
- CODE_OF_CONDUCT.md - Code of conduct
🛠️ Project Structure
spotify-mcpb/
├── server/
│ ├── index.js # Main MCP server with 16 tool handlers
│ ├── spotifyWebController.js # Spotify Web API wrapper
│ ├── playlistController.js # High-level playlist operations
│ ├── logging.js # Structured JSON logging
│ ├── error.js # Error handling with MCP responses
│ └── validation.js # Input validation and sanitization
├── manifest.json # MCPB v0.2 manifest (CRITICAL)
├── package.json # npm dependencies and scripts
├── .env.example # Credential template
├── icon.png # Bundle icon (23.9 KB)
└── [documentation files] # See above🎯 Key Features
16 MCP Tools Available
spotify_get_refresh_token- Interactive OAuth flow (NEW in 0.2.0, FIXED in 0.2.2)spotify_play- Resume playbackspotify_pause- Pause playbackspotify_next_track- Skip to next trackspotify_previous_track- Skip to previous trackspotify_set_volume- Set volume (0-100)spotify_get_current_track- Get currently playing trackspotify_get_playback_state- Get full playback statespotify_search_tracks- Search Spotify catalogspotify_create_playlist- Create new playlistspotify_add_tracks_to_playlist- Add tracks with deduplicationspotify_get_playlist- Get playlist detailsspotify_get_user_playlists- List user's playlistsspotify_get_recommendations- Get track recommendationsspotify_get_audio_features- Get audio features for tracksspotify_analyze_playlist- Analyze playlist statistics
💻 Development Workflow
Initial Setup
# Clone repository
git clone https://github.com/fabioc-aloha/spotify-mcpb.git
cd spotify-mcpb
# Install dependencies
npm install
# Configure credentials
cp .env.example .env
# Edit .env with your Spotify API credentialsTesting Locally
# Run server directly
node server/index.js
# Or use npm script
npm start
# Generate refresh token interactively (NEW in v0.2.2)
npm run get-token
# Generate refresh token manually (fallback method)
npm run manual-tokenLocal Development Tools (NEW v0.2.2)
get-refresh-token.js- Interactive OAuth server on 127.0.0.1:8888manual-token.js- Fallback token generation script- Both tools handle the full OAuth 2.0 flow automatically
- Use 127.0.0.1 instead of localhost for better compatibility
Creating Bundle
# Install MCPB CLI (if not already installed)
npm install -g @anthropic-ai/mcpb
# Validate manifest
mcpb validate manifest.json
# Create bundle with explicit filename
mcpb pack . spotify-mcpb-0.2.2.mcpb
# Verify bundle
ls -lh spotify-mcpb-0.2.2.mcpbMaking Code Changes
Server Code (server/index.js)
- All 16 tool handlers are in this file
- Uses MCP SDK v1.20.1 (updated from v0.6.0 in v0.2.2)
- Follow existing patterns for new tools
- Always validate inputs using
validation.js - Handle errors using
error.js - CRITICAL: All handler methods MUST call
ensureReady()before operations - Authentication Flow: Server starts without refresh token, users get it via interactive tool
Dependencies
- Keep
package.jsonin sync with actual usage - Only include production dependencies in bundle
- Test after adding new dependencies
Manifest (manifest.json)
- MCPB v0.2 format - do NOT change
manifest_version - Update tool list when adding/removing tools
- Validate with
mcpb validate manifest.jsonafter changes
🔧 Common Tasks
Adding a New Tool
- Update
server/index.js:- Add tool definition in
ListToolsRequestSchemahandler - Add case in
CallToolRequestSchemaswitch statement - Implement handler method (e.g.,
handleNewTool())
- Add tool definition in
- Update
manifest.json:- Add tool to
toolsarray
- Add tool to
- Update Documentation:
- Add tool to README.md tool list
- Update CHANGELOG.md
- Update RELEASE_NOTES.md
- Test:
node --check server/index.js mcpb validate manifest.json npm start
Updating Documentation
When updating docs, ensure consistency across:
- Tool counts (currently 16 tools)
- Version numbers (currently 0.2.2)
- Repository URLs (github.com/fabioc-aloha/spotify-mcpb)
- Project name (Spotify MCPB, not spotify-dxt)
Creating a Release
- Update Version:
package.json- version fieldmanifest.json- version fieldserver/index.js- version fieldCHANGELOG.md- add new version section
- Update Documentation:
- Update all version references across documentation
- Update bundle filename references
- Update download links and examples
- Create Bundle:
mcpb pack . spotify-mcpb-{version}.mcpb - Test Bundle:
- Extract and test locally
- Verify all tools work
- Check documentation is complete
- Test authentication flow without refresh token
- Tag and Release:
git tag v{version} git push origin v{version}
🔧 Critical Fixes in v0.2.2
Authentication Flow Issues (RESOLVED)
- Problem: manifest.json required refresh_token, blocking installation
- Solution: Set
required: false, default: ""in manifest.json - Impact: Users can now install without upfront token, get it via Claude
Missing Authentication Checks (RESOLVED)
- Problem: 8 handler methods lacked
ensureReady()calls - Affected Methods:
handleGetRefreshTokenhandleSearchTrackshandleCreatePlaylisthandleAddTracksToPlaylisthandleGetPlaylisthandleGetUserPlaylistshandleGetRecommendationshandleAnalyzePlaylist
- Solution: Added proper authentication validation to all handlers
Network Compatibility (IMPROVED)
- Change: Updated all redirect URIs from localhost to 127.0.0.1
- Reason: Better cross-platform compatibility, especially Windows
- Files Updated: server/index.js, get-refresh-token.js, manual-token.js
Local Development Tools (NEW)
- Added:
get-refresh-token.js- Interactive OAuth server - Added:
manual-token.js- Fallback token generation - Added: npm scripts:
get-token,manual-token - Benefit: No more manual OAuth flow, automated token exchange
🐛 Troubleshooting
Common Issues
- Bundle has wrong name
- Solution: Use
mcpb pack . spotify-mcpb-0.2.2.mcpb - See BUNDLE.md
- Solution: Use
- Manifest validation fails
- Check
manifest_versionis "0.2" - Verify all required fields are present
- Run
mcpb validate manifest.json
- Check
- Node.js errors
- Ensure Node.js >= 18.0.0
- Run
node --check server/index.js - Check all imports are valid
- Spotify API errors
- Verify credentials in
.env - Check refresh token is valid
- Ensure proper OAuth scopes
- Verify credentials in
📝 Code Standards
JavaScript
- Use ES modules (
import/export) - Use
async/awaitfor promises - Always validate inputs
- Handle errors gracefully
- Log important events
Documentation
- Use Markdown for all docs
- Keep line length reasonable
- Use clear section headers
- Include code examples
- Cross-reference related docs
Git Commits
- Use conventional commits format
- Reference issue numbers when applicable
- Keep commits focused and atomic
🔗 Important Links
Repository
- GitHub: https://github.com/fabioc-aloha/spotify-mcpb
- Issues: https://github.com/fabioc-aloha/spotify-mcpb/issues
- Original Project: https://github.com/kenneth-lien/spotify-dxt (macOS version)
External Documentation
- MCPB Spec: https://github.com/anthropics/mcpb
- Spotify Web API: https://developer.spotify.com/documentation/web-api
- MCP SDK: https://github.com/modelcontextprotocol/sdk
Tools
- MCPB CLI:
npm install -g @anthropic-ai/mcpb - Node.js: https://nodejs.org (>= 18.0.0 required)
- Claude Desktop: For testing MCPB bundles
📊 Project Stats
- Total Tools: 16
- Lines of Code: ~16,000+ (with dependencies)
- Bundle Size: 3.0 MB compressed, 10.2 MB unpacked
- Documentation: 64.3 KB across 10 files
- Dependencies: 60 packages (5 direct)
⚠️ Important Reminders
- Always specify bundle output name when running
mcpb pack - Use "spotify-mcpb" not "spotify-dxt" for this project
- Credit Kenneth Lien for the original spotify-dxt inspiration
- Update all documentation when making changes
- Validate manifest after any changes to
manifest.json - Test locally before creating distribution bundle
- Check Node.js syntax with
node --checkbefore bundling
🎓 Learning Resources
If you're new to this project, read in this order:
- README.md - Start here
- SETUP.md - Get credentials
- BUNDLE.md - Understand bundle creation
- LOCAL_TESTING.md - Local development setup
For specific tasks:
- Adding features: See "Adding a New Tool" section above
- Creating releases: See "Creating a Release" section above
- Contributing: See CONTRIBUTING.md
Last Updated: October 20, 2025
Project Version: 0.2.2
Maintainer: Fabio Correa
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

