suno-mcp
Provides AI music generation capabilities using the Suno API, allowing users to generate music, retrieve track information, and manage API credits.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@suno-mcpgenerate a pop song about summer vibes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Suno MCP Server
A Model Context Protocol (MCP) server that provides AI music generation capabilities using the Suno API. This server allows Claude and other MCP clients to generate music, retrieve track information, and manage API credits through a simple tool interface.
✨ Features automatic Docker builds via GitHub Actions - always get the latest version with docker pull!
Features
Generate Music: Create AI-generated music from text prompts with customizable parameters
WAV Conversion: Convert generated MP3 tracks to high-quality WAV format
Track Status Monitoring: Check generation progress and retrieve completed track information using task IDs
Track Information: Retrieve detailed information about generated tracks including status, URLs, and metadata using track IDs
Credit Management: Check API credit balance and usage statistics
Multiple Model Versions: Support for Suno v3.5, v4, v4.5, v4.5plus, v5, and v5.5 models (v5.5 recommended for the best quality)
Custom Mode: Fine-tune generation with exact lyrics, specific genre tags, and advanced controls
Advanced Controls: Style weighting, weirdness constraint, vocal gender selection, and more
Related MCP server: MusicGPT MCP Server
Prerequisites
Option 1 (Docker - Recommended): Docker and Docker Compose installed
Option 2 (Native Python): Python 3.10 or higher
A Suno API key (obtain from sunoapi.org)
An MCP-compatible client: Claude Desktop or Claude Code
Installation
Option 1: Docker Pull (Easiest - Recommended)
Pull the pre-built image directly from GitHub Container Registry - no code or build required!
Pull the Docker image:
docker pull ghcr.io/codekeanu/suno-mcp:latestCreate a
.envfile with your API key:
# Create a directory for your config
mkdir suno-mcp-config
cd suno-mcp-config
# Create .env file
cat > .env << EOF
SUNO_API_KEY=your_actual_api_key_here
SUNO_API_BASE_URL=https://api.sunoapi.org
EOFThat's it! Skip to the Usage section to configure Claude Desktop or Claude Code.
Option 2: Docker Build from Source
Build the Docker image yourself from source code.
Clone this repository:
git clone https://github.com/CodeKeanu/suno-mcp.git
cd suno-mcpConfigure your API key:
cp .env.example .envEdit
.envand add your Suno API key:
SUNO_API_KEY=your_actual_api_key_here
SUNO_API_BASE_URL=https://api.sunoapi.orgBuild the Docker image:
docker build -t suno-mcp-server:latest .
# Or use docker-compose:
docker-compose buildNote: If you build from source, use suno-mcp-server:latest in the configuration examples below instead of ghcr.io/codekeanu/suno-mcp:latest.
Option 3: Native Python Installation
Clone this repository:
git clone https://github.com/CodeKeanu/suno-mcp.git
cd suno-mcpInstall dependencies:
pip install -r requirements.txtConfigure your API key:
cp .env.example .envEdit
.envand add your Suno API key:
SUNO_API_KEY=your_actual_api_key_here
SUNO_API_BASE_URL=https://api.sunoapi.orgUsage
Usage with Claude Desktop
Claude Desktop is the official desktop application for Claude that supports MCP servers.
Docker Configuration (Recommended)
Locate your Claude Desktop configuration file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add the Suno MCP server configuration (replace
/absolute/path/to/.envwith your actual path):
{
"mcpServers": {
"suno": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--env-file",
"/absolute/path/to/.env",
"ghcr.io/codekeanu/suno-mcp:latest"
]
}
}
}Example paths:
macOS:
/Users/yourusername/suno-mcp-config/.envWindows:
C:\\Users\\yourusername\\suno-mcp-config\\.envLinux:
/home/yourusername/suno-mcp-config/.env
Important Notes:
Use absolute paths (full path from root), not relative paths
On Windows, use double backslashes (
\\) or forward slashes (/)Ensure Docker Desktop is running before starting Claude Desktop
The
.envfile must contain your valid Suno API keyThe image will be automatically pulled from GitHub Container Registry on first run
Restart Claude Desktop completely for changes to take effect
Test the integration by asking Claude:
"Can you check my Suno API credits?"
"Generate a short happy instrumental song"
Alternative: Environment Variables (No .env file needed)
If you prefer not to use a .env file, you can pass the API key directly:
{
"mcpServers": {
"suno": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"SUNO_API_KEY=your_actual_api_key_here",
"-e",
"SUNO_API_BASE_URL=https://api.sunoapi.org",
"ghcr.io/codekeanu/suno-mcp:latest"
]
}
}
}Native Python Configuration
For native Python (without Docker):
{
"mcpServers": {
"suno": {
"command": "python",
"args": ["/absolute/path/to/suno-mcp/server.py"],
"env": {
"SUNO_API_KEY": "your_actual_api_key_here",
"SUNO_API_BASE_URL": "https://api.sunoapi.org"
}
}
}
}Usage with Claude Code
Claude Code is a CLI tool for software development with Claude.
Docker Configuration (Recommended)
Option 1: Using Claude Code Settings UI
Open Claude Code settings
Navigate to MCP Servers section
Add a new server with:
Name:
sunoCommand:
dockerArguments:
["run", "--rm", "-i", "--env-file", "/absolute/path/to/.env", "ghcr.io/codekeanu/suno-mcp:latest"]Replace
/absolute/path/to/.envwith your actual path
Option 2: Manual Configuration
Add to your MCP settings file (typically ~/.config/claude-code/mcp_settings.json):
{
"mcpServers": {
"suno": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--env-file",
"/absolute/path/to/.env",
"ghcr.io/codekeanu/suno-mcp:latest"
]
}
}
}Important: Replace /absolute/path/to/.env with the actual path to your .env file.
Docker Flags Explained:
--rm: Automatically remove container when it exits-i: Keep stdin open for MCP stdio communication--env-file: Load environment variables from.envfile (keeps API key secure)
Native Python Configuration
Option 1: Using Claude Code Settings UI
Open Claude Code settings
Navigate to MCP Servers section
Add a new server with:
Name:
sunoCommand:
pythonArguments:
["/absolute/path/to/suno-mcp/server.py"]Environment Variables:
SUNO_API_KEY: Your API keySUNO_API_BASE_URL:https://api.sunoapi.org
Option 2: Manual Configuration
Add to your MCP settings file:
{
"mcpServers": {
"suno": {
"command": "python",
"args": ["/absolute/path/to/suno-mcp/server.py"],
"env": {
"SUNO_API_KEY": "your_actual_api_key_here",
"SUNO_API_BASE_URL": "https://api.sunoapi.org"
}
}
}
}Important:
Replace
/absolute/path/to/suno-mcp/server.pywith your actual pathRestart Claude Code after adding the configuration
Available Tools
The server exposes 6 MCP tools for music generation and management:
1. generate_music
Generate AI music from a text prompt with extensive customization options.
Parameters:
Core Parameters:
prompt(conditional): Text description/lyrics for the musicCustom Mode with vocals: Used as exact lyrics (max 3000-5000 chars depending on model)
Non-custom Mode: Used as core idea for auto-generated lyrics (max 500 chars)
Custom Mode instrumental: Not required if
make_instrumental=true
make_instrumental(optional, default: false): Generate instrumental only without vocalsmodel_version(optional, default: "v3.5"): AI model versionOptions: "v3.5", "v4", "v4.5", "v4.5plus", "v5", "v5.5"
Recommendation: Use "v5.5" for the best musical quality, or "v5" for superior musical expression and faster generation
wait_audio(optional, default: true): Wait for generation to complete before returning
Custom Mode Parameters:
custom_mode(optional, default: false): Enable advanced control modeWhen enabled, requires
styleandtitleparametersAllows exact lyrics specification and fine-grained style control
style(required if custom_mode=true): Music style/genre tags (max 200-1000 chars)Example: "orchestral epic, cinematic, powerful strings, dramatic choir"
title(required if custom_mode=true): Song title (max 80 chars)
Advanced Parameters:
callback_url(optional): Webhook URL for completion notificationNote: The Suno API may require this parameter. If generation fails with "Please enter callBackUrl", provide a URL (e.g., "https://example.com/webhook")
persona_id(optional): Persona identifier for stylistic influence (Custom Mode only)negative_tags(optional): Styles or traits to exclude (e.g., "aggressive, heavy metal")vocal_gender(optional): Preferred vocal gender ("m" or "f")style_weight(optional): Weight of style guidance (0.00-1.00)Higher values adhere more strictly to the specified style
weirdness_constraint(optional): Creative deviation tolerance (0.00-1.00)Higher values allow more experimental/unusual results
audio_weight(optional): Input audio influence weighting (0.00-1.00)
Returns:
Task ID for async generation tracking
Track information if
wait_audio=true
Example:
Generate a calm piano meditation piece using v5 model2. get_task_status
Get the status of a music generation task and retrieve track information once complete.
Parameters:
task_id(required): The task ID returned fromgenerate_music
Returns:
Task status (e.g., "TEXT_SUCCESS")
Operation type and model information
Track details including IDs, titles, audio URLs, and metadata when generation is complete
Example:
Check status of task: 684b694f002afbb35b49994b32a6a01eNote: This tool uses task IDs (not track IDs). Use this to monitor async generations started with wait_audio=false or to retrieve information about recently completed generations.
3. get_music_info
Get detailed information about specific tracks using track IDs.
Parameters:
track_ids(required): Array of track IDs to retrieve information for
Returns:
Detailed track information including status, URLs, duration, tags, and creation time
Example:
Get information for tracks: ["7752c889-3601-4e55-b805-54a28a53de85", "be973545-05f9-4a00-9177-81d4ce0ed5c1"]Note: This tool uses specific track IDs (not task IDs). Track IDs are returned from generate_music or get_task_status.
4. get_credits
Check your Suno API account credit balance.
Parameters: None
Returns:
Remaining API credits
Example:
Check my Suno API credits5. convert_to_wav
Convert a generated MP3 track to high-quality WAV format. Requires both the generation task ID and the specific track ID.
Parameters:
callback_url(required): Webhook URL for conversion completion notification (e.g., "https://example.com/webhook")task_id(required): Generation task ID frommusic['data']['taskId']- the hex string identifying the generation jobaudio_id(required): Track ID frommusic['data']['sunoData'][0]['id']- the UUID identifying the specific track to convert
Returns:
CONVERSION task ID (different from generation task_id!) for tracking the WAV conversion progress
Example Workflow:
# Step 1: Generate music
music = generate_music(prompt="Epic soundtrack", wait_audio=True)
generation_task_id = music['data']['taskId'] # "aba5fa3d..." (for music generation)
track_id = music['data']['sunoData'][0]['id'] # "8116fdcd..." (specific track)
# Step 2: Convert to WAV
conversion = convert_to_wav(
callback_url="https://example.com/webhook",
task_id=generation_task_id, # Use generation task_id here
audio_id=track_id # Use track ID here
)
conversion_task_id = conversion['data']['taskId'] # "4c7c38f9..." (NEW ID for WAV conversion!)
# Step 3: Get WAV download URL
status = get_wav_conversion_status(task_id=conversion_task_id) # Use CONVERSION task_id!
wav_url = status['data']['response']['audioWavUrl']🔴 CRITICAL WARNINGS:
THREE DIFFERENT IDs - Generation task_id, track audio_id, and conversion task_id are ALL different!
MUST SAVE CONVERSION TASK ID - The returned conversion task_id is the ONLY way to get the WAV download URL
NO ALTERNATIVE RETRIEVAL - You CANNOT query WAV status by audio_id or generation task_id
IF LOST, WAV IS UNRECOVERABLE - Losing the conversion task_id means you cannot retrieve the WAV URL
409 Conflict - If you get "WAV record already exists", you need the ORIGINAL conversion task_id (not generation task_id)
Requirements:
BOTH IDs required (generation task_id + track audio_id)
Track generation must be complete (use
wait_audio=true)
6. get_wav_conversion_status
Get the status of a WAV conversion task and retrieve the download URL once complete.
Parameters:
task_id(required): The CONVERSION task ID returned fromconvert_to_wav(NOT the generation task_id!)
Returns:
Conversion task status (SUCCESS, PENDING, etc.)
WAV download URL when conversion is complete
Track information and creation time
Example:
# Use the CONVERSION task_id (from convert_to_wav response)
# NOT the generation task_id (from generate_music response)
status = get_wav_conversion_status(task_id="4c7c38f9529e2ae2c159a56fc6a4b9e6")
wav_url = status['data']['response']['audioWavUrl']⚠️ IMPORTANT:
Use the conversion task_id (returned from
convert_to_wav)Do NOT use the generation task_id (from
generate_music) - it will not workDo NOT use the audio_id - the API does not support querying by audio_id
Example Workflows
Basic Music Generation (Recommended)
Generate Music with v5 Model:
Generate an epic orchestral battle theme using v5 model in custom modeClaude will use custom mode with appropriate style tags
Returns task ID and track information
Uses v5 model for best quality
Check Credits:
How many Suno credits do I have left?
Advanced: Async Generation with Monitoring
Start Async Generation:
Generate a 3-minute ambient soundscape, don't wait for completionReturns task ID immediately
Generation continues in background
Monitor Progress:
Check status of task: [task-id]Shows generation progress
Returns track IDs and URLs when complete
Get Track Details:
Get information for tracks: ["track-id-1", "track-id-2"]Retrieves detailed metadata and download URLs
Understanding IDs
Task ID: Returned from
generate_music, used withget_task_statusExample:
684b694f002afbb35b49994b32a6a01eUsed to monitor generation progress
Track ID: Specific to each generated song, used with
get_music_infoExample:
7752c889-3601-4e55-b805-54a28a53de85Suno typically generates 2 tracks per request
Each track has its own unique ID
Docker Deployment Guide
This section covers Docker-specific usage and management.
Building the Image
# Using Docker directly
docker build -t suno-mcp-server:latest .
# Or using Docker Compose (if installed)
docker-compose build
# OR (newer plugin syntax)
docker compose buildRunning the Container Manually
For testing or standalone use:
# Run with environment file
docker run --rm -i --env-file .env suno-mcp-server:latest
# Or pass environment variables directly
docker run --rm -i \
-e SUNO_API_KEY=your_api_key_here \
-e SUNO_API_BASE_URL=https://api.sunoapi.org \
suno-mcp-server:latestHealth Checks
The Docker container includes automatic health monitoring:
# Check container health status
docker ps
# View health check logs
docker inspect --format='{{json .State.Health}}' suno-mcp-server
# Manual health check
docker exec suno-mcp-server python healthcheck.pyHealth checks verify:
Environment variables are properly set
Required Python modules are available
Suno client can initialize correctly
Docker Compose Usage
# Build the image
docker-compose build
# Start the server (for testing)
docker-compose up
# View logs
docker-compose logs -f
# Stop the server
docker-compose down
# Rebuild after code changes
docker-compose build --no-cacheSecurity Best Practices
Never commit
.envto version control - It contains your API keyUse
.envfile - Keeps secrets out of command history and scriptsNon-root execution - Container runs as
appuser(UID 1000)Minimal image - Based on
python:3.12-slimto reduce attack surfaceRead-only filesystem - Optional; uncomment in
docker-compose.ymlif needed
Container Resource Management
The docker-compose.yml includes resource limits:
CPU limit: 1.0 cores
Memory limit: 512MB
CPU reservation: 0.5 cores
Memory reservation: 256MB
Adjust these in docker-compose.yml if needed for your environment.
Updating the Container
After making code changes:
# Rebuild the image
docker-compose build
# Or rebuild without cache
docker-compose build --no-cache
# Restart Claude Code to pick up the new imageTroubleshooting Docker Issues
Container fails health check
# Check health check output
docker logs suno-mcp-server
# Run health check manually
docker run --rm -i --env-file .env suno-mcp-server:latest python healthcheck.py"Cannot connect to the Docker daemon"
Ensure Docker is running:
sudo systemctl start dockerCheck Docker permissions:
sudo usermod -aG docker $USER(then log out/in)
Container exits immediately
Check logs:
docker logs suno-mcp-serverVerify
.envfile exists and contains valid API keyEnsure image built successfully:
docker images | grep suno-mcp-server
Environment variables not loading
Verify
.envfile path in docker-compose.yml or docker run commandCheck file permissions:
ls -la .envEnsure
.envfile format is correct (no quotes around values)
Troubleshooting
Common Errors
"SUNO_API_KEY must be provided"
Docker:
Ensure
.envfile exists in your project directoryVerify the absolute path to
.envin your MCP configuration is correctCheck that the
.envfile contains:SUNO_API_KEY=your_actual_keyMake sure Docker can access the file (permissions)
Native:
Ensure your
.envfile exists and contains a valid API keyOr verify the
SUNO_API_KEYis set in theenvsection of your MCP configuration
"Failed to generate music: 401 Unauthorized"
Verify your API key is correct and active
Check that your API key has sufficient credits
"API Error (code 400): Please enter callBackUrl"
The Suno API requires a
callback_urlparameter for some operationsProvide a webhook URL (can be a placeholder like "https://example.com/webhook")
Claude Code will automatically handle this when using the generate_music tool
"Connection timeout"
Music generation can take time; the default timeout is 5 minutes
For longer generations, set
wait_audio: falseand useget_task_statusto poll for completion
"style must be provided when custom_mode is True"
When using custom mode, both
styleandtitleparameters are requiredProvide genre/style tags (e.g., "epic orchestral, cinematic")
Best Practices
Always specify model version: Use
model_version: "v5"for best resultsUse custom mode for precise control: Enables exact lyrics and detailed style specification
Monitor credits regularly: Each generation consumes credits (typically 6 credits per generation)
Suno generates 2 tracks: Each request produces 2 variations of your prompt
Use task IDs vs track IDs correctly:
Task IDs: For checking generation status
Track IDs: For retrieving specific track information
Technical Details
Server Information
Server Name:
suno-mcp-serverVersion: 1.0.0
Protocol: Model Context Protocol (MCP)
API: Suno API v1
Python Version: 3.10+
Async Support: Full async/await implementation using httpx
API Endpoints Used
/api/v1/generate- Music generation/api/v1/generate/record-info- Task/track status retrieval/api/v1/generate/credit- Credit balance check
Model Version Mapping
The server automatically converts user-friendly version names to API format:
v3.5→V3_5(chirp-v3-5)v4→V4(chirp-v4)v4.5→V4_5(chirp-v4-5)v4.5plus→V4_5PLUS(chirp-v4-5-plus)v5→V5(chirp-crow)v5.5→V5_5- Recommended
Credit Costs
Standard generation: ~6 credits per request
Generates 2 track variations per request
Costs may vary based on model version and generation length
API Reference
This server uses the Suno API v1. For more information:
Documentation: https://docs.sunoapi.org/
API Key Management: https://sunoapi.org/api-key
Support: support@sunoapi.org
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
This MCP server is provided as-is for use with the Suno API. Please refer to Suno's terms of service for API usage guidelines.
Support
For issues related to:
This MCP Server: Open an issue
Suno API: Visit https://docs.sunoapi.org/ or contact support@sunoapi.org
MCP Protocol: Visit https://modelcontextprotocol.io/
Built with ❤️ using the Model Context Protocol
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/CodeKeanu/suno-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server