Spotify Integration for AI Agents

Securely connect your AI agents and chatbots (Claude, ChatGPT, Cursor, etc) with Spotify MCP or direct API to search tracks, manage playlists, control playback, and discover new music through natural language.
Spotify Logo
Gradient Top
Gradient Middle
Gradient Bottom
divider

Supported Tools and Triggers

Tools
Triggers
Add items to playlistAdd one or more items to a user's playlist.
Add item to playback queueAdd an item to the end of the user's current playback queue.
Change playlist detailsChange a playlist's name and public/private state.
Check if user follows artists or usersCheck to see if the current user is following one or more artists or other spotify users.
Check if users follow playlistCheck to see if one or more spotify users are following a specified playlist.
Check user s saved albumsCheck if one or more albums is already saved in the current spotify user's 'your music' library.
Check user s saved audiobooksCheck if one or more audiobooks are already saved in the current spotify user's library.
Check user s saved episodesThis spotify api endpoint (in beta) checks if episodes are saved in a user's library.
Check user s saved showsCheck if one or more shows is already saved in the current spotify user's library.
Check user s saved tracksCheck if one or more tracks is already saved in the current spotify user's 'your music' library.
Create playlistCreate a playlist for a spotify user.
Follow artists or usersAdd the current user as a follower of one or more artists or other spotify users.
Follow playlistAdd the current user as a follower of a playlist.
Get a chapterGet spotify catalog information for a single audiobook chapter.
Get albumGet spotify catalog information for a single album.
Get album tracksGet spotify catalog information about an album’s tracks.
Get an audiobookGet spotify catalog information for a single audiobook.
Get artistGet spotify catalog information for a single artist identified by their unique spotify id.
Get artist s albumsGet spotify catalog information about an artist's albums.
Get artist s related artistsGet spotify catalog information about artists similar to a given artist.
Get artist s top tracksGet spotify catalog information about an artist's top tracks by country.
Get audiobook chaptersGet spotify catalog information about an audiobook's chapters.
Get available devicesGet information about a user’s available spotify connect devices.
Get available genre seedsRetrieve a list of available genres seed parameter values for [recommendations](/documentation/web-api/reference/get-recommendations).
Get available marketsGet the list of markets where spotify is available.
Get category s playlistsGet a list of spotify playlists tagged with a particular category.
Get currently playing trackGet the object currently being played on the user's spotify account.
Get current user s playlistsGet a list of the playlists owned or followed by the current spotify user.
Get current user s profileGet detailed profile information about the current user (including the current user's username).
Get episodeGet spotify catalog information for a single episode identified by its unique spotify id.
Get featured playlistsGet a list of spotify featured playlists (shown, for example, on a spotify player's 'browse' tab).
Get followed artistsGet the current user's followed artists.
Get new releasesGet a list of new album releases featured in spotify (shown, for example, on a spotify player’s “browse” tab).
Get playback stateGet information about the user’s current playback state, including track or episode, progress, and active device.
Get playlistGet a playlist owned by a spotify user.
Get playlist cover imageGet the current image associated with a specific playlist.
Get playlist itemsGet full details of the items of a playlist owned by a spotify user.
Get recently played tracksGet tracks from the current user's recently played tracks.
Get recommendationsRecommendations are based on seed entity data, matched with similar artists and tracks.
Get several albumsGet spotify catalog information for multiple albums identified by their spotify ids.
Get several artistsGet spotify catalog information for several artists based on their spotify ids.
Get several audiobooksGet spotify catalog information for several audiobooks identified by their spotify ids.
Get several browse categoriesGet a list of categories used to tag items in spotify (on, for example, the spotify player’s “browse” tab).
Get several chaptersGet spotify catalog information for several audiobook chapters identified by their spotify ids.
Get several episodesGet spotify catalog information for several episodes based on their spotify ids.
Get several showsGet spotify catalog information for several shows based on their spotify ids.
Get several tracksGet spotify catalog information for multiple tracks based on their spotify ids.
Get several tracks audio featuresGet audio features for multiple tracks based on their spotify ids.
Get showGet spotify catalog information for a single show identified by its unique spotify id.
Get show episodesGet spotify catalog information about an show’s episodes.
Get single browse categoryGet a single category used to tag items in spotify (on, for example, the spotify player’s “browse” tab).
Get the user s queueGet the list of objects that make up the user's queue.
Get trackGet spotify catalog information for a single track identified by its unique spotify id.
Get track s audio analysisGet a low-level audio analysis for a track in the spotify catalog.
Get track s audio featuresGet audio feature information for a single track identified by its unique spotify id.
Get user s playlistsGet a list of the playlists owned or followed by a spotify user.
Get user s profileGet public profile information about a spotify user.
Get user s saved albumsGet a list of the albums saved in the current spotify user's 'your music' library.
Get user s saved audiobooksGet a list of the audiobooks saved in the current spotify user's 'your music' library.
Get user s saved episodesThis api endpoint, currently in beta, allows retrieving episodes saved in a spotify user's library.
Get user s saved showsGet a list of shows saved in the current spotify user's library.
Get user s saved tracksGet a list of the songs saved in the current spotify user's 'your music' library.
Get user s top artistsGet the current user's top artists based on calculated affinity.
Get user s top tracksGet the current user's top tracks based on calculated affinity.
Pause playbackPause playback on the user's account.
Remove playlist itemsRemove one or more items from a user's playlist.
Remove users saved albumsRemove one or more albums from the current user's 'your music' library.
Remove user s saved audiobooksRemove one or more audiobooks from the spotify user's library.
Remove user s saved episodesThis api endpoint, currently in beta, allows for the removal of episodes from a user's library and may change without notice.
Remove user s saved showsDelete one or more shows from current spotify user's library.
Remove user s saved tracksRemove one or more tracks from the current user's 'your music' library.
Save albums for current userSave one or more albums to the current user's 'your music' library.
Save audiobooks for current userSave one or more audiobooks to the current spotify user's library.
Save episodes for current userThis api endpoint, currently in beta, allows saving episodes to a user's library.
Save shows for current userSave one or more shows to current spotify user's library.
Save tracks for current userSave one or more tracks to the current user's 'your music' library.
Search for itemGet spotify catalog information about albums, artists, playlists, tracks, shows, episodes or audiobooks that match a keyword string.
Seek to positionSeeks to the given position in the user’s currently playing track.
Set playback volumeSet the volume for the user’s current playback device.
Set repeat modeSet the repeat mode for the user's playback.
Skip to nextSkips to next track in the user’s queue.
Skip to previousSkips to previous track in the user’s queue.
Start resume playbackStart a new context or resume current playback on the user's active device.
Toggle playback shuffleToggle shuffle on or off for user’s playback.
Transfer playbackTransfer playback to a new device and optionally begin playback.
Unfollow artists or usersRemove the current user as a follower of one or more artists or other spotify users.
Unfollow playlistRemove the current user as a follower of a playlist.
Update playlist itemsTo modify a playlist, use rearrange (with `range start`, `insert before`, `range length`, `snapshot id`) or replace items (`uris` in body/query).

Why Use Composio?

AI Native Spotify Integration

  • Supports both Spotify MCP and direct API based integrations
  • Structured, LLM-friendly schemas for reliable tool execution
  • Rich coverage for searching, playing, and managing your Spotify music and podcasts

Managed Auth

  • Built-in OAuth handling with automatic token refresh and rotation
  • Central place to manage, scope, and revoke Spotify access
  • Per user and per environment credentials instead of hard-coded keys

Agent Optimized Design

  • Tools are tuned using real error and success rates to improve reliability over time
  • Comprehensive execution logs so you always know what ran, when, and on whose behalf

Enterprise Grade Security

  • Fine-grained RBAC so you control which agents and users can access Spotify
  • Scoped, least privilege access to Spotify resources
  • Full audit trail of agent actions to support review and compliance

Connect Spotify MCP Tool with your Agent

Python
TypeScript

Install Composio

python
pip install composio claude-agent-sdk
Install the Composio SDK and Claude Agent SDK

Create Tool Router Session

python
from composio import Composio
from claude_agent_sdk import ClaudeSDKClient, ClaudeAgentOptions

composio = Composio(api_key='your-composio-api-key')
session = composio.create(user_id='your-user-id')
url = session.mcp.url
Initialize the Composio client and create a Tool Router session

Connect to AI Agent

python
import asyncio

options = ClaudeAgentOptions(
    permission_mode='bypassPermissions',
    mcp_servers={
        'tool_router': {
            'type': 'http',
            'url': url,
            'headers': {
                'x-api-key': 'your-composio-api-key'
            }
        }
    },
    system_prompt='You are a helpful assistant with access to Spotify tools.',
    max_turns=10
)

async def main():
    async with ClaudeSDKClient(options=options) as client:
        await client.query('Add these tracks to my playlist called Chill Vibes')
        async for message in client.receive_response():
            if hasattr(message, 'content'):
                for block in message.content:
                    if hasattr(block, 'text'):
                        print(block.text)

asyncio.run(main())
Use the MCP server with your AI agent

Connect Spotify API Tool with your Agent

Python
TypeScript

Install Composio

python
pip install composio_openai
Install the Composio SDK

Initialize Composio and Create Tool Router Session

python
from openai import OpenAI
from composio import Composio
from composio_openai import OpenAIResponsesProvider

composio = Composio(provider=OpenAIResponsesProvider())
openai = OpenAI()
session = composio.create(user_id='your-user-id')
Import and initialize Composio client, then create a Tool Router session

Execute Spotify Tools via Tool Router with Your Agent

python
tools = session.tools
response = openai.responses.create(
  model='gpt-4.1',
  tools=tools,
  input=[{
    'role': 'user',
    'content': 'Add my top tracks to a new playlist called Summer Vibes'
  }]
)
result = composio.provider.handle_tool_calls(
  response=response,
  user_id='your-user-id'
)
print(result)
Get tools from Tool Router session and execute Spotify actions with your Agent

Use Spotify with any AI Agent Framework

Choose a Framework you want to connect Spotify with

OpenAI Agents SDK

OpenAI Agents SDK

Use Spotify MCP with OpenAI Agents SDK

Claude Agents SDK

Claude Agents SDK

Use Spotify MCP with Claude Agents SDK

Google ADK

Google ADK

Use Spotify MCP with Google ADK

Langchain

Langchain

Use Spotify MCP with Langchain

AI SDK

AI SDK

Use Spotify MCP with AI SDK

Mastra AI

Mastra AI

Use Spotify MCP with Mastra AI

LlamaIndex

LlamaIndex

Use Spotify MCP with LlamaIndex

CrewAI

CrewAI

Use Spotify MCP with CrewAI

Pydantic AI

Pydantic AI

Use Spotify MCP with Pydantic AI

Autogen

Autogen

Use Spotify MCP with Autogen

Frequently Asked Questions

Do I need my own developer credentials to use Spotify with Composio?

Yes, Spotify requires you to configure your own OAuth credentials. Once set up, Composio handles token storage, refresh, and lifecycle management for you.

Can I use multiple toolkits together?

Yes! Composio's Tool Router enables agents to use multiple toolkits. Learn more.

Is Composio secure?

Composio is SOC 2 and ISO 27001 compliant with all data encrypted in transit and at rest. Learn more.

What if the API changes?

Composio maintains and updates all toolkit integrations automatically, so your agents always work with the latest API versions.

Used by agents from

Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
ASU
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.