
Spotify Soundtrack MCP
io.github.Chiru144由 GitHub 帳號 Chiru144 發布v1.1.0更新於 Nov 6, 2026
Spotify + TMDB tools: movie soundtrack playlists, playlist curation, taste stats and playback.
概覽
將助理連接到 Spotify 與 TMDB,用來製作電影原聲帶播放清單、整理清單、分析聆聽口味並控制播放。
- 可以做什麼
- 在 TMDB 查詢電影、演員與作品年表,並轉成 Spotify 播放清單
- 搜尋 Spotify 曲庫,依心情、曲風、藝人關係網或年代探索音樂
- 建立、合併、拆分與比對播放清單,建立前先提供預覽
- 以本機快取產生氛圍、電台、年代與時光膠囊播放清單
- 檢視口味分析、熱門曲目與聆聽模式,管理收藏的歌曲與專輯
- 控制 Spotify Connect 播放、裝置與播放佇列
- 適用情境
- 適合讓助理組出電影原聲帶或演員作品年表播放清單、整理合併既有清單,或回答關於自己聆聽紀錄的問題。對印度電影音樂支援最好,但任何 Spotify 音樂都能使用。
- 執行需求
- 本機 Python 3.10+ 程序,可透過 uvx 或 pip 執行;需要 Spotify 開發者應用程式,設定 SPOTIPY_CLIENT_ID 與已登記的 SPOTIPY_REDIRECT_URI,並完成一次瀏覽器登入;需提供 TMDB_API_KEY 或 TMDB_READ_ACCESS_TOKEN 其中之一;可選用 SPOTIFY_TOOLSETS 限制載入的工具;需能連線 Spotify 與 TMDB。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Spotify Soundtrack MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Spotify & TMDB Web and MCP Server
[M8ven Score] [MCP Tools] [Agent Skills] [MCP Registry] [PyPI: spotify-soundtrack-mcp] [PyPI: spotify-mcp-web] [Listed on MCP Market]
This repository contains a FastMCP application that connects Spotify with TMDB (The Movie Database). It has 115 registered MCP tools and 20 autonomous agent skills, and lets you build movie soundtrack playlists, automate playlist curation, explore your listening taste, and use a local web app, the Soundtrack Curator & Staging Studio.
[!NOTE] Built mostly for Indian users. The project is designed around Indian film music: it builds playlists from an actor's filmography and matches soundtracks for Kannada, Telugu, Tamil, Malayalam and Hindi movies, including songs credited as 'From "Movie Name"' and releases tagged with a language, such as "[Kannada]". It works for any music on Spotify, but Indian cinema is where it is strongest.
Highlights
- 115 FastMCP Tools & 20 Agent Skills: Covers cinema filmography discovery, smart playlist management, artist-network and mood discovery, a local library cache, vibe/radio/era/time-capsule playlist generators, taste analytics, catalog browsing, library management, and full Spotify Connect device control.
- PKCE OAuth & Flexible Auth: Spotify sign-in uses PKCE, so you only need a Client ID and a one-click browser login, with no client secret. TMDB accepts either an API key or a Read Access Token.
- Cinema Meets Music: Your AI assistant can look up movies, cast and crew on TMDB and turn them into Spotify playlists.
- Dual Web & Agent Design: Built on FastAPI and Uvicorn, it runs both as a web app and as an MCP server, and supports remote hosting and several AI clients at once.
- Modular Architecture: The tools are split into focused modules (
playback.py,playlists.py,taste.py,search.py,library.py,library_cache.py,generators.py,browse.py,web_app.py), each covered by unit tests.
Spotify 2026 Development Mode Limits
In 2026, Spotify switched off several Web API features for apps in Development Mode, which is what every personal Client ID is. The tools work around them where they can:
Local Library Cache & Playlist Generators
spotify_sync_library downloads your Liked Songs and the playlists you own into a JSON file: ~/.cache/spotify-mcp/library.json, or %LOCALAPPDATA%\spotify-mcp\library.json on Windows (set SPOTIFY_MCP_LIBRARY_PATH to change it). After that:
spotify_query_libraryandspotify_library_statsanswer questions about your music without calling Spotify.spotify_vibe_playlistbuilds a playlist for a mood, or an energy/valence target, from songs you already like.spotify_era_playlist(withfrom_library=True) andspotify_time_capsule_playlist(songs you saved in a given year) also use the cache.spotify_radio_playlistmixes an artist's songs with songs by the artists they collaborate with.
Every generator shows a preview first and only creates a playlist when called with create=True.
How vibes are estimated: Spotify no longer gives this app audio features or artist genres, so each genre has an estimated energy and valence (GENRE_VIBES in tools/discovery.py). A song gets its vibe from the genre searches its artist appears in, plus words in its track, album and playlist names ("Unplugged" means acoustic; a playlist called "Gym" means workout). Spotify's genre search mostly covers mainstream Western genres, so songs from other scenes, such as Kannada, Telugu or Tamil film music, are often left unplaced. Naming your playlists by mood helps.
Run spotify_sync_library again whenever your library changes. A sync makes about one Spotify call per 50 Liked Songs, plus one or more per playlist.
Features & Capabilities
For an in-depth breakdown of the features, a feature comparison table, and the cinema filmography pipeline, see CONTRIBUTING.md. The complete 115-tool catalog and the 20 agent skills are listed in CONTRIBUTING.md.
Install from PyPI
The MCP server is listed in the official MCP Registry as io.github.Chiru144/spotify-soundtrack-mcp (metadata in server.json), so registry-aware MCP clients can find and install it. The server and the web studio are published as two Python packages:
1. Install
You need Python 3.10 or later. Installing spotify-mcp-web also installs spotify-soundtrack-mcp. If you don't want the web studio, install only spotify-soundtrack-mcp.
2. Configure
Create ~/.spotify-mcp/.env (or a .env file in the folder you run the commands from):
In the Spotify Developer Dashboard, add http://127.0.0.1:8888/callback as a Redirect URI for your app. Only the Client ID is needed; there is no client secret.
3. Connect your Spotify account
This opens Spotify in your browser. Once you approve, the token is saved to ~/.spotify-mcp/.spotipyoauthcache (set SPOTIFY_MCP_CACHE_PATH to store it elsewhere), and both the MCP server and the web studio use it.
4. Connect the MCP server to your AI client
spotify-mcp runs the server over stdio. Add it to Claude Desktop (claude_desktop_config.json), Cursor (.cursor/mcp.json) or any other MCP client:
If the client can't find spotify-mcp on your PATH, use the full path printed by where spotify-mcp (Windows) or which spotify-mcp (macOS/Linux). With uv, you can skip the install and let the client run it:
From version 1.1.0, the package-named command also runs over stdio when given --transport stdio. This is the command MCP Registry clients run:
While spotify-mcp is running, it also starts the web studio at http://127.0.0.1:8000 if spotify-mcp-web is installed.
To serve MCP over HTTP (SSE) for remote clients instead, run:
It listens on 0.0.0.0:8080; set HOST and PORT to change this. spotify-soundtrack-mcp --transport stdio (or MCP_TRANSPORT=stdio) runs it over stdio instead, and spotify-soundtrack-mcp --version prints the installed version.
5. Open the web studio on its own
This starts the studio at http://127.0.0.1:8000 and opens your browser. Set PORT to use a different port, or OPEN_BROWSER=false to stop it from opening the browser. The tool guide is at /guide and the advanced tools are at /tools.
Run with Docker
The Dockerfile builds the MCP server from this repository and runs it over stdio (MCP directories such as Glama use it to inspect the server):
All 115 tools load by default (SPOTIFY_TOOLSETS=all); pass -e SPOTIFY_TOOLSETS=core for the smaller set.
Prerequisites
To run from source instead of PyPI, make sure you have the following installed:
You will also need developer API credentials for:
- Spotify Developer Dashboard (only the Client ID is needed; sign-in uses PKCE browser authorization)
- TMDB API (provide either an API key or a Read Access Token)
Installation & Setup
Follow these steps to run the project locally:
1. Clone the repository
2. Create and activate a virtual environment
Using a virtual environment is recommended for managing dependencies.
Windows:
Mac/Linux:
3. Install dependencies
Install the required Python packages from requirements.txt:
4. Configure environment variables
Create a file named .env in the project root (or copy .env.sample) and add your API credentials:
[!TIP]
- Spotify PKCE flow: The app uses PKCE (Proof Key for Code Exchange) authorization. No client secret is needed or used; you only need your
SPOTIPY_CLIENT_IDand a one-click browser login.- Flexible TMDB authentication: You only need one of
TMDB_API_KEY(v3 API key) orTMDB_READ_ACCESS_TOKEN(v4 Read Access Token). The server detects which one you provided.
5. (Optional) Verify Spotify sign-in
Run the one-click Spotify authorization script to test your connection:
Modular Toolsets & On-Demand Lazy Loading
To avoid flooding the LLM context window in AI clients (Cursor, Claude Desktop, Antigravity), this server uses modular toolsets and on-demand lazy loading:
- Context window protection: The full catalog of 115 tools takes ~25,600 tokens. Running with
--toolsets=coreexposes only the 16 essential curation tools (~4,100 tokens), an 84% reduction. - On-demand lazy loading: Heavy modules (
spotipy,requests,bs4,ddgs, etc.) are not loaded at startup. When an LLM calls a tool, its module is imported and kept in memory, so later calls start instantly.
Available Toolsets
Running with Toolset Flags
You can choose toolsets with the --toolsets=... command-line flag or the SPOTIFY_TOOLSETS environment variable:
Running the Application
There are two entry points, depending on how you want to use the server:
1. server.py (development and web app)
Start the MCP server and the web app together:
The web interface should open automatically in your default browser at http://127.0.0.1:8000.
2. mcp.py (MCP client integration)
If you are running this project as a tool inside an MCP host (such as Cursor, VS Code, or Claude Desktop), use mcp.py:
Repository Structure
API Limits
Keep in mind the rate limits of the external APIs this project uses:
- Spotify Web API: Spotify uses a dynamic rate limit over a rolling window. If you make too many requests in a short time (for example, searching aggressively or building very large playlists), Spotify returns
429 Too Many Requestsand may ask the app to wait, sometimes for hours. When the wait is long, the tools stop and tell you when you can try again instead of hanging. - TMDB API: The Movie Database allows up to 50 requests per second. That is generous for normal use, but large batches or many rapid lookups at once can still hit it.
MCP Integration
This project is built with fastmcp. Once it is running over stdio (or SSE, if configured), any MCP client can use its tools.
Publishing a Release (PyPI & MCP Registry)
The two PyPI packages are built from this repository by packaging/build_packages.py, which copies tools/, skills/, SPOTIFY_RULES.md and mcp-soundtrack-app/ into the package layouts and rewrites the tools.* imports to spotify_soundtrack_mcp.tools.*.
Pushing a tag such as v1.2.0 runs .github/workflows/publish.yml, which tests and builds both packages, uploads them to PyPI, and then publishes server.json to the MCP Registry.
One-time setup:
- PyPI trusted publishing: on PyPI, open each project (
spotify-soundtrack-mcpandspotify-mcp-web) → Manage → Publishing → Add a new publisher → GitHub, with ownerChiru144, repositorySpotify-MCP-Web-And-MCP-Server, workflowpublish.ymland environmentpypi. - GitHub environment: in the repository settings, create an environment named
pypi. - MCP Registry: nothing to configure. The workflow signs in with GitHub OIDC, which allows publishing names under
io.github.Chiru144/.
The registry confirms you own the PyPI package by finding mcp-name: io.github.Chiru144/spotify-soundtrack-mcp in its PyPI description, which comes from packaging/spotify-soundtrack-mcp/README.md. Keep that line when editing the README.
To publish by hand instead:
來源:README.md,提交 f0c865c
工具
0版本歷史
1- v1.1.0最新Nov 6, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分