HeartMuLa MCP server and API
Make songs with AI from your assistant or your own code, with the same HeartMuLa account and credits as the website.
MCP server
HeartMuLa runs a remote Model Context Protocol server at
https://heartmula.com/mcp (Streamable HTTP). An assistant connected to it can write a song with you, generate it,
and hand you the download links, without leaving the chat.
Using it needs a HeartMuLa account on the Starter or Creator plan, which include API access. A song costs 10 credits, the same as on the website. Failed tasks are refunded.
Connect an assistant
- Assistants with custom connectors (for example Claude and ChatGPT): add a custom connector with the
URL
https://heartmula.com/mcp, then sign in to HeartMuLa and press Allow. The assistant gets its own key, which you can revoke at any time under API keys. They can make songs; the tools that work on your own audio need an upload, which only assistants that can run commands can do. - Claude Code, Cursor, VS Code and other clients that send a header: create an API key in
HeartMuLa (API page) and add the server with it, for example:
claude mcp add --transport http heartmula https://heartmula.com/mcp --header "Authorization: Bearer mula_YOUR_API_KEY"
Discovery: https://heartmula.com/.well-known/mcp/server-card.json describes the server, and
https://heartmula.com/.well-known/oauth-protected-resource publishes the OAuth 2.1 metadata clients use to sign
in (PKCE, dynamic client registration).
Tools
generate_song: Make a song with vocals from a style and lyrics, or an instrumental. Uses credits; assistants are asked to confirm with you first.get_task: Check a task and get download links for the finished song (valid for 24 hours).upload_audio: For assistants that can run commands (such as Claude Code): a one-time link to upload one audio file of yours (MP3, WAV, FLAC or M4A), used by separate_stems, transcribe_song and analyze_song.separate_stems: Split an uploaded song into a vocals WAV and an instrumental WAV.transcribe_song: Turn an uploaded song into a lead sheet: key, tempo, chords and melodies, as JSON, an ABC score and MIDI.analyze_song: Analyze an uploaded song: structure, beats, key, tempo, chords and lyrics, as JSON.get_account: Your credits, plan and the current price of each model.
REST API
The same features over HTTPS at https://api.heartmula.com. Authenticate with
Authorization: Bearer mula_…, and send an Idempotency-Key header with every POST
that starts work, so a retried request never runs twice. Tasks run in the background: start one, then check it
until it has finished. Full reference, parameters and examples: https://api.heartmula.com/docs.
POST /v1/generate: Start a song with vocals from lyrics and a style, or an instrumental.POST /v1/generate/batch: Start several songs or instrumentals from one prompt.GET /v1/tasks/{id}: Task status and results.GET /v1/tasks/{id}/content: Download a finished song (MP3) or its cover image.POST /v1/uploads: Upload an audio file (MP3, WAV, FLAC or M4A) for the audio endpoints.POST /v1/covers: A cover of an uploaded song (6 minutes or shorter) in a new style, with its lyrics or new ones.POST /v1/separate: Split an uploaded song into vocals and instrumental.POST /v1/transcribe: Lead sheet of an uploaded song: key, tempo, chords, melodies, ABC and MIDI.POST /v1/analyze: Structure, beats, key, tempo, chords and lyrics of an uploaded song.POST /v1/edits: Change the melody, chords or lyrics of one passage of an analyzed song; only that passage is sung again.
curl -X POST https://api.heartmula.com/v1/generate \
-H "Authorization: Bearer mula_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: first-song-001" \
-d '{"model": "heartmula-v1", "style": "warm acoustic pop, female vocal", "lyrics": "[Verse]\n..."}'
Rights and limits
Songs made through the MCP server or the API follow the same rules as songs made on the website: Starter and Creator include commercial use of songs made while the subscription is active. Upload only audio you made or have permission to use. See the Terms of Service and the plans. Questions: contact@mulalabs.ai.
