Skip to content

[ethan] Spotify MCP#133

Open
OccultSlolem wants to merge 6 commits into
devfrom
ethan/spotify-mcp
Open

[ethan] Spotify MCP#133
OccultSlolem wants to merge 6 commits into
devfrom
ethan/spotify-mcp

Conversation

@OccultSlolem

@OccultSlolem OccultSlolem commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Adds limited Spotify support to OpenSwarm! This is accomplished by opening Google Chrome on the user's machine and using the Playwright MCP with remote debugging to click all the buttons. The MCP will prevent changes on Spotify's end from breaking this functionality. Since Chrome is launched with the remote debugger flag attached, the user won't have to enable CDP or see a scary popup asking for permission to allow debugging. Also, once the user logs in on this Chrome window, they won't have to log in again. When Chrome is launched by a Python automation, macOS security normally blocks login cookies from being saved - this is worked around by use of the --password-store=basic argument when launching Chrome, which uses a local encryption key. The --restore-last-session arg is also provided just in case.

Features:

  • Search for and play whatever Spotify tracks you want!

Limitations:

  • Currently only works on macOS, and the user must have Google Chrome installed.
    • The internal browser doesn't have the necessary fingerprints to get past Spotify's DRM. Same goes with Chromium.
  • No playlist support just yet.
    • It likely will be able to play off of playlists but that functionality hasn't been tested.
  • It may feel a little slow as rapidly clicking the buttons tends to produce mixed results. Need to do more testing and optimization

Future additions:

  • Support for other browsers and OSes
    • This would primarily be an issue of looking at the system the user is on and what browsers they have installed. Potentially query which one they'd like to use (potential friction point here though).
  • Desktop tunnelling
    • If I were starting the project from scratch this is probably the route I'd go. I'm not super familiar with the ObjC accessibility APIs and stuff but if the user has the Spotify app installed, that's probably the better way to go.
    • This could open the door for control of applications on the user's machine for other contexts too.
  • Playlists, speaker selection, friends, other Spotify features.
    • I've created a good foundation for playlists and Spotify's social media-like features to be implemented just by changing the workflow a bit.
    • Speaker selection could be solveable with the macOS accessibility API - need to do more research here.

@OccultSlolem

Copy link
Copy Markdown
Collaborator Author
Screenshot 2026-07-18 at 11 54 42 PM Screenshot 2026-07-18 at 11 54 58 PM

Messed up the Spotify logo a bit unfortunately but it's still there :)

@OccultSlolem

Copy link
Copy Markdown
Collaborator Author

The new commits address the following:

  • Webkit Compatibility: The thing is now compatible with Safari! This is accomplished using AppleScript, so requires the user to tick a checkbox and give authorization to allow remote javascript events.
  • Connection Icons: At Eric's request, I removed the gray circles from the connection icons. Now they just show the thing that you'e connecting to.
  • Other media playback: The thing can now play playlists, artists, and albums.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant