Skip to content

Add remote deployment via Vercel#1

Open
popand wants to merge 3 commits into
mainfrom
feature/remote-deployment
Open

Add remote deployment via Vercel#1
popand wants to merge 3 commits into
mainfrom
feature/remote-deployment

Conversation

@popand

@popand popand commented Feb 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Deploy the Apple Music MCP server as a stateless Vercel serverless function at applemusicmcp.gradientworks.ca/mcp
  • Add hosted auth page (/auth) using MusicKit JS so users can get a Music User Token without any local setup
  • Support multi-user via per-request Music-User-Token header (no server-side token storage)
  • Use jose library for ES256 JWT signing (works on Vercel edge/serverless, unlike jsonwebtoken)
  • Add bearer token auth (MCP_API_KEY env var) to secure the endpoint
  • Update README with a "Quick Start (Hosted)" section as the primary onboarding path

New Files

  • api/mcp.ts — Vercel serverless MCP handler with CORS, auth, stateless transport
  • api/auth.ts — Serves the auth HTML page with developer token injected
  • public/auth.html — Browser-based MusicKit JS auth flow with token display and setup instructions
  • src/auth/developer-token-jose.ts — Async JWT signing with jose
  • src/config-vercel.ts — Config loader for Vercel env vars (base64-decoded private key)
  • vercel.json — Routes, CORS headers, function config

Test plan

  • Verify applemusicmcp.gradientworks.ca/mcp responds to MCP requests
  • Verify /auth page loads, MusicKit JS initializes, and authorization flow produces a token
  • Verify Claude Desktop connects via mcp-remote with Music-User-Token header
  • Verify catalog search works (dev token only)
  • Verify library endpoints work (both tokens)
  • Verify unauthorized requests are rejected (missing/wrong bearer token)

popand and others added 2 commits February 8, 2026 14:38
Deploy Apple Music MCP as a stateless Vercel serverless function with
bearer token auth, per-request Music User Token support, and a hosted
auth page for onboarding users via MusicKit JS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a "Quick Start (Hosted)" section as the primary onboarding path
so users can get started without an Apple Developer account. Reorganize
the self-hosted setup under its own section and document both local
and remote architecture modes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Feb 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
apple-music-mcp Ready Ready Preview, Comment Feb 8, 2026 7:53pm

Request Review

Replace hardcoded Team ID and Key ID with placeholders in
VERCEL_DEPLOYMENT_PLAN.md. Expand .gitignore to cover all .env*
variants (e.g. .env.local, .env.production).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant