Kotlin MCP server for Spotify Web API integration

Kotlin MCP server for Spotify Web API integration

spotify-mcp-server-carrieukie•bycarrieukie

A Model Context Protocol server that exposes Spotify playback, playlist, and user profile tools through a standardized interface.

License: Not specified•Runtime: Awaiting documentation review•Category: media design

WHAT IT DOES

  • •Provides tools to control Spotify playback, including play, pause, skip, seek, volume, and repeat mode.
  • •Provides playlist management tools to create playlists, add and remove tracks, and retrieve playlist information.
  • •Provides a tool to retrieve the user's Spotify profile information.
  • •Manages Spotify API tokens and authentication for the integrated tools.

BEST FOR

  • •Using an AI assistant to control Spotify playback through MCP tools.
  • •Managing Spotify playlists conversationally via an MCP-capable client.

ABOUT SPOTIFY-MCP-SERVER-CARRIEUKIE

Kotlin MCP server for Spotify Web API integration is cataloged as an MCP server attributed to carrieukie. A Model Context Protocol server that exposes Spotify playback, playlist, and user profile tools through a standardized interface. It is categorized under media design. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Kotlin MCP server for Spotify Web API integration are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

In what modes can the MCP server be run?

The server can run in Standard I/O mode (default) or in Server-Sent Events (SSE) mode using Ktor.

What prerequisites does the server require?

It requires JDK 20 or higher, Kotlin 2.1.10, Gradle (wrapper included), and a Spotify Developer Account for API access.

上游原版 README

在 GitHub 查看同一版本原文

README.md · dad8b83a6328 · 采集于 2026-11-13 09:56:46 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Kotlin MCP Server for Spotify

A Kotlin implementation of a Model Context Protocol (MCP) server that integrates with the Spotify Web API. This server provides tools for controlling Spotify playback, managing playlists, and retrieving user information through a standardized interface.

Demo

video

Features

  • Spotify Authentication: Manages Spotify API tokens and authentication
  • Playback Control: Play, pause, skip tracks, seek to position, set volume, and control repeat mode
  • Playlist Management: Create playlists, add/remove tracks, and retrieve playlist information
  • User Profile: Retrieve user profile information
  • MCP Integration: Implements the Model Context Protocol for standardized tool interactions

Prerequisites

  • JDK 20 or higher
  • Kotlin 2.1.10
  • Gradle (wrapper included)
  • Spotify Developer Account (for API access)

Installation and Setup

  1. Clone the repository:

    git clone https://github.com/yourusername/kotlin-mcp-server.git
    cd kotlin-mcp-server
    
  2. Set up Spotify Developer credentials:

    • Go to the Spotify Developer Dashboard
    • Log in with your Spotify account or create a new one
    • Click "Create an App"
    • Fill in the app name and description, then click "Create"
    • From your app's dashboard, note your Client ID and Client Secret
    • Create a .env file in the project root with the following content:
      SPOTIFY_CLIENT_ID = "your-client-id"
      SPOTIFY_CLIENT_SECRET = "your-client-secret"
      
      For example:
      SPOTIFY_CLIENT_ID = "d4k32j4kl32j4k23j4k23j4k32if"
      SPOTIFY_CLIENT_SECRET = "5gd6f56fdsd6g5a6d7sd5656cvbx"
      

Usage

The server can be run in two modes:

  1. Standard I/O Mode (default): Uncomment the appropriate line in Main.kt to run the server using Ktor with stdio:

    // In Main.kt
    fun main() {
        runMcpServerUsingStdio()
        // runSseMcpServerUsingKtorPlugin(8080)
    }
    
    1. Run the following command to generate the executable:
      ./gradlew installDist
      
      This will generate an executable at: build/install/kotlin-mcp-server/bin/kotlin-mcp-server

    Connecting with VS Code's Copilot: VS Code's Copilot has a built-in MCP client that can connect to the server when running in Standard I/O mode. You can use other mcp clients like claude desktop but Code's Copilot is the easiest that I found to use. To use it:

  2. Configure VS Code to connect to the MCP server:

    • Open VS Code Settings (Settings > Settings again )
    • Search for "mcp" in the settings search bar
    • Click on "Edit in settings.json"
    • Add the following configuration (adjust the path to match your installation):
    {
        "security.workspace.trust.untrustedFiles": "open",
        "terminal.integrated.fontFamily": "MesloLGS Nerd Font",
        "mcp": {
            "inputs": [],
            "servers": {
                "spotify-mcp-server": {
                    "command": "/Users/karis/IdeaProjects/kotlin-mcp-server/build/install/kotlin-mcp-server/bin/kotlin-mcp-server",
                    "args": [],
                    "env": {}
                }
            }
        },
        "git.autofetch": true
    }
    
  3. In VS Code, open the Copilot chat panel and pick Agent Mode.

  4. Copilot will automatically detect and connect to the MCP server

  5. You can now interact with the Spotify tools through the Copilot interface

  6. Server-Sent Events (SSE) Mode: Uncomment the appropriate line in Main.kt to run the server using Ktor with SSE:

    // In Main.kt
    fun main() {
        // runMcpServerUsingStdio()
        runSseMcpServerUsingKtorPlugin(8080)
    }
    

    Then run the application and connect to http://localhost:8080/sse using an MCP inspector.

Project Structure

  • src/main/kotlin/mcpserver/spotify/: Core Spotify API integration
    • auth/: Authentication and token management
    • services/: Service implementations for Spotify API endpoints
    • utils/: Utility functions and error handling
  • src/main/kotlin/mcpserver/spotifymcp/: MCP server implementation
    • tools/: Tool implementations for the MCP server

Available Tools

The server provides the following tools for interacting with Spotify:

Playback Control

  • Pause playback
  • Resume playback
  • Skip to next track
  • Skip to previous track
  • Seek to position
  • Set volume
  • Set repeat mode
  • Get current queue

Playlist Management

  • Get user playlists
  • Get playlist items
  • Create playlist
  • Add tracks to playlist
  • Remove tracks from playlist

User Information

  • Get user profile

Development Guidelines

Error Handling

The project uses a custom SpotifyResult<T, E> sealed class for error handling:

  • SpotifyResult.Success<T>: Contains successful response data
  • SpotifyResult.Failure<E>: Contains an exception with error details

Use the safeSpotifyApiCall function to make API calls that return SpotifyResult objects:

val result = safeSpotifyApiCall<ResponseType, ErrorType> {
    // API call code here
}

Adding New Tools

To add a new tool to the MCP server:

  1. Create a new Kotlin file in the mcpserver/spotifymcp/tools package
  2. Define a function that takes a Server instance and any required services
  3. Use server.addTool() to register the tool with a name, description, and input schema
  4. Implement the tool's functionality in the callback

Testing

Running Tests

# Run all tests
./gradlew test

# Run a specific test class
./gradlew test --tests "mcpserver.spotify.services.playerservice.SpotifyPlayerServiceImplTest"

# Run a specific test method
./gradlew test --tests "mcpserver.spotify.services.playerservice.SpotifyPlayerServiceImplTest.playTrack should return success when API call succeeds"

Writing Tests

The project uses JUnit 5 for testing. Tests should be placed in the src/test/kotlin directory, mirroring the structure of the main source code.

For HTTP client mocking, use Ktor's MockEngine to simulate HTTP responses. When testing services that depend on external APIs, create mock implementations of dependencies and test both success and failure scenarios.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Kotlin MCP server for Spotify Web API integration from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/spotify-mcp-server-carrieukie)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related media design MCP Servers

Alternative and complementary servers in the same category

View all in media design →

A Rust CAD application with an MCP server for creating, inspecting and rendering drawings, either headlessly or through a connection to the desktop app.

8K
Media & Design
Liquid Composer
liquid-composer•frontedu

Liquid Composer is a browser-based Liquid Glass icon design tool that offers a local MCP server for agent-driven icon workflows.

69
Media & Design

agent-media makes short drama series and other short vertical videos from Claude, ChatGPT or Codex through one MCP connection, with OAuth sign-in and no API keys.

1
Media & Design