Generate music and instrumental audio using the media-mcp server's generate_music tool. Use when the user asks to create music, background tracks, sound effects, ambient audio, jingles, or instrumental compositions. Supports weighted text prompts for blending styles, BPM control, musical scale constraints, temperature for creativity, and duration settings.
Use the mcp__media-mcp__generate_music tool to create instrumental music via Google Gemini Lyria RealTime.
Key parameters:
| Parameter | Type | Description |
|---|---|---|
prompts | array (required) | Weighted text prompts describing the music (e.g., [{"text": "epic orchestral", "weight": 1.0}]) |
bpm | number | Beats per minute (tempo) |
temperature| number |
| Creativity level — lower = more predictable, higher = more experimental |
scale | string | Musical scale constraint (e.g., "C major", "A minor") |
duration | number | Length in seconds |
The prompt system uses weights to blend musical concepts. Higher weight = more influence.
[{"text": "calm ambient piano with soft reverb", "weight": 1.0}]
[
{"text": "electronic synthwave", "weight": 0.7},
{"text": "orchestral strings", "weight": 0.3}
]
[
{"text": "jazz", "weight": 0.5},
{"text": "relaxed late-night mood", "weight": 0.3},
{"text": "saxophone and upright bass", "weight": 0.4}
]
Background music for a product video:
[
{"text": "modern corporate background music", "weight": 0.6},
{"text": "upbeat and professional", "weight": 0.3},
{"text": "light percussion and clean electric guitar", "weight": 0.3}
]
Podcast intro jingle:
[
{"text": "short catchy podcast intro jingle", "weight": 0.7},
{"text": "friendly and energetic", "weight": 0.4},
{"text": "acoustic guitar and claps", "weight": 0.3}
]
Ambient background for coding:
[
{"text": "lo-fi ambient chill beats", "weight": 0.6},
{"text": "soft rain and vinyl crackle texture", "weight": 0.3},
{"text": "slow tempo relaxing", "weight": 0.3}
]
Game soundtrack — boss battle:
[
{"text": "epic orchestral battle music", "weight": 0.7},
{"text": "intense fast-paced drums and brass", "weight": 0.5},
{"text": "dark and dramatic", "weight": 0.3}
]
Meditation/relaxation:
[
{"text": "peaceful meditation music", "weight": 0.6},
{"text": "singing bowls and soft pads", "weight": 0.4},
{"text": "very slow, spacious, minimal", "weight": 0.3}
]
| BPM Range | Feel | Good for |
|---|---|---|
| 60-80 | Slow, calm, relaxed | Ambient, meditation, ballads |
| 80-100 | Moderate, walking pace | Lo-fi, chill, background |
| 100-120 | Medium, conversational | Pop, corporate, podcasts |
| 120-140 | Upbeat, energetic | Dance, workout, upbeat promos |
| 140-180 | Fast, intense | EDM, drum & bass, action |
| Scale | Character | Use for |
|---|---|---|
| C major | Bright, happy, neutral | Upbeat, corporate, jingles |
| A minor | Melancholic, emotional | Drama, introspective, cinematic |
| D major | Triumphant, warm | Celebrations, victories |
| E minor | Dark, mysterious | Suspense, tension, games |
| G major | Pastoral, gentle | Nature, relaxation |
| F major | Warm, peaceful | Lullabies, calm backgrounds |
| Value | Effect |
|---|---|
| 0.1-0.3 | Very predictable, stays close to prompt description |
| 0.4-0.6 | Balanced — follows prompt but adds some variation |
| 0.7-0.9 | Creative — more experimental and surprising results |
| 1.0+ | Highly experimental — may diverge significantly from prompt |
When MEDIA_OUTPUT_DIR is set (recommended): The MCP server saves the generated audio to a file and returns only the file path. Always use just this path — do NOT request or embed the raw audio data. This is critical because all MCP request/response messages are stored in the conversation history, and large base64 payloads pollute the context window, degrading performance.
When MEDIA_OUTPUT_DIR is not set: The MCP server has no choice but to return the audio as base64 data in the response. This works but is suboptimal for conversation history size.