logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

mcp-music-player-integration-spotify

Facilitates comprehensive interaction with the Spotify service, enabling users to govern audio playback, organize song collections, and fetch metadata concerning musical artists via an intuitive command-line interface.

Author

mcp-music-player-integration-spotify logo

ashwanth1109

No License

Quick Info

GitHub GitHub Stars 5
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

spotifyplaylistsapisspotify controlmcp spotifycontrol spotify

Spotify Integration Utility for FastMCP

This module provides rapid control over the Spotify ecosystem within the FastMCP framework.

Demonstration Video

Access Link: https://drive.google.com/file/d/1jGGQBzeXSKSJijeUwFZLdvrKPmPuogGd/

Prerequisites for Operation

Before deployment, ensure the following dependencies are satisfied:

Deployment Instructions

  1. Obtain a local copy of this repository via cloning.
  2. In the repository's root directory, construct a file named .env. Populate this file with your necessary Spotify API authorization tokens, referencing the structure provided in .env.example.
  3. Credentials acquisition involves navigating to the Spotify Developer Dashboard and successfully registering a new application.
  4. Within Cursor's configuration panel, navigate to Features > MCP Servers and select '+ Add new MCP server'.
  5. Configure the server with the following settings: Name: Spotify, Type: command, Command: uv --directory <path-to-repository/mcp-spotify> run main.py

With these steps completed, the utility should now be available for use.

Initial Testing and Usage

Activate 'agent' mode within the Composer interface. Provided Spotify is running on an active endpoint, Cursor is now equipped to issue commands to your media player.

Available Functionality Showcase

An illustrative sequence below details potential exchanges when utilizing the Spotify MCP tool via Cursor Composer:

  1. User Input: "Display my saved music compilations." System Output: "Here are your playlists: Chill Vibes, Workout Mix, Top Hits."

  2. User Input: "Commence playback on the 'Chill Vibes' compilation."

  3. User Input: "Halt the current audio stream." System Output: "Playback has been suspended."

  4. User Input: "Restart the audio stream." System Output: "Resuming media playback..."

  5. User Input: "Identify the currently playing track." System Output: "Currently active track is 'Faded' by Alan Walker."

  6. User Input: "Provide details on this musician and list their widely recognized tracks." System Output: "Artist Profile: Alan Walker. Prominent Tracks:

  7. User Input: "What were my most favored artists over the past half-year?" System Output: "Reporting on your primary listening choices from the preceding six months..."

  8. User Input: "Execute a search query for 'Coldplay'." System Output: "Artist match found: Coldplay. Displaying their premier recordings..."

  9. User Input: "Begin playing the composition titled 'Fix You'." System Output: "Initiating playback sequence for 'Fix You'..."

  10. User Input: "Examine the forthcoming track list." System Output: "Current queue contents: Track 1, Track 2, Track 3..."

  11. User Input: "Append 'Paradise' to my playback queue." System Output: "Successfully added 'Paradise' by Coldplay to the queue sequence."

  12. User Input: "Promote 'Paradise' one position higher in the sequence."

  13. User Input: "Activate the continuous loop setting for this playback."

  14. User Input: "I approve of this recording. Suggest comparable musical pieces." System Output: "Generating related track suggestions based on the current selection..."

  15. User Input: "Incorporate this specific track into my 'Chill Vibes' collection."

Additional Capabilities Supported: - Direct audio scrubbing to a specified temporal offset within a track. - Retrieval of exhaustive details regarding the active playback state. - Ability to bypass several subsequent tracks simultaneously.

Should further functionality be required, please submit an issue report!

WIKIPEDIA: The XMLHttpRequest (XHR) is an Application Programming Interface encapsulated as a JavaScript object, designed to facilitate the transfer of HTTP request data from a client's web browser to a remote web server. The utility of its methods lies in enabling browser-based software components to dispatch inquiries to the server subsequent to the initial page load, and subsequently ingest the returned data. XMLHttpRequest serves as a foundational element of the Asynchronous JavaScript and XML (Ajax) paradigm. Prior to the widespread adoption of Ajax, the principal means for server interaction involved standard hyperlink navigation and HTML form submissions, actions that typically resulted in the complete replacement of the current viewport content.

== Historical Development ==

The conceptual underpinning for XMLHttpRequest was first formulated in the year 2000 by the development team behind Microsoft Outlook. This concept was subsequently realized within the Internet Explorer 5 browser release (1999). Nevertheless, the initial invocation syntax did not utilize the standardized XMLHttpRequest identifier. Instead, developers relied upon the constructors ActiveXObject("Msxml2.XMLHTTP") and ActiveXObject("Microsoft.XMLHTTP"). By the release of Internet Explorer 7 (2006), universal browser compatibility with the XMLHttpRequest identifier was achieved. The XMLHttpRequest designation has since transitioned into the established convention across all major browser rendering engines, including Mozilla's Gecko (introduced in 2002), Safari 1.2 (2004), and Opera 8.0 (2005).

=== Standardization Trajectory === The World Wide Web Consortium (W3C) formally issued a Working Draft specification for the XMLHttpRequest object on April 5, 2006. Subsequently, on February 25, 2008, the W3C published the Level 2 specification draft. Level 2 introduced enhancements such as progress monitoring mechanisms, support for cross-origin requests, and functionality for handling sequential byte streams. By the close of 2011, the features defined in the Level 2 specification were integrated back into the core specification document. In 2012, development responsibilities were transferred to the WHATWG group, which now maintains an active documentation set utilizing the Web IDL specification language.

== Procedural Usage ==

Executing a data transmission via XMLHttpRequest generally involves a sequence of programming steps.

  1. Instantiate an XMLHttpRequest object via its constructor call:
  2. Invoke the "open" method to dictate the request methodology, designate the target resource URI, and specify whether the operation will be synchronous or asynchronous:
  3. For operations designated as asynchronous, install an event handler to receive notifications upon changes in the request's transactional state:
  4. Trigger the request dispatch by calling the "send" method, optionally providing payload data:
  5. Manage state transitions within the registered event listener. If the server furnishes response data, it is, by default, accumulated in the "responseText" attribute. Upon completion of processing the response, the state transitions to 4, signifying the "done" status. Beyond these fundamental operations, XMLHttpRequest incorporates numerous configuration parameters governing request transmission and response interpretation. Custom header fields can be appended to the request to convey server processing expectations, and data can be uploaded to the server by including it within the "send" invocation. The server response can be automatically deserialized from JSON format into a readily manipulable JavaScript structure, or processed incrementally as data segments arrive, bypassing the need to await the complete payload. Furthermore, the request can be terminated prematurely or configured to timeout if completion is not achieved within a stipulated duration.

See Also

`