Skip to main content

MCP server for generating sound effects using Meta's AudioGen

Project description

AudioGen MCP Server

PyPI version License: MIT

An MCP server that generates sound effects from text descriptions using Meta's AudioGen model. Designed for Apple Silicon Macs.

Prerequisites

  • macOS with Apple Silicon (M1/M2/M3/M4)
  • Python 3.9-3.11 (3.12+ not yet supported by audiocraft)
  • ffmpeg: brew install ffmpeg
  • ~4GB disk space for model weights
  • ~8GB RAM recommended

Installation

Due to audiocraft's complex dependencies, installation requires a virtual environment:

# Create virtual environment with Python 3.11
uv venv ~/.audiogen-env --python 3.11
source ~/.audiogen-env/bin/activate

# Install dependencies
uv pip install torch torchaudio

# Install audiocraft (may take a few minutes to build)
uv pip install audiocraft --no-build-isolation

# Install audiogen-mcp
uv pip install audiogen-mcp

The first run will download the AudioGen model (~2GB).

Configure Claude Code

claude mcp add audiogen ~/.audiogen-env/bin/python -- -m audiogen_mcp.server

Or add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "audiogen": {
      "command": "/Users/YOUR_USERNAME/.audiogen-env/bin/python",
      "args": ["-m", "audiogen_mcp.server"]
    }
  }
}

Available Tools

Tool Description
generate_sound_effect Generate a single sound effect from text
generate_batch_sound_effects Generate multiple sounds at once
list_generated_sounds List previously generated files
get_model_status Check model and device status

Example Prompts

Once configured, ask Claude Code to generate sounds:

  • "Generate an explosion sound effect"
  • "Create UI sounds: click, hover, and error"
  • "Make a retro 8-bit power-up sound, 2 seconds long"
  • "Generate footsteps on gravel, 5 seconds"

Prompt Tips

For best results, be specific:

# Good
"glass breaking, single wine glass falling on tile floor"
"8-bit arcade explosion, retro game style"
"button click, soft, satisfying UI sound"

# Less good
"glass sound"
"explosion"
"click"

Include style, mood, and context for better results.

Performance

  • ~60 seconds to generate 5 seconds of audio
  • First generation takes longer (model loading)
  • Uses Metal Performance Shaders (MPS) for GPU acceleration

Output

Generated files save to ~/audiogen_outputs/ by default as WAV files.

Troubleshooting

Installation fails with xformers error

This is expected on Apple Silicon. The server mocks xformers at runtime since it's only needed for CUDA. If audiocraft installation fails, try:

uv pip install torch torchaudio
uv pip install audiocraft --no-build-isolation

Model download fails

Ensure stable internet and sufficient disk space. The model downloads from HuggingFace Hub.

Slow generation

Check device with get_model_status tool. CPU fallback is 10-20x slower than MPS.

MPS not available

Requires macOS 12.3+ and PyTorch 2.0+.

License

MIT License - see LICENSE file.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audiogen_mcp-0.1.2.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

audiogen_mcp-0.1.2-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file audiogen_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: audiogen_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.16

File hashes

Hashes for audiogen_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f527e54d2c236e2d3e1d0f623d2b494e3ab6261839c3234e68c014ef7b2ddab5
MD5 a826817049244c84900d75a7a5244d6e
BLAKE2b-256 4651c94d9d1774b250fac2deca1eb1dbdc26a9cfae6035e85579bc9ed7f9f39e

See more details on using hashes here.

File details

Details for the file audiogen_mcp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for audiogen_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 01612f94ce04373bd34e391616a31fdd238f58220726414e1e003b85e5990b79
MD5 3c4171799868f92346234a2be1faf815
BLAKE2b-256 09704198f6c2fa1dd8fd576e7d62f702a1cf9b4e5b02fe543cd0b8b53fa5039e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page