Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["1283"],{70015(e,s,n){n.r(s),n.d(s,{metadata:()=>r,default:()=>a,frontMatter:()=>l,contentTitle:()=>c,toc:()=>d,assets:()=>o});var r=JSON.parse('{"id":"integrations/spotify","title":"Spotify Integration","description":"Mercury connects to your Spotify account natively \u2014 control playback, search music, manage playlists, and DJ on your devices through natural conversation. No browser tabs, no app switching. Just say \\"play some chill music\\" and Mercury handles the rest.","source":"@site/docs/integrations/spotify.mdx","sourceDirName":"integrations","slug":"/integrations/spotify","permalink":"/docs/integrations/spotify","draft":false,"unlisted":false,"editUrl":"https://github.com/cosmicstack-labs/mercury-agent/tree/main/website/docs/integrations/spotify.mdx","tags":[],"version":"current","frontMatter":{"id":"spotify","title":"Spotify Integration"},"sidebar":"docsSidebar","previous":{"title":"Optimus","permalink":"/docs/integrations/optimus"},"next":{"title":"MCP Servers","permalink":"/docs/integrations/mcp"}}'),i=n(74848),t=n(28453);let l={id:"spotify",title:"Spotify Integration"},c,o={},d=[{value:"Setup",id:"setup",level:2},{value:"Step 1: Create a Spotify Developer App",id:"step-1-create-a-spotify-developer-app",level:3},{value:"Step 2: Configure Mercury",id:"step-2-configure-mercury",level:3},{value:"Step 3: Connect Your Spotify Account",id:"step-3-connect-your-spotify-account",level:3},{value:"Commands",id:"commands",level:2},{value:"Spotify Tools",id:"spotify-tools",level:2},{value:"Read-only (works on free accounts)",id:"read-only-works-on-free-accounts",level:3},{value:"Playback control (requires Spotify Premium)",id:"playback-control-requires-spotify-premium",level:3},{value:"Using It",id:"using-it",level:2},{value:"Interactive Player (CLI)",id:"interactive-player-cli",level:2},{value:"DJ Mode",id:"dj-mode",level:2},{value:"Player shortcuts",id:"player-shortcuts",level:3},{value:"Optional inline album art",id:"optional-inline-album-art",level:3},{value:"Managing Devices",id:"managing-devices",level:2},{value:"Token Management",id:"token-management",level:2},{value:"Disconnecting",id:"disconnecting",level:3},{value:"Security",id:"security",level:2},{value:"Troubleshooting",id:"troubleshooting",level:2}];function h(e){let s={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(s.p,{children:'Mercury connects to your Spotify account natively \u2014 control playback, search music, manage playlists, and DJ on your devices through natural conversation. No browser tabs, no app switching. Just say "play some chill music" and Mercury handles the rest.'}),"\n",(0,i.jsx)(s.admonition,{title:"Spotify Premium",type:"info",children:(0,i.jsxs)(s.p,{children:["Read-only features (search, top tracks, playlists, now playing) work on ",(0,i.jsx)(s.strong,{children:"free"})," Spotify accounts. ",(0,i.jsx)(s.strong,{children:"Playback control"})," (play, pause, skip, volume, shuffle, repeat, queue) requires a ",(0,i.jsx)(s.strong,{children:"Spotify Premium"})," subscription \u2014 this is a Spotify API limitation, not a Mercury restriction."]})}),"\n",(0,i.jsx)(s.h2,{id:"setup",children:"Setup"}),"\n",(0,i.jsx)(s.h3,{id:"step-1-create-a-spotify-developer-app",children:"Step 1: Create a Spotify Developer App"}),"\n",(0,i.jsxs)(s.ol,{children:["\n",(0,i.jsxs)(s.li,{children:["Go to ",(0,i.jsx)(s.a,{href:"https://developer.spotify.com/dashboard",children:"developer.spotify.com/dashboard"})]}),"\n",(0,i.jsx)(s.li,{children:"Log in with your Spotify account"}),"\n",(0,i.jsxs)(s.li,{children:["Click ",(0,i.jsx)(s.strong,{children:'"Create app"'})]}),"\n",(0,i.jsxs)(s.li,{children:["Fill in:","\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"App name"}),": ",(0,i.jsx)(s.code,{children:"Mercury"})," (or anything you like)"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"App description"}),": ",(0,i.jsx)(s.code,{children:"Mercury Agent Spotify Integration"})]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Redirect URI"}),": ",(0,i.jsx)(s.code,{children:"http://127.0.0.1:8888/callback"})," \u2014 this must match exactly"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.li,{children:["Click ",(0,i.jsx)(s.strong,{children:"Save"})]}),"\n",(0,i.jsxs)(s.li,{children:["On the app's settings page, copy the ",(0,i.jsx)(s.strong,{children:"Client ID"})," and ",(0,i.jsx)(s.strong,{children:"Client Secret"})]}),"\n"]}),"\n",(0,i.jsx)(s.admonition,{title:"Development Mode",type:"tip",children:(0,i.jsxs)(s.p,{children:["When your Spotify Developer app is in ",(0,i.jsx)(s.strong,{children:"development mode"})," (the default), you can grant access to up to ",(0,i.jsx)(s.strong,{children:"25 users"}),". Go to your app's settings \u2192 ",(0,i.jsx)(s.strong,{children:"User Management"})," \u2192 add the Spotify email addresses of anyone who should be able to connect. This is perfect for personal use or small teams. If you need more than 25 users, you'll need to request ",(0,i.jsx)(s.strong,{children:"extended quota"})," from Spotify."]})}),"\n",(0,i.jsx)(s.h3,{id:"step-2-configure-mercury",children:"Step 2: Configure Mercury"}),"\n",(0,i.jsxs)(s.p,{children:["Run ",(0,i.jsx)(s.code,{children:"mercury doctor"})," (or ",(0,i.jsx)(s.code,{children:"mercury setup"})," for first-time setup):"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{className:"language-bash",children:"mercury doctor\n"})}),"\n",(0,i.jsxs)(s.p,{children:["When prompted for Spotify, choose ",(0,i.jsx)(s.strong,{children:"Yes"})," and enter:"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Spotify Client ID"})," \u2014 paste the Client ID from Step 1"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Spotify Client Secret"})," \u2014 paste the Client Secret from Step 1"]}),"\n"]}),"\n",(0,i.jsx)(s.p,{children:"Press Enter on any other field to keep its current value. After setup, you'll see:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"Spotify: not connected \u2014 run /spotify auth to link your account\n"})}),"\n",(0,i.jsx)(s.h3,{id:"step-3-connect-your-spotify-account",children:"Step 3: Connect Your Spotify Account"}),"\n",(0,i.jsx)(s.p,{children:"Start Mercury and run:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"/spotify auth\n"})}),"\n",(0,i.jsx)(s.p,{children:"Choose your authorization method:"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Method"}),(0,i.jsx)(s.th,{children:"When to use"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsxs)(s.td,{children:[(0,i.jsx)(s.strong,{children:"Open browser"})," (recommended)"]}),(0,i.jsx)(s.td,{children:"When Mercury is running locally on your machine"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.strong,{children:"Paste authorization code"})}),(0,i.jsx)(s.td,{children:"When browser auto-open fails, or via SSH"})]})]})]}),"\n",(0,i.jsxs)(s.p,{children:["For SSH or Telegram, Mercury will give you the auth URL. Open it on any device with a browser, then paste the ",(0,i.jsx)(s.code,{children:"code"})," parameter from the redirect URL:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"/spotify code <paste-your-code-here>\n"})}),"\n",(0,i.jsx)(s.p,{children:"After successful auth, Mercury shows:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"Spotify: connected as YourName\n"})}),"\n",(0,i.jsx)(s.h2,{id:"commands",children:"Commands"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Command"}),(0,i.jsx)(s.th,{children:"Description"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"/spotify"})}),(0,i.jsx)(s.td,{children:"Show connection status, account name, plan, and active device"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"/spotify auth"})}),(0,i.jsx)(s.td,{children:"Start OAuth flow (browser or manual code)"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"/spotify code <code>"})}),(0,i.jsx)(s.td,{children:"Complete auth with a pasted authorization code"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"/spotify logout"})}),(0,i.jsx)(s.td,{children:"Disconnect Spotify and clear saved tokens"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"/spotify player"})}),(0,i.jsx)(s.td,{children:"Interactive player with arrow-key controls (CLI only)"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"/spotify devices"})}),(0,i.jsx)(s.td,{children:"List available Spotify devices"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"/spotify device <id>"})}),(0,i.jsx)(s.td,{children:"Set active device"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"/spotify now"})}),(0,i.jsx)(s.td,{children:"Show what is currently playing"})]})]})]}),"\n",(0,i.jsx)(s.h2,{id:"spotify-tools",children:"Spotify Tools"}),"\n",(0,i.jsx)(s.p,{children:"These are the tools Mercury uses when you talk about music:"}),"\n",(0,i.jsx)(s.h3,{id:"read-only-works-on-free-accounts",children:"Read-only (works on free accounts)"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Tool"}),(0,i.jsx)(s.th,{children:"What it does"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_search"})}),(0,i.jsx)(s.td,{children:"Search tracks, artists, albums, playlists"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_now_playing"})}),(0,i.jsx)(s.td,{children:"Show what's currently playing"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_devices"})}),(0,i.jsx)(s.td,{children:"List available Spotify devices"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_top_tracks"})}),(0,i.jsx)(s.td,{children:"Get your top tracks (time_range: short/medium/long term)"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_playlists"})}),(0,i.jsx)(s.td,{children:"Get your playlists"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_like"})}),(0,i.jsx)(s.td,{children:"Save a track to your library"})]})]})]}),"\n",(0,i.jsx)(s.h3,{id:"playback-control-requires-spotify-premium",children:"Playback control (requires Spotify Premium)"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Tool"}),(0,i.jsx)(s.th,{children:"What it does"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_play"})}),(0,i.jsx)(s.td,{children:"Play a track, album, or playlist on a device"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_pause"})}),(0,i.jsx)(s.td,{children:"Pause playback"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_next"})}),(0,i.jsx)(s.td,{children:"Skip to next track"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_previous"})}),(0,i.jsx)(s.td,{children:"Skip to previous track"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_volume"})}),(0,i.jsx)(s.td,{children:"Set volume (0-100)"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_shuffle"})}),(0,i.jsx)(s.td,{children:"Toggle shuffle on/off"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_repeat"})}),(0,i.jsx)(s.td,{children:"Set repeat mode (off, track, context)"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:(0,i.jsx)(s.code,{children:"spotify_queue"})}),(0,i.jsx)(s.td,{children:"Add a track to the playback queue"})]})]})]}),"\n",(0,i.jsx)(s.h2,{id:"using-it",children:"Using It"}),"\n",(0,i.jsx)(s.p,{children:"Just talk to Mercury naturally about music:"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"You say"}),(0,i.jsx)(s.th,{children:"Mercury does"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"play some chill music"'}),(0,i.jsx)(s.td,{children:'Searches "lo-fi chill", picks tracks, plays on your device'})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"what are my top tracks?"'}),(0,i.jsxs)(s.td,{children:["Calls ",(0,i.jsx)(s.code,{children:"spotify_top_tracks"}),", shows results"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"skip this song"'}),(0,i.jsxs)(s.td,{children:["Calls ",(0,i.jsx)(s.code,{children:"spotify_next"})]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"pause"'}),(0,i.jsxs)(s.td,{children:["Calls ",(0,i.jsx)(s.code,{children:"spotify_pause"})]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"play my playlist Road Trip"'}),(0,i.jsx)(s.td,{children:"Searches your playlists, plays the match"})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"set volume to 50"'}),(0,i.jsxs)(s.td,{children:["Calls ",(0,i.jsx)(s.code,{children:"spotify_volume(50)"})]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"what\'s playing?"'}),(0,i.jsxs)(s.td,{children:["Calls ",(0,i.jsx)(s.code,{children:"spotify_now_playing"}),", shows artist \u2014 track + progress bar"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"add this to my queue"'}),(0,i.jsxs)(s.td,{children:["Calls ",(0,i.jsx)(s.code,{children:"spotify_queue"})," with current track"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"shuffle on"'}),(0,i.jsxs)(s.td,{children:["Calls ",(0,i.jsx)(s.code,{children:"spotify_shuffle(true)"})]})]})]})]}),"\n",(0,i.jsx)(s.h2,{id:"interactive-player-cli",children:"Interactive Player (CLI)"}),"\n",(0,i.jsxs)(s.p,{children:["The ",(0,i.jsx)(s.code,{children:"/spotify player"})," command launches an interactive arrow-key player in your terminal:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:" \u25B6 Play/Pause \u25C0 Previous \u25B6\u25B6 Next\n \u{1F50A} Volume \u{1F500} Shuffle \u{1F501} Repeat\n \u{1F50D} Search \u{1F4CB} Queue \u2715 Exit\n"})}),"\n",(0,i.jsx)(s.p,{children:"Every action shows real-time feedback with track info and a progress bar."}),"\n",(0,i.jsx)(s.h2,{id:"dj-mode",children:"DJ Mode"}),"\n",(0,i.jsxs)(s.p,{children:["Mercury's Spotify flow supports a practical ",(0,i.jsx)(s.strong,{children:"DJ mode"})," pattern in conversation and in the CLI player:"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:"Queue songs while current playback continues"}),"\n",(0,i.jsx)(s.li,{children:"Skip/recover quickly with next/previous controls"}),"\n",(0,i.jsx)(s.li,{children:"Adjust energy with volume/shuffle/repeat in-session"}),"\n",(0,i.jsxs)(s.li,{children:["Keep steering by prompts like:","\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsx)(s.li,{children:'"Queue 3 upbeat tracks"'}),"\n",(0,i.jsx)(s.li,{children:'"Skip this and play something calmer"'}),"\n",(0,i.jsx)(s.li,{children:'"Keep this vibe for the next 20 minutes"'}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(s.p,{children:["Use ",(0,i.jsx)(s.code,{children:"/spotify player"})," for hands-on control, or use natural-language prompts to keep the set moving."]}),"\n",(0,i.jsx)(s.h3,{id:"player-shortcuts",children:"Player shortcuts"}),"\n",(0,i.jsx)(s.p,{children:"Inside the Spotify player (CLI):"}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"N"})," \u2192 next track"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"P"})," \u2192 previous track"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"+"})," / ",(0,i.jsx)(s.code,{children:"-"})," \u2192 volume up/down by 10%"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"Z"})," \u2192 refresh now playing"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.code,{children:"Esc"})," \u2192 exit player"]}),"\n"]}),"\n",(0,i.jsx)(s.h3,{id:"optional-inline-album-art",children:"Optional inline album art"}),"\n",(0,i.jsx)(s.p,{children:"Mercury supports inline album art as a progressive enhancement (text UI remains the default)."}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:["Enable with: ",(0,i.jsx)(s.code,{children:"MERCURY_SPOTIFY_ART=1"})]}),"\n",(0,i.jsx)(s.li,{children:"Currently rendered only in local iTerm sessions"}),"\n",(0,i.jsx)(s.li,{children:"Automatically falls back to text-only view in SSH/mobile/light terminals"}),"\n"]}),"\n",(0,i.jsx)(s.h2,{id:"managing-devices",children:"Managing Devices"}),"\n",(0,i.jsxs)(s.p,{children:["Spotify plays on ",(0,i.jsx)(s.strong,{children:"your devices"})," \u2014 phone, desktop, TV, speaker. Mercury never plays audio locally. Before playing, Mercury checks what devices are available:"]}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"/spotify devices\n"})}),"\n",(0,i.jsx)(s.p,{children:"If no device is active, Mercury will tell you to open Spotify on a device first. You can set a default device:"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"/spotify device <device-id>\n"})}),"\n",(0,i.jsx)(s.p,{children:"The device ID persists across sessions \u2014 Mercury remembers your preferred device."}),"\n",(0,i.jsx)(s.h2,{id:"token-management",children:"Token Management"}),"\n",(0,i.jsxs)(s.p,{children:["Mercury stores your Spotify tokens in ",(0,i.jsx)(s.code,{children:"~/.mercury/mercury.yaml"}),":"]}),"\n",(0,i.jsxs)(s.ul,{children:["\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Access token"})," \u2014 short-lived, auto-refreshed"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Refresh token"})," \u2014 long-lived, used to get new access tokens"]}),"\n",(0,i.jsxs)(s.li,{children:[(0,i.jsx)(s.strong,{children:"Account info"})," \u2014 display name, user ID, plan (Premium/Free)"]}),"\n"]}),"\n",(0,i.jsxs)(s.p,{children:["Tokens refresh automatically before they expire. If the refresh token itself expires (rare), run ",(0,i.jsx)(s.code,{children:"/spotify auth"})," again."]}),"\n",(0,i.jsx)(s.h3,{id:"disconnecting",children:"Disconnecting"}),"\n",(0,i.jsx)(s.pre,{children:(0,i.jsx)(s.code,{children:"/spotify logout\n"})}),"\n",(0,i.jsxs)(s.p,{children:["This clears all tokens and account info. Run ",(0,i.jsx)(s.code,{children:"/spotify auth"})," to reconnect later."]}),"\n",(0,i.jsx)(s.h2,{id:"security",children:"Security"}),"\n",(0,i.jsx)(s.admonition,{title:"Client credentials",type:"warning",children:(0,i.jsxs)(s.p,{children:["Your Spotify Client ID and Client Secret are stored in ",(0,i.jsx)(s.code,{children:"~/.mercury/mercury.yaml"}),". They are only used to authenticate with Spotify's API from your machine \u2014 never shared externally. Treat this file like any other credential."]})}),"\n",(0,i.jsx)(s.p,{children:"Your access and refresh tokens are also stored locally. Mercury never sends them anywhere except Spotify's API endpoints."}),"\n",(0,i.jsx)(s.h2,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,i.jsxs)(s.table,{children:[(0,i.jsx)(s.thead,{children:(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.th,{children:"Issue"}),(0,i.jsx)(s.th,{children:"Solution"})]})}),(0,i.jsxs)(s.tbody,{children:[(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"Spotify Premium is required" error'}),(0,i.jsx)(s.td,{children:"You need Premium for playback control. Read-only features still work on free accounts."})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:"403 errors on play/pause/skip"}),(0,i.jsx)(s.td,{children:"Your account is on Spotify's free tier. Playback APIs are Premium-only."})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:'"No active device"'}),(0,i.jsx)(s.td,{children:"Open Spotify on your phone/computer, play any song, then try again."})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:"Browser doesn't open for auth"}),(0,i.jsxs)(s.td,{children:["Use the manual code flow: ",(0,i.jsx)(s.code,{children:"/spotify auth"}),' \u2192 choose "Paste code"']})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:"Token expired after long idle"}),(0,i.jsxs)(s.td,{children:["Run ",(0,i.jsx)(s.code,{children:"/spotify auth"})," to get fresh tokens"]})]}),(0,i.jsxs)(s.tr,{children:[(0,i.jsx)(s.td,{children:"Account name not showing"}),(0,i.jsxs)(s.td,{children:["Run ",(0,i.jsx)(s.code,{children:"/spotify"})," and Mercury will fetch it live from Spotify's API"]})]})]})]})]})}function a(e={}){let{wrapper:s}={...(0,t.R)(),...e.components};return s?(0,i.jsx)(s,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},28453(e,s,n){n.d(s,{R:()=>l,x:()=>c});var r=n(96540);let i={},t=r.createContext(i);function l(e){let s=r.useContext(t);return r.useMemo(function(){return"function"==typeof e?e(s):{...s,...e}},[s,e])}function c(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:l(e.components),r.createElement(t.Provider,{value:s},e.children)}}}]);