Skip to main content
Glama

Soundraw Game BGM MCP Server

An MCP (Model Context Protocol) server that enables AI agents to generate game background music. Uses DeepSeek for intelligent scene analysis and parameter generation, and Soundraw B2B API V3 for actual music generation.

šŸŽ¶ Why Game Developers ā¤ļø This

Modern games use dynamic, adaptive music — but composing custom BGM is costly and time-consuming.
soundraw-game-bgm automates composition by analyzing your game scenes and generating royalty-free background music that fits the mood and gameplay context.

It even outputs ready-to-use integration code for Unity and Unreal Engine so you can drop the track in with no extra engineering work.

Architecture

Game Dev Agent (Claude/Cursor)
    ↓ calls MCP tool
MCP Server (soundraw-game-bgm)
    ↓ uses DeepSeek API for reasoning
DeepSeek analyzes game context
    ↓ generates Soundraw parameters (moods, genres, themes, tempo, energy)
Soundraw API generates actual music
    ↓ async: returns request_id → poll for result
Game Dev Agent receives share_link + audio_url

Related MCP server: Unreal Engine MCP Server

Features

  • Cost-Optimized: Uses DeepSeek (~90% cheaper than Claude) for scene analysis

  • 4 MCP Tools: Full suite for game audio needs

  • Real Soundraw API: Uses B2B API V3 with proper async handling

  • Engine Integration: Auto-generated code snippets for Unreal, Unity, and Godot

  • Adaptive Audio: Stem muting for dynamic game audio layers

Installation

git clone https://github.com/yksanjo/soundraw-game-bgm.git
cd soundraw-game-bgm
npm install
npm run build

Configuration

Create a .env file:

DEEPSEEK_API_KEY=sk-your-deepseek-api-key
SOUNDRAW_API_KEY=your-soundraw-bearer-token

Testing API Connections

Before using the MCP server, verify your API keys work:

# Quick test (checks API connections only)
npm run test:apis

# Full test (generates a 10-second track - uses API credits)
npm run test:apis:full

Expected output:

šŸŽ® Soundraw Game BGM MCP Server - API Test

==================================================
Testing DeepSeek API
==================================================
API Key: sk-xxxxxx...
āœ… DeepSeek Response: "DeepSeek OK"

==================================================
Testing Soundraw API Connection
==================================================
API Key: xxxxxxxxxx...
āœ… Soundraw Account: Number of queries: X from ...

==================================================
Testing Soundraw Tags Endpoint
==================================================
āœ… Available genres for "Epic" mood: Orchestra, Electronica...
āœ… Available themes: Gaming, Cinematic...

==================================================
Test Summary
==================================================
āœ… DeepSeek API
āœ… Soundraw Connection
āœ… Soundraw Tags
āŒ Music Generation (skipped without --full flag)

šŸŽ‰ Core APIs working! Ready to use the MCP server.

MCP Tools

1. generate_bgm

Generate background music based on game scene description.

Input:

{
  "scene": "boss_fight",
  "game_genre": "dark_souls_like",
  "intensity": "high",
  "mood": "epic",
  "duration_seconds": 60,
  "engine": "unreal",
  "file_format": "m4a"
}

Output:

{
  "share_link": "https://soundraw.io/edit_music?m=...",
  "audio_url": "https://..../final_xxx.m4a",
  "request_id": "...",
  "duration_seconds": 60,
  "bpm": 140,
  "timestamps": [{"start": 0, "end": 15, "energy": "Low"}, ...],
  "file_format": "m4a",
  "integration_code": "// Unreal Engine 5 integration...",
  "deepseek_reasoning": "Boss fights need epic orchestral...",
  "soundraw_params": {"moods": ["Epic", "Dark"], "genres": ["Orchestra"], ...}
}

2. get_bgm_variations

Generate variations of existing BGM.

Input:

{
  "share_link": "https://soundraw.io/edit_music?m=...",
  "variation_type": "similar",
  "length": 60
}

Or customize energy/stems:

{
  "share_link": "https://soundraw.io/edit_music?m=...",
  "variation_type": "customize",
  "energy_preset": "building",
  "mute_stems": ["me"]
}

Stem codes: bc (backing), bs (bass), dr (drums), me (melody), fe (fill end), ff (fill start)

3. adaptive_layer_control

Generate multiple versions with different stems muted for adaptive audio.

Input:

{
  "share_link": "https://soundraw.io/edit_music?m=...",
  "layers_to_keep": ["drums", "bass", "melody", "backing"]
}

Output: Separate audio URLs for each layer + JavaScript integration code for runtime mixing.

4. scene_transition_music

Generate transition music between scenes.

Input:

{
  "from_scene": "peaceful village exploration",
  "to_scene": "intense boss battle",
  "transition_type": "stinger",
  "duration_seconds": 15
}

Transition Types:

  • fade: Gradual energy shift

  • stinger: Dramatic accent

  • crossfade: Smooth blend

Usage with Claude Code

Add to ~/.mcp.json:

{
  "mcpServers": {
    "soundraw-game-bgm": {
      "command": "node",
      "args": ["/path/to/soundraw-game-bgm/dist/index.js"],
      "env": {
        "DEEPSEEK_API_KEY": "sk-your-key",
        "SOUNDRAW_API_KEY": "your-bearer-token"
      }
    }
  }
}

Then restart Claude Code and try:

Generate epic boss battle music for my Dark Souls-like game, 60 seconds, with Unreal Engine integration code

Soundraw API Parameters

The server maps game scenes to these Soundraw parameters:

Moods: Angry, Busy & Frantic, Dark, Dreamy, Elegant, Epic, Euphoric, Fear, Funny & Weird, Glamorous, Happy, Heavy & Ponderous, Hopeful, Laid Back, Mysterious, Peaceful, Restless, Romantic, Running, Sad, Scary, Sentimental, Sexy, Smooth, Suspense

Genres: Acoustic, Hip Hop, Beats, Funk, Pop, Drum n Bass, Trap, Tokyo night pop, Rock, Latin, House, Tropical House, Ambient, Orchestra, Electro & Dance, Electronica, Techno & Trance, Jersey Club, Drill, R&B, Lofi Hip Hop, World, Afrobeats, Christmas

Themes: Ads & Trailers, Broadcasting, Cinematic, Corporate, Comedy, Cooking, Documentary, Drama, Fashion & Beauty, Gaming, Holiday Season, Horror & Thriller, Motivational & Inspiring, Nature, Photography, Sports & Action, Technology, Travel, Tutorials, Vlogs, Wedding & Romance, Workout & Wellness

Tempo: low (<100 bpm), normal (100-125 bpm), high (>125 bpm)

Energy Levels: Muted, Low, Medium, High, Very High

Development

# Run in development mode (watches for changes)
npm run dev

# Type check
npm run typecheck

# Build
npm run build

# Run built version
npm start

# Test API connections
npm run test:apis

Cost

Component

Purpose

Cost

DeepSeek

Scene analysis → Soundraw params

~$0.001/request

Soundraw

Music generation

Per your B2B plan

DeepSeek handles the reasoning at ~90% less cost than Claude API.

License

MIT

Available Tools

4 tools
adaptive_layer_controlA

Generate multiple versions of a track with different stems muted for adaptive game audio. Creates separate audio files for each layer configuration that can be mixed in real-time based on gameplay.

ParametersJSON Schema
NameRequiredDescriptionDefault
share_linkYesThe share_link URL from a previous generate_bgm result
layers_to_keepYesWhich layers to generate isolated versions for. Each layer creates a version with other layers muted.
file_formatNoAudio format (default: m4a)

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It discloses that the tool creates separate audio files for real-time mixing, but does not mention output details, potential side effects, or error conditions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core action, and contains no unnecessary words. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description does not specify how results are returned (e.g., file paths or links) and omits dependencies like requiring a share_link from generate_bgm. Given no output schema, more detail on the output format would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear descriptions for each parameter. The description adds value by explaining that each selected layer creates a version with other layers muted, clarifying the enum behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: generating multiple versions of a track with different stems muted for adaptive game audio. It distinguishes from siblings like generate_bgm (initial generation) and get_bgm_variations (retrieving existing variations).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for adaptive game audio but does not explicitly state when to use this tool versus alternatives or when not to use it. It provides context but lacks explicit guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

generate_bgmA

Generate background music for a game scene. Uses DeepSeek to analyze the scene and map to Soundraw parameters, then generates music via Soundraw API. Returns audio URL, share link, and optional game engine integration code.

ParametersJSON Schema
NameRequiredDescriptionDefault
sceneYesScene type (e.g., "boss_fight", "exploration", "cutscene", "menu", "combat", "stealth", "horror")
game_genreYesGame genre (e.g., "dark_souls_like", "jrpg", "fps", "puzzle", "horror", "platformer", "metroidvania")
intensityYesMusic intensity level
moodNoOptional mood hint (e.g., "epic", "melancholic", "mysterious", "peaceful", "tense")
duration_secondsNoTrack duration in seconds (10-300, default: 60)
engineNoGame engine for integration code snippets
file_formatNoAudio file format (default: m4a, recommended for quality/size)

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It discloses the internal pipeline (DeepSeek analysis, Soundraw API mapping), returns (audio URL, share link, integration code), and the generation process. This provides meaningful transparency beyond a simple 'generate music' statement, though cost or external dependencies are not mentioned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences: purpose, process, outputs. It is front-loaded with the core action and contains no extraneous information. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description adequately covers returns. All 7 parameters have schema descriptions. However, missing context about prerequisites (authentication, account), limits, or side effects. Sibling tool integration is not addressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value by explaining how parameters are used (DeepSeek maps scene to Soundraw params) and listing return fields not in schema. This enriches understanding beyond the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool generates background music for a game scene, naming a specific verb and resource. It distinguishes from siblings like get_bgm_variations (which gets existing variations) and scene_transition_music (for transitions) by focusing on generating new music.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for generating background music but lacks explicit guidance on when to use this tool versus alternatives like get_bgm_variations or scene_transition_music. No context on prerequisites or conditions is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_bgm_variationsA

Generate a variation of an existing BGM using Soundraw. Use "similar" to create a new song with similar style, or "customize" to adjust energy levels or mute stems of the original.

ParametersJSON Schema
NameRequiredDescriptionDefault
share_linkYesThe share_link URL from a previous generate_bgm result (e.g., https://soundraw.io/edit_music?m=...)
variation_typeYes"similar" creates a new song with similar style. "customize" adjusts energy/stems of existing song.
lengthNoLength for similar track in seconds (10-300). Only used with "similar" type.
energy_presetNoEnergy preset for customize. Only used with "customize" type.
mute_stemsNoStems to mute: bc (backing), bs (bass), dr (drums), me (melody), fe (fill end), ff (fill start)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of disclosing behavioral traits. It mentions generating a variation but does not explicitly state whether the original is modified, whether it is a read-only operation, or any side effects. The description is adequate but not exhaustive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, with two sentences. The first states the tool's purpose, and the second explains the two variation types. No wasted words; front-loaded with key information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters (2 required) and no output schema, the description adequately covers the two variation modes and their usage. It could mention that length is only for similar and energy_preset/mute_stems only for customize, but the schema already does that. Overall, it is complete enough for an agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds little beyond schema: it restates the two variation types and their purpose. It does not provide additional semantic details for parameters such as length, energy_preset, or mute_stems beyond what the schema already conveys.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool generates a variation of an existing BGM using Soundraw, and it distinguishes between two specific variation types ('similar' and 'customize'). This verb+resource description is specific and differentiates from sibling tools like generate_bgm which creates from scratch.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use each variation type: 'similar' for creating a new song with similar style, 'customize' for adjusting energy or muting stems. It does not explicitly say when not to use this tool (e.g., vs. generate_bgm), but the purpose implicitly guides the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

scene_transition_musicA

Generate transition music between two game scenes. Uses DeepSeek to analyze the emotional journey between scenes and creates appropriate transition audio with dynamic energy levels.

ParametersJSON Schema
NameRequiredDescriptionDefault
from_sceneYesDescription of the starting scene (e.g., "peaceful village exploration", "tense stealth section")
to_sceneYesDescription of the target scene (e.g., "intense boss battle", "emotional cutscene")
transition_typeYes"fade" = gradual energy shift, "stinger" = dramatic accent, "crossfade" = smooth blend
duration_secondsYesTransition duration in seconds (10-60)

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description discloses use of AI for analysis and dynamic energy levels, but fails to mention whether it modifies existing audio, return format, or potential latency. Limited behavioral context beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences with clear front-loading of purpose. No unnecessary words. Efficient and to the point.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having no output schema, the description does not mention what the tool returns (e.g., audio file, URL). Lacks details on side effects, synchronization, or integration with game engine. Incomplete for an agent to fully understand impact.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema covers all parameters with descriptions (100% coverage). The description adds no new parameter meaning beyond what the schema provides, so baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the tool generates transition music between game scenes, specifying the use of DeepSeek for emotional analysis. It distinguishes itself from siblings like generate_bgm by focusing on scene transitions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use for scene transitions but lacks explicit guidance on when to use this over alternatives like generate_bgm or adaptive_layer_control. No exclusions or when-not-to-use scenarios are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv1.0.0
    • First observedadaptive_layer_control
    • First observedgenerate_bgm
    • First observedget_bgm_variations
    • First observedscene_transition_music

TDQS

A4/5.0
Disambiguation4/5

Each tool has a distinct purpose (generation, adaptation, variation, transition). Some slight overlap between adaptive_layer_control and get_bgm_variations regarding stems, but descriptions clarify the different contexts (real-time mixing vs. variation creation).

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in snake_case (e.g., generate_bgm, get_bgm_variations). No mixing of conventions or irregular naming.

Tool Count5/5

Four tools cover the essential functionalities for game background music generation: initial generation, adaptive layering, variations, and transitions. This is well-scoped and not excessive.

Completeness4/5

The set covers core operations but lacks a tool for listing or deleting existing BGMs. Otherwise, the lifecycle from generation to adaptation to variation to transition is well-covered.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yksanjo/soundraw-game-bgm'

If you have feedback or need assistance with the MCP directory API, please join our Discord server