Public API & MCP Server
Foundational.Art exposes two programmatic interfaces: a public REST API at /api/public/playlists for generating and retrieving playlists, and an MCP server at /mcp so you can connect ChatGPT, Claude, Cursor, and other agents directly to the app.
The POST endpoint requires an API key. Send it in the x-api-key header, or as a bearer token via Authorization: Bearer <key>. The GET endpoint needs no key — share links are already public. To request an API key, contact the team.
/api/public/playlistsGenerate a playlist. Choose a mode and supply its parameters. Set "save": true to persist the result and receive a public share link.
| mode | parameters |
|---|---|
| ai | { vibe?, genres?[], mood?, minutes? } |
| theme | { theme, excludeTitles?[] } |
| artist | { artistId, artistName, artistMode?: "top10"|"obscure", excludeTitles?[] } |
| menu | { decades?[], excludeTitles?[] } |
| selection | { picks: [{ artist, track }] } |
| mood | { mood: { moodSummary, moodTags[], energy, valence }, intent: "match"|"lift" } |
curl -X POST https://www.foundational.art/api/public/playlists \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"mode": "ai",
"vibe": "late-night listening room",
"genres": ["jazz", "soul"],
"mood": "warm",
"minutes": 90,
"save": true
}'200 OK
{
"list": {
"id": "ai-1719800000000",
"title": "Late-Night Listening Room — Jul 1, 2026",
"description": "A warm, slow-burning set of jazz and soul...",
"source": "ai",
"albums": [
{
"rank": 1,
"album": "A Love Supreme",
"artist": "John Coltrane",
"appleAlbumId": "1452004704",
"appleAlbumUrl": "https://music.apple.com/us/album/1452004704",
"foundAlbum": "A Love Supreme",
"foundArtist": "John Coltrane",
"artwork": "https://.../{w}x{h}bb.jpg",
"tracks": [
{
"id": "1452004707",
"title": "Part 1: Acknowledgement",
"artist": "John Coltrane",
"trackNumber": 1,
"discNumber": 1,
"durationMs": 462000,
"previewUrl": "https://.../preview.m4a"
}
]
}
]
},
"trackCount": 18,
"shareId": "a1b2c3d4",
"shareUrl": "https://www.foundational.art/p/a1b2c3d4"
}shareId and shareUrl are only returned when "save": true is sent.
| status | meaning |
|---|---|
| 400 | Invalid JSON, unknown mode, or missing required params |
| 401 | Invalid or missing API key |
| 422 | No tracks could be resolved |
| 502 | List generated but saving failed (list still returned) |
/api/public/playlists?id=<shareId>Retrieve a previously-saved playlist by its share id. No API key required.
curl https://www.foundational.art/api/public/playlists?id=a1b2c3d4200 OK
{
"id": "a1b2c3d4",
"list": {
"id": "ai-1719800000000",
"title": "Late-Night Listening Room — Jul 1, 2026",
"description": "A warm, slow-burning set of jazz and soul...",
"source": "ai",
"albums": [ /* same shape as POST response */ ]
},
"shareUrl": "https://www.foundational.art/p/a1b2c3d4"
}| status | meaning |
|---|---|
| 400 | Missing id query parameter |
| 404 | Playlist not found |
/mcpThe Foundational.Art MCP server is published at https://www.foundational.art/mcp. It currently uses no authentication and exposes read-only tools for browsing and generating playlists.
https://www.foundational.art/mcp.| tool | description |
|---|---|
| list_curated_playlists | List all curated Apple Music playlists with album and track counts. Input: none. |
| get_curated_playlist | Get the full album and track listing for one curated playlist. Input: { id: string }. |
| generate_playlist | Generate a new playlist from the catalog. Input: { mode: "ai"|"theme"|"menu", vibe?, mood?, genres?[], minutes?, theme?, decades?[] }. |
{
"tool": "generate_playlist",
"input": {
"mode": "ai",
"vibe": "late-night listening room",
"genres": ["jazz", "soul"],
"mood": "warm",
"minutes": 90
}
}All current tools are read-only and idempotent — they return track metadata and generated lists without mutating any data.
MCP clients can fetch the auto-generated manifest at /.lovable/mcp/manifest.json, which lists the server name, version, tools, and input schemas.
All responses are JSON and include permissive CORS headers, so the API can be called from the browser or any backend. For an API key or integration help, contact the team.