**Audio Studio MCP** gives Claude Code, Claude Desktop, Cursor and any other [MCP](https://modelcontextprotocol.io) client a sound studio that runs on your own Mac or Windows PC. Ask for background music or a sound effect in plain language; the model generates it locally with [Stable Audio 3](https://github.com/Stability-AI/stable-audio-3). Then it can loop it, normalize the loudness and export it for your game engine or video editor. There is no cloud service and no API key, and generating doesn't cost anything.
To make a song with vocals, give YuE2 your lyrics and a musical style. The optional model generates vocals and accompaniment on your computer.
A real session, shortened. Claude picked a loop length of exactly 11 bars so the beat stays in time when it repeats.
## ✨ Highlights
Generate BGM, instrument loops and sound effects from one sentence, 1–4 candidates per call
Edit Re-style a whole clip, regenerate a time range, or extend a track
Local Runs on Apple Silicon (MLX) or an NVIDIA GPU (PyTorch). Nothing is uploaded
- **Listen in the chat:** in Claude Desktop and other clients with MCP Apps, results show up as a player in the conversation. Compare versions, export, or ask for more without opening a file. See [Listen in the chat](#-listen-in-the-chat).
- **Reproducible:** every file gets a `.json` sidecar with its prompt, seed and settings.
- **Prompting built in:** the server teaches the client the official Stable Audio 3 prompt format, so a request like "make it sound like a creaky door" becomes a prompt the model understands.
- **Same output as upstream:** on a Mac, results for the same seed are bit-for-bit identical to the official `sa3` CLI. On Windows it calls the official Stable Audio 3 PyTorch API.
## 🎧 Hear it
### Vocal song samples
- [English vocal · Porch Light at Dawn](https://kanaworksai-hue.github.io/audio-studio-mcp/#porch_light_at_dawn)
- [Japanese vocal · 雨上がりの坂道](https://kanaworksai-hue.github.io/audio-studio-mcp/#ameagari_no_sakamichi)
### Instrumental music and sound effects
The instrumental and sound effect samples in the table were generated with Stable Audio 3 on an M1 Mac without manual editing. **[Open the sample page →](https://kanaworksai-hue.github.io/audio-studio-mcp/)**
| | Sample | Prompt |
|---|---|---|
| | [**Lo-fi cafe**](https://kanaworksai-hue.github.io/audio-studio-mcp/#lofi_cafe) music · 30 s · 85 BPM | Lo-fi hip-hop chill track with mellow electric piano, soft vinyl crackle, low-pass filtered drums… |
| | [**Epic orchestral**](https://kanaworksai-hue.github.io/audio-studio-mcp/#epic_orchestral) music · 30 s | Epic cinematic orchestral trailer music with thundering taiko drums, soaring French horns… |
| | [**Chiptune adventure**](https://kanaworksai-hue.github.io/audio-studio-mcp/#chiptune_adventure) music · 20 s · 150 BPM | Upbeat 8-bit chiptune adventure theme with a bright square wave lead… |
| | [**Glass shatter**](https://kanaworksai-hue.github.io/audio-studio-mcp/#glass_shatter) sfx · 3 s | source: glass bottle · action: shattering on impact · material: thick green glass · space: concrete floor |
| | [**Rain & thunder**](https://kanaworksai-hue.github.io/audio-studio-mcp/#rain_thunder) sfx · 12 s | source: heavy rain and distant thunder · space: outdoor forest at night, wide stereo |
| | [**Synthwave, extended**](https://kanaworksai-hue.github.io/audio-studio-mcp/#synthwave_drive_extended) edit · 20 s → 40 s | `edit_audio` continue: a 20-second track extended to 40 seconds |
MP3s are in [`docs/samples/`](docs/samples), with prompts and seeds in [`samples.json`](docs/samples/samples.json).
## 🧭 How it works
```mermaid
flowchart LR
U["You “make a cozy cafe BGM”"] --> C["Claude Code · Desktop Cursor · any MCP client"]
C -- "MCP" --> S["audio-studio-mcp generate · edit · process · generate_song"]
S --> M["Stable Audio 3 MLX on Apple Silicon PyTorch on NVIDIA GPUs"]
S --> Y["YuE2 Metal / CUDA"]
M --> F["WAV / OGG / FLAC + .json ready for game & video"]
Y --> F
```
## 🚀 Quick start
You need [uv](https://docs.astral.sh/uv/) 0.9.20 or newer and [ffmpeg](https://ffmpeg.org). There is nothing to clone: `uvx` downloads and runs the published package.
The setup below installs Stable Audio 3 for instrumental audio and effects. For vocals, run `song-setup` as shown in the [YuE2 setup guide](docs/song-generation.md#install-when-needed).
| | macOS | Windows |
|---|---|---|
| **Hardware** | Apple Silicon (M1 or later), 16 GB RAM recommended | NVIDIA GPU with 8 GB of VRAM or more and a current driver. Tested on an RTX 3060 12 GB |
| **Disk** | About 8 GB (model ~6.9 GB) | About 14 GB (model ~10.4 GB, PyTorch) |
| **uv and ffmpeg** | `brew install uv ffmpeg` | `winget install astral-sh.uv` and `winget install Gyan.FFmpeg` |
| **Model license** | Nothing to do | Needs a free [Hugging Face](https://huggingface.co) account: open [stabilityai/stable-audio-3-medium](https://huggingface.co/stabilityai/stable-audio-3-medium) and accept the license once |
**1. Set it up once, in a terminal.** This checks your computer, fetches the official Stable Audio 3 runtime at a tested commit, tells you how big the model download is and asks before downloading it. Running it again is safe; finished downloads are kept.
```bash
# macOS
uvx --python 3.11 audio-studio-mcp setup
```
```powershell
# Windows
uvx --python 3.11 --torch-backend cu126 audio-studio-mcp setup
```
`--torch-backend cu126` makes uv install the CUDA build of PyTorch (PyPI only has the CPU build for Windows), and `--python 3.11` keeps uv away from a Python that PyTorch doesn't support yet. If uvx answers `unexpected argument '--torch-backend'`, your uv is too old: update it with `winget upgrade astral-sh.uv` (or `uv self update`). On Windows, if you aren't logged in to Hugging Face yet, setup prints the steps: accept the license on the model page, then log in **in your own terminal** with `uvx --from huggingface_hub hf auth login` and run setup again.
Setup downloads the **medium** model. For the small, fast models add `--model sm-music`, `--model sm-sfx` or `--model all`, and set `AUDIO_STUDIO_SA3_MODEL` in your client config (see [Configuration](#️-configuration)).
**2. Register it with your MCP client.** Use the same command without `setup`:
```bash
# Claude Code, macOS
claude mcp add --scope user audio-studio -- uvx --python 3.11 audio-studio-mcp
# Claude Code, Windows
claude mcp add --scope user audio-studio -- uvx --python 3.11 --torch-backend cu126 audio-studio-mcp
```
Claude Desktop, Codex, VS Code, Cursor and other clients
On Windows, add `"--torch-backend", "cu126"` after `"3.11"` in each example below.
**Claude Desktop** (`claude_desktop_config.json`), **Cursor** (`.cursor/mcp.json`) and most other clients:
```json
{
"mcpServers": {
"audio-studio": {
"command": "uvx",
"args": ["--python", "3.11", "audio-studio-mcp"]
}
}
}
```
If the client says it can't find `uvx`, put its full path in `command` (`which uvx` on macOS, `where uvx` on Windows). Restart Claude Desktop after editing.
**Codex** (`~/.codex/config.toml`). Codex waits only 10 seconds for a server to start and 60 seconds for a tool call by default; long tracks need more:
```toml
[mcp_servers.audio-studio]
command = "uvx"
args = ["--python", "3.11", "audio-studio-mcp"]
startup_timeout_sec = 60
tool_timeout_sec = 900
```
**VS Code** (`.vscode/mcp.json`, or **MCP: Open User Configuration**):
```json
{
"servers": {
"audio-studio": {
"type": "stdio",
"command": "uvx",
"args": ["--python", "3.11", "audio-studio-mcp"]
}
}
}
```
Generated files go to `~/AudioStudio` (set `AUDIO_STUDIO_OUTPUT_DIR` to change it). uvx keeps the version it installed; to update, run `uv cache clean audio-studio-mcp` and then setup again.
### Optional: enable vocal songs
Audio Studio MCP 1.3.0 or later can set up YuE2 independently of Stable Audio 3. The Q4_0 and Q8_0 weights follow the YuE2 model terms. On macOS, use Apple Silicon and Xcode with the Metal compiler. On Windows x64, use a supported NVIDIA CUDA GPU. See the [YuE2 setup guide](docs/song-generation.md#install-when-needed) for compatible drivers, model terms, and download sizes.
```bash
# macOS
uvx --python 3.11 audio-studio-mcp song-setup
```
```powershell
# Windows
uvx --python 3.11 --torch-backend cu126 audio-studio-mcp song-setup
```
Run the command for your platform and review the model terms at the prompt. Add `--check` to inspect the YuE2 runtime, weights and device readiness without downloading. Use the existing MCP registration for both models.
> [!TIP]
> **Let your agent install it.** Paste this into Claude Code:
> *"Install the Audio Studio MCP server (https://github.com/kanaworksai-hue/audio-studio-mcp) by following its README, including the notes for AI agents."*
>
> If you want songs with vocals, mention that in your request.
>
> **Notes for AI agents:**
> - Install Stable Audio 3 with the platform's `setup -y` command when the user needs instrumental BGM or sound effects. Allow time for the model download.
> - On Windows the Stable Audio 3 weights are gated and need the user's own Hugging Face login. If setup stops with the login steps, pass them on to the user and wait until they say they are done, then run setup again. Never ask the user to paste their token into the chat.
> - For vocals, run the platform's `song-setup` command with `--check` first. If YuE2 needs installation, show the user the model terms and download size. In a non-interactive session, add `--accept-license` only after the user accepts the YuE2 terms. Run `--check` again after installation.
> - Register the MCP server once for either setup. Use `generate_audio` for BGM and sound effects. Use `generate_song` with the original lyrics and a style for vocals, then poll `song_status` with the returned job ID until it reports `done`, `error` or `cancelled`. The WAV is available on `done`.
### Alternative: install from source
The install scripts from earlier versions still work. They clone the repository, put the runtime in `vendor/` and the audio in `outputs/` inside it, and run from `.venv/`.
#### macOS (Apple Silicon)
**Requirements:**
- Apple Silicon Mac (M1 or later), 16 GB RAM recommended
- About 8 GB of disk (model ~6.9 GB)
- `git` and [`ffmpeg`](https://ffmpeg.org) (`brew install ffmpeg`)
```bash
git clone https://github.com/kanaworksai-hue/audio-studio-mcp.git
cd audio-studio-mcp
./install.sh
```
The installer sets up [`uv`](https://docs.astral.sh/uv/) if needed, clones the official Stable Audio 3 runtime into `vendor/` at a tested commit, creates `.venv/`, and downloads the **medium** model (1.4B, ~6.9 GB) from [Hugging Face](https://huggingface.co/stabilityai/stable-audio-3-optimized). It finishes by printing the exact command to register the server:
```bash
claude mcp add --scope user audio-studio -- /path/to/audio-studio-mcp/.venv/bin/audio-studio-mcp
```
#### Windows (NVIDIA GPU)
**Requirements:**
- 64-bit Windows 10 or 11 with an NVIDIA GPU (8 GB of VRAM or more) and a current driver. Tested on an RTX 3060 12 GB
- About 14 GB of disk for the model and PyTorch
- `git` (`winget install Git.Git`) and [`ffmpeg`](https://ffmpeg.org) (`winget install Gyan.FFmpeg`)
- A free [Hugging Face](https://huggingface.co) account. The PyTorch weights are gated: open [stabilityai/stable-audio-3-medium](https://huggingface.co/stabilityai/stable-audio-3-medium) and accept the license once
```powershell
git clone https://github.com/kanaworksai-hue/audio-studio-mcp.git
cd audio-studio-mcp
powershell -ExecutionPolicy Bypass -File install.ps1
```
The installer does the same steps as on macOS, but installs PyTorch with CUDA and downloads the official PyTorch checkpoint of the **medium** model (~10.4 GB). If you aren't logged in to Hugging Face yet, it asks for an access token with read permission ([create one here](https://huggingface.co/settings/tokens)). When it runs without a console (for example, started by an AI agent), it never asks: it prints the steps to log in and stops, and you re-run it after logging in. It finishes by printing the command to register the server:
```powershell
claude mcp add --scope user audio-studio -- "C:\path\to\audio-studio-mcp\.venv\Scripts\audio-studio-mcp.exe"
```
Flash Attention is not needed. Without it, the runtime falls back to PyTorch's built-in attention.
Claude Desktop, Cursor and other clients
Add this to `claude_desktop_config.json`, `.cursor/mcp.json` or your client's MCP config:
```json
{
"mcpServers": {
"audio-studio": {
"command": "/path/to/audio-studio-mcp/.venv/bin/audio-studio-mcp"
}
}
}
```
On Windows the command is `C:\\path\\to\\audio-studio-mcp\\.venv\\Scripts\\audio-studio-mcp.exe` (backslashes doubled in JSON).
Installer options
| macOS | Windows | Effect |
|---|---|---|
| `--model all` | `-Model all` | Also download the small, fast `sm-music` and `sm-sfx` models (+2.6 GB on macOS, +7 GB on Windows) |
| `--skip-weights` | `-SkipWeights` | Don't download now; the first generation downloads them |
| `-y` | `-Yes` | Install `uv` without asking |
On macOS, downloads are anonymous; logging in with `hf auth login` raises Hugging Face's rate limit. On Windows, the PyTorch weights are gated: accept the license on each model page you download ([medium](https://huggingface.co/stabilityai/stable-audio-3-medium), [small-music](https://huggingface.co/stabilityai/stable-audio-3-small-music), [small-sfx](https://huggingface.co/stabilityai/stable-audio-3-small-sfx)) and log in.
Then just ask:
- "Make a 60-second lo-fi BGM loop at 85 BPM for a cafe scene, give me 3 candidates."
- "I need a heavy wooden door slamming in a stone hallway. Export it as OGG for Godot."
- "Extend this track to 90 seconds and normalize it to −16 LUFS."
## 🧰 Tools
| Tool | What it does |
|---|---|
| `generate_audio` | Text to BGM, instrument loop/stem or sound effect. 1–4 candidates per call, `bpm`, structured SFX fields |
| `generate_song` | Generate vocals and accompaniment from lyrics and a style with YuE2 |
| `song_status` | Check a song job’s progress and retrieve the result |
| `cancel_song` | Cancel a queued or running song job |
| `edit_audio` | `variation` (re-style the whole clip), `inpaint` (regenerate a time range), `continue` (extend). 1–4 candidates |
| `process_audio` | Trim → trim silence → mono → resample / loudness → seamless loop → fades → peak normalize or ceiling → WAV / OGG / FLAC. Never modifies the input |
| `unload_models` | Free the model memory right away |
Parameter notes
- **`audio_type`**: `music` / `instrument` / `sfx` / `raw`. The server adds the prefix the model was trained with (`TrackType: Music, VocalType: Instrumental,` …). Without the SFX prefix, sound effects often come out as music.
- **`variations`**: 1–4 candidates with seeds `seed, seed+1, …`. Use `seed: -1` or leave it out for a random seed.
- **`sound_source` / `sound_action` / `sound_material` / `sound_space`**: describe a sound effect by what makes it, how it evolves, its texture and the space it is in.
- **`peak_ceiling_db`** (default −1): a safety ceiling. Louder peaks are turned down and quieter audio is never boosted. Use `process_audio` to normalize.
- **`process_audio` normalization**: `peak` is common for SFX. `loudness` normalizes to a target LUFS: −14 for streaming/video, −16 for game BGM, −23 for broadcast.
Generated files are 44.1 kHz 24-bit stereo WAV, written to the output folder (`~/AudioStudio`, or `outputs/` in a source install; see `AUDIO_STUDIO_OUTPUT_DIR`). Each one has a `.json` next to it. Processed files keep the original generation info under `source`.
## 🌐 Web UI
Prefer clicking to chatting? The same server comes with a local web page. Generate BGM and sound effects, compare the candidates, edit them (make a variation, replace a part, extend), export them for your game or video, and browse everything you've made in the library.
```bash
uvx --python 3.11 audio-studio-mcp --web 8765
```
Your browser opens http://127.0.0.1:8765/. Add `--no-browser` to start without opening it, or `--preload` to load the model at startup. Press Ctrl+C to stop it. On Windows, add `--torch-backend cu126` after `3.11`. From a source install: `.venv/bin/audio-studio-mcp --web 8765` (Windows: `.venv\Scripts\audio-studio-mcp.exe --web 8765`).
The page and your MCP clients can share one process and one loaded model: the same port also serves MCP at `/mcp`. Register it once and use both at the same time. Requests from the page and from agents wait in one queue.
```bash
claude mcp add --scope user --transport http audio-studio http://127.0.0.1:8765/mcp
```
- Files are written to the output folder (`~/AudioStudio`, `outputs/` in a source install, or `AUDIO_STUDIO_OUTPUT_DIR`). The library shows that folder, and the editor works on the files in it.
- The page is in English, Japanese and Chinese and follows your browser's language. You can change it in the settings.
> [!WARNING]
> The web UI is for your own computer only. It listens on `127.0.0.1` only and has no login. Don't make it reachable from other machines (port forwarding, a reverse proxy or a tunnel): anyone who can open it can use your GPU and write files to your output folder.
### Songs with vocals
The **Songs** tab and the `generate_song` MCP tool can generate vocals and accompaniment from lyrics using the optional YuE2 model on Apple Silicon or Windows x64 with an NVIDIA CUDA GPU. Memory and VRAM readings inform Auto recommendations. You can still try generating with either installed profile. See the [song setup and usage guide](docs/song-generation.md) for the model terms, download sizes, and Auto settings.
## 💬 Listen in the chat
In clients that support [MCP Apps](https://modelcontextprotocol.io/extensions/apps/overview), the results of `generate_audio`, `edit_audio`, `process_audio` and `generate_song` appear as a player right in the conversation. You don't have to open the files yourself. A song card shows its progress until the WAV is ready.
Three versions of a dungeon loop, real model output, shown in the MCP Apps reference host.