set-spotify-credentials
Configure and store Spotify API credentials, including client ID, client secret, access token, and refresh token, to enable seamless integration with the Spotify MCP Server for music management and interaction.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accessToken | Yes | The Spotify Access Token | |
| clientId | Yes | The Spotify Client ID | |
| clientSecret | Yes | The Spotify Client Secret | |
| refreshToken | Yes | The Spotify Refresh Token |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"accessToken": {
"description": "The Spotify Access Token",
"type": "string"
},
"clientId": {
"description": "The Spotify Client ID",
"type": "string"
},
"clientSecret": {
"description": "The Spotify Client Secret",
"type": "string"
},
"refreshToken": {
"description": "The Spotify Refresh Token",
"type": "string"
}
},
"required": [
"clientId",
"clientSecret",
"accessToken",
"refreshToken"
],
"type": "object"
}
Implementation Reference
- mcp/spotify-mcp-sse.ts:95-118 (registration)Registers the 'set-spotify-credentials' tool with input schema using Zod and an inline handler function that stores the credentials in the global spotifyAuthInfo object and returns a success message.server.tool( "set-spotify-credentials", { clientId: z.string().describe("The Spotify Client ID"), clientSecret: z.string().describe("The Spotify Client Secret"), accessToken: z.string().describe("The Spotify Access Token"), refreshToken: z.string().describe("The Spotify Refresh Token"), }, async ({ clientId, clientSecret, accessToken, refreshToken }) => { spotifyAuthInfo.clientId = clientId; spotifyAuthInfo.clientSecret = clientSecret; spotifyAuthInfo.accessToken = accessToken; spotifyAuthInfo.refreshToken = refreshToken; return { content: [ { type: "text", text: "Spotify credentials set successfully. You can now use other Spotify tools.", }, ], }; } );
- mcp/spotify-mcp.ts:82-105 (registration)Registers the 'set-spotify-credentials' tool with input schema using Zod and an inline handler function that stores the credentials in the global spotifyAuthInfo object and returns a success message.server.tool( "set-spotify-credentials", { clientId: z.string().describe("The Spotify Client ID"), clientSecret: z.string().describe("The Spotify Client Secret"), accessToken: z.string().describe("The Spotify Access Token"), refreshToken: z.string().describe("The Spotify Refresh Token"), }, async ({ clientId, clientSecret, accessToken, refreshToken }) => { spotifyAuthInfo.clientId = clientId; spotifyAuthInfo.clientSecret = clientSecret; spotifyAuthInfo.accessToken = accessToken; spotifyAuthInfo.refreshToken = refreshToken; return { content: [ { type: "text", text: "Spotify credentials set successfully. You can now use other Spotify tools.", }, ], }; } );
- mcp/spotify-mcp-http.js:89-112 (registration)Registers the 'set-spotify-credentials' tool with input schema using Zod and an inline handler function that stores the credentials in the global globalSpotifyAuthInfo object and returns a success message.server.tool( "set-spotify-credentials", { clientId: z.string().describe("The Spotify Client ID"), clientSecret: z.string().describe("The Spotify Client Secret"), accessToken: z.string().describe("The Spotify Access Token"), refreshToken: z.string().describe("The Spotify Refresh Token"), }, async ({ clientId, clientSecret, accessToken, refreshToken }) => { globalSpotifyAuthInfo.clientId = clientId; globalSpotifyAuthInfo.clientSecret = clientSecret; globalSpotifyAuthInfo.accessToken = accessToken; globalSpotifyAuthInfo.refreshToken = refreshToken; return { content: [ { type: "text", text: "Spotify credentials set successfully. You can now use other Spotify tools.", }, ], }; } );