TuneTidy
An MCP server that enables ChatGPT to control Spotify playlists, playback (including exact-cue seek), and perform offline metadata export to ZIP.
README
TuneTidy
Hosted ChatGPT ↔ Spotify control — a small Connect website + MCP server so ChatGPT can act on your Spotify account.
Spotify stays the music app. TuneTidy is the middle layer: link once, then control playlists, playback (including exact-cue seek), and optional offline ZIP export from chat.
Not a Spotify clone. Not a self-host Docker product for end users. You (operator) deploy once; everyone else just Connects.
What it does
| For | Experience |
|---|---|
| End user | Open Connect → Link Spotify → add MCP URL in ChatGPT → chat |
| Operator | Deploy to Render (or similar), set env secrets once |
| ChatGPT | Calls 17 MCP tools; Spotify tokens never leave the server |
Capabilities (Milestone A)
- Connect site — Spotify OAuth (Authorization Code), encrypted token storage
- Playlist control — list, create, add/remove tracks, update details
- Playback — play / pause / seek / now-playing; exact-cue (beat-drop seek with confirmation)
- Offline export — Spotify metadata → match on JioSaavn/Gaana APIs → ZIP download
(not Spotify stream ripping) - Safety — write tools need
confirmationToken+idempotencyKey; AES-256-GCM for tokens
Architecture
Browser ──► apps/web (Next.js Connect + OAuth)
ChatGPT ──► apps/mcp (Fastify JSON-RPC MCP @ POST /mcp)
│
▼
packages/core (use cases)
│
┌───────────┼───────────┐
▼ ▼ ▼
packages/ packages/ packages/
spotify db saavn
│ │ │
Spotify API Postgres Saavn/Gaana APIs
| Path | Role |
|---|---|
apps/web |
Connect UX, Spotify OAuth routes, health |
apps/mcp |
Remote MCP: tools/list, tools/call, export downloads |
apps/worker |
Job worker skeleton (exports currently run in MCP process) |
packages/spotify |
Only place that calls Spotify HTTP |
packages/auth |
Token crypto, JWT verify, dev bypass |
packages/db |
Drizzle schema, migrations, repositories |
packages/core |
Playback cues, offline export pipeline |
packages/saavn |
Search/match for offline export |
packages/mcp-contracts |
Shared Zod tool schemas |
docs/ |
Architecture, MCP catalog, deploy, security |
.planning/ |
Roadmap / GSD state (optional for operators) |
MCP tools (17)
Endpoint: POST /mcp (JSON-RPC). Also: GET /mcp, GET /tools.
| Group | Tools |
|---|---|
| Read | account_get_status, playlists_list, library_get_summary, playback_get_state, playback_resolve_cue |
| Write | playlist_create, playlist_add_tracks, playlist_remove_tracks, playlist_update_details, playback_play, playback_pause, playback_seek, playback_play_exact_cue |
| Offline | offline_export_preview, offline_export_start, offline_export_status, offline_export_get_result |
Full contracts: docs/MCP_TOOL_CATALOG.md.
Quick start (local)
Requirements: Node ≥ 22, pnpm 9, Postgres (Docker optional).
# 1. Install
pnpm install
# 2. Env
cp .env.example .env
# Generate encryption key:
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
# Set TOKEN_ENCRYPTION_KEY_CURRENT and DATABASE_URL
# 3. Database
docker compose up -d # optional local Postgres
pnpm db:migrate
# pnpm db:seed # optional
# 4. Run
pnpm dev:web # http://127.0.0.1:3000
pnpm dev:mcp # http://127.0.0.1:3100
Minimum env for local Connect + MCP
| Variable | Notes |
|---|---|
DATABASE_URL |
Postgres connection string |
TOKEN_ENCRYPTION_KEY_CURRENT |
32-byte key, base64 |
SPOTIFY_CLIENT_ID / SECRET |
Spotify Developer Dashboard |
SPOTIFY_REDIRECT_URI |
e.g. http://127.0.0.1:3000/api/spotify/callback |
ALLOW_DEV_AUTH_BYPASS |
true for local MCP without Auth0 |
DEV_USER_ID |
Stable user id when bypass is on |
APP_BASE_URL / MCP_BASE_URL |
Defaults in .env.example |
Auth0 vars are required for production-style login; dev bypass skips MCP Bearer checks.
See .env.example for the full list (Saavn URLs, cover storage, classifier stubs, etc.).
Smoke MCP (dev bypass)
curl -s -X POST http://127.0.0.1:3100/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'
Deploy — free multi-user (recommended)
Don’t use paid Render Postgres. Use Convex free for encrypted Spotify tokens:
npx convex dev/npx convex deploy(seedocs/CONVEX_FREE_MULTIUSER.md)- Render 2 free Web Services:
tunetidy-web+tunetidy-mcp(no Postgres service) - Env:
STORAGE_BACKEND=convex,CONVEX_URL,CONVEX_SERVER_KEY, encryption key, Spotify app - Users open Connect → Link Spotify once → ChatGPT uses MCP
| Mode | Docs |
|---|---|
| Convex multi-user (free) | docs/CONVEX_FREE_MULTIUSER.md |
| MCP-only single user (no DB) | docs/SINGLE_USER_FREE_DEPLOY.md |
| Local Postgres | docs/DEPLOYMENT.md |
Scripts
| Command | Purpose |
|---|---|
pnpm dev / dev:web / dev:mcp |
Local apps |
pnpm db:migrate / db:seed |
Schema + seed |
pnpm typecheck |
TypeScript across packages |
pnpm test |
Unit tests (Vitest) |
pnpm test:contract |
Spotify client contracts |
pnpm build |
Production builds |
pnpm verify |
lint + typecheck + tests + build |
Security & compliance
- Spotify refresh/access tokens are encrypted at rest; tools never return them.
- Destructive writes are confirmation + idempotency gated.
- Offline export uses third-party catalog APIs (Saavn-compatible / Gaana). Not official Spotify Offline. Operators are responsible for ToS/legal fit in their region.
- Never commit
.env— only.env.example.
More: docs/SECURITY.md.
Docs
| Doc | Content |
|---|---|
docs/MCP_TOOL_CATALOG.md |
All tools + curl examples |
docs/ARCHITECTURE.md |
Package boundaries |
docs/FEATURES_EXACT_CUE_PLAYBACK.md |
Beat-drop / exact seek |
docs/FEATURES_OFFLINE_EXPORT.md |
JioSaavn match → ZIP |
docs/DEPLOYMENT.md |
Local + credential setup |
docs/CODE_AUDIT_REPORT.md |
Build completeness audit |
docs/CONNECT_LOCAL_TEST.md |
Connect smoke checklist |
Planning source (optional): .planning/, archive PRDs under all_raw_infos/.
Status
| Area | State |
|---|---|
| Connect + Spotify OAuth | ✅ Implemented |
| MCP tools (17) | ✅ Implemented |
| Exact-cue playback | ✅ Implemented |
| Offline export (preview → ZIP) | ✅ Implemented |
| Automated tests / typecheck | ✅ Passing in CI path |
| Production Render + live ChatGPT smoke | ⬜ Operator (you) |
| Full library organizer (rules, heavy sync UI) | ⬜ Backlog |
License
Private / unlicensed unless you add a license file. Spotify, JioSaavn, Gaana, Auth0, and ChatGPT are trademarks of their respective owners; this project is an independent companion stack.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。