### Setup Development Environment Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md Clone the repository, create a virtual environment, and install with dev and test dependencies. ```bash # Clone repository git clone https://github.com/AceDataCloud/SunoMCP.git cd SunoMCP # Create virtual environment python -m venv .venv source .venv/bin/activate # or `.venv\Scripts\activate` on Windows # Install with dev dependencies pip install -e ".[dev,test]" ``` -------------------------------- ### suno_get_lyric_format_guide usage example Source: https://github.com/acedatacloud/sunomcp Shows how to call the suno_get_lyric_format_guide tool to retrieve the formatting guide as markdown. ```python guide = await suno_get_lyric_format_guide() ``` -------------------------------- ### Install the independent Suno plugin for goose Source: https://github.com/acedatacloud/sunomcp/blob/main/goose/README.md Run this command to install the Suno MCP plugin from the AceDataCloud/SunoMCP repository. Requires goose 1.55.0+, Python 3.10+, and uv on PATH. The command installs only the service plugin, not a media bundle; MCP configuration loads automatically in new sessions. ```sh goose plugin install https://github.com/AceDataCloud/SunoMCP.git ``` -------------------------------- ### OAuthStateStore usage example Source: https://github.com/acedatacloud/sunomcp Shows how to instantiate OAuthStateStore and fetch a client. Requires a 64-character hex state key. ```python from core.oauth_state import OAuthStateStore store = OAuthStateStore("suno", state_key="<64 hex chars>") client_info = await store.get_client("client-id") if client_info is None: print("client not registered") ``` -------------------------------- ### Local stdio server: install and run Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md Install the mcp-suno package and run the local stdio server. Requires an API token and still calls the AceDataCloud API; it does not run Suno locally. ```bash # Install once, then run the local stdio server python -m pip install mcp-suno export ACEDATACLOUD_API_TOKEN='YOUR_API_TOKEN' mcp-suno ``` -------------------------------- ### suno_generate_inspo usage example Source: https://github.com/acedatacloud/sunomcp Example call to suno_generate_inspo with two reference audio URLs, a prompt, and instrumental=True. Only non-None optional values are added to the payload. ```python result = await suno_generate_inspo( audio_urls=["https://example.com/ref1.mp3", "https://example.com/ref2.mp3"], prompt="lo-fi study beats, warm and mellow", instrumental=True, ) ``` -------------------------------- ### Using get_version() from main Source: https://github.com/acedatacloud/sunomcp Imports and calls `get_version()` from `main.py`, which returns the package version or `"dev"` if not installed. ```python from main import get_version version = get_version() # e.g. "2026.1.22.6" ``` -------------------------------- ### get_version() -> str Source: https://github.com/acedatacloud/sunomcp Returns the package version from metadata, or "dev" when the package is not installed. ```APIDOC ## get_version() -> str ### Description Returns the package version from metadata, or "dev" when the package is not installed. ### Request Example ```python from main import get_version version = get_version() # e.g. "2026.1.22.6" ``` ``` -------------------------------- ### Build and Publish to PyPI Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md Install release dependencies, build the package, and upload to PyPI with twine. ```bash # Install build dependencies pip install -e ".[release]" # Build package python -m build # Upload to PyPI twine upload dist/* ``` -------------------------------- ### Set Ace API token and launch goose session Source: https://github.com/acedatacloud/sunomcp/blob/main/goose/README.md Run in a macOS/Linux terminal. The prompt hides input and the key is not typed into shell history. The variable must be in the environment of the process that launches goose; restart goose after setting it. The plugin does not add a fake Key dialog and does not read .env files on its own. ```sh read -r -s -p 'Ace service API Token: ' ACEDATACLOUD_API_TOKEN printf '\n' export ACEDATACLOUD_API_TOKEN goose session ``` -------------------------------- ### suno_generate_sound usage example Source: https://github.com/acedatacloud/sunomcp Example call to suno_generate_sound with a loop sound effect, bpm 90, and key 'Am'. ```python result = await suno_generate_sound( sound="vinyl crackle and tape hiss", sound_type="loop", bpm=90, key="Am" ) ``` -------------------------------- ### Development Commands Source: https://github.com/acedatacloud/sunomcp/blob/main/CLAUDE.md Commands for installing the package in development mode, running tests with coverage, and linting with ruff. These are the standard development workflow commands. ```bash pip install -e ".[dev]" pytest --cov=core --cov=tools ruff check . ``` -------------------------------- ### Example call to suno_generate_with_persona_vox Source: https://github.com/acedatacloud/sunomcp Shows how to invoke the VOX variant of the persona generation tool. This example passes an audio_id, persona_id, and prompt. The VOX mode uses stricter vocal matching via action="artist_consistency_vox". ```python result = await suno_generate_with_persona_vox( audio_id="audio-123", persona_id="persona-456", prompt="dark synthwave ballad" ) ``` -------------------------------- ### Install MCP server via Smithery CLI Source: https://github.com/acedatacloud/sunomcp/blob/main/smithery/README.md Adds the acedatacloud-mcp/mcp-suno server using the official Smithery CLI. This command is a directory installation entry and does not prove that normal installation has passed. ```bash npx -y smithery mcp add acedatacloud-mcp/mcp-suno ``` -------------------------------- ### suno_mashup_music usage example Source: https://github.com/acedatacloud/sunomcp Example call blending two audio IDs with a prompt and title. ```python result = await suno_mashup_music( mashup_audio_ids=["audio-1", "audio-2"], prompt="DJ-style blend, keep both melodies prominent, high energy", title="Mashup", ) ``` -------------------------------- ### suno_list_actions usage example Source: https://github.com/acedatacloud/sunomcp Shows how to call the suno_list_actions tool to retrieve the categorized markdown string. ```python result = await suno_list_actions() ``` -------------------------------- ### suno_list_models usage example Source: https://github.com/acedatacloud/sunomcp Shows how to call the suno_list_models tool and the expected return value, a markdown table string. ```python result = await suno_list_models() # -> "Available Suno Models:\n\n| Model | Version | ..." ``` -------------------------------- ### suno_all_stems_music usage example Source: https://github.com/acedatacloud/sunomcp Example call to suno_all_stems_music with an audio_id. The task result data items are labeled with stem_set 1 or 2. ```python result = await suno_all_stems_music(audio_id="audio-8") # task result data items are labeled {"stem_set": 1} / {"stem_set": 2} ``` -------------------------------- ### Create project example with idempotency key Source: https://github.com/acedatacloud/sunomcp Shows how to call suno_manage_project with a CreateProject request and a stable idempotency key. The key must be unique per intended write; reusing it with identical request avoids duplicate billable operations. ```python from core.project_types import CreateProject, SaveProject # create result = await suno_manage_project( CreateProject(action="create", title="My Album"), idempotency_key="create-project-1", ) ``` -------------------------------- ### CLI usage examples for mcp-suno Source: https://github.com/acedatacloud/sunomcp Shows the default stdio mode, HTTP transport on a custom port, and version flag. The CLI is packaged as the console script `mcp-suno`. ```bash # stdio (default) mcp-suno # HTTP transport on a custom port mcp-suno --transport http --port 9000 mcp-suno --version ``` -------------------------------- ### suno_list_personas usage example Source: https://github.com/acedatacloud/sunomcp Example call to suno_list_personas with user_id, limit, and offset parameters. ```python result = await suno_list_personas(user_id="user-1", limit=20, offset=0) ``` -------------------------------- ### suno_get_custom_model usage example Source: https://github.com/acedatacloud/sunomcp Example invocation of suno_get_custom_model with a model ID. Returns raw API response JSON with the model record. ```python result = await suno_get_custom_model(model_id="cm-123") ``` -------------------------------- ### Usage examples for suno_get_wav, suno_get_mp3, suno_get_midi Source: https://github.com/acedatacloud/sunomcp Shows how to call the three media conversion tools. The first two omit callback_url; the third includes it. Each returns a JSON string with task_id and polling guidance. ```python result = await suno_get_wav(audio_id="audio-1") result = await suno_get_mp3(audio_id="audio-1") result = await suno_get_midi(audio_id="audio-1", callback_url="https://example.com/webhook") ``` -------------------------------- ### suno_list_custom_models usage example Source: https://github.com/acedatacloud/sunomcp Example invocation of suno_list_custom_models with limit=1 and status="ready". Returns raw API response JSON containing an items list; empty list is a valid success for a new application. ```python result = await suno_list_custom_models(limit=1, status="ready") ``` -------------------------------- ### registered_tool_cards usage example Source: https://github.com/acedatacloud/sunomcp Shows how to call registered_tool_cards from core.server_card (line 6) with the mcp instance. Returns a stable public view of registered tools sorted by name, used by the /.well-known/mcp/server-card.json route. ```python from core.server import mcp from core.server_card import registered_tool_cards cards = registered_tool_cards(mcp) # [{'name': 'suno_add_stem', 'description': '...'}, ...] ``` -------------------------------- ### suno_create_persona usage example Source: https://github.com/acedatacloud/sunomcp Example call to suno_create_persona with audio_id, name, vocal_start, vocal_end, and description. The comment shows the expected JSON response containing persona_id. ```python result = await suno_create_persona( audio_id="audio-1", name="Soft Female Singer", vocal_start=30.0, vocal_end=60.0, description="Warm and breathy female voice with jazz influences", ) # -> {"success": true, "task_id": "...", "data": {"persona_id": "persona-456"}, ...} ``` -------------------------------- ### Example call to suno_extend_music Source: https://github.com/acedatacloud/sunomcp Example of calling suno_extend_music to extend a song from a timestamp, useful for building a long song piece by piece and later merging with suno_concat_music. The continue_at value 120.5 preserves fractional seconds. ```python result = await suno_extend_music( audio_id="audio-1", lyric="[Bridge]\nLost in the sound\n[Outro]\n fading out", continue_at=120.5, ) ``` -------------------------------- ### suno_extract_stem usage example Source: https://github.com/acedatacloud/sunomcp Example call to suno_extract_stem with audio_id 'audio-15', stem_type 'vocals', and audio_format 'mp3'. ```python result = await suno_extract_stem(audio_id="audio-15", stem_type="vocals", audio_format="mp3") ``` -------------------------------- ### suno_get_tasks_batch usage example Source: https://github.com/acedatacloud/sunomcp Shows how to call suno_get_tasks_batch with a list of task IDs and the expected JSON response containing formatted task records under the items key. ```python result = await suno_get_tasks_batch(task_ids=["task-1", "task-2"]) # -> {"success": true, "items": [, ], ...} ``` -------------------------------- ### suno_stems_music usage example Source: https://github.com/acedatacloud/sunomcp Example call to suno_stems_music with an audio_id. The result is a JSON string containing task_id, stem track URLs, and polling guidance. ```python result = await suno_stems_music(audio_id="audio-5") ``` -------------------------------- ### suno_create_voice usage example Source: https://github.com/acedatacloud/sunomcp Example call to suno_create_voice with an audio URL, name, and description. Returns raw API response JSON containing the persona_id for use with suno_generate_with_persona / suno_generate_with_persona_vox. ```python result = await suno_create_voice( audio_url="https://example.com/voice-sample.mp3", name="My Voice", description="Warm female voice", ) ``` -------------------------------- ### Manual mcp.json for local stdio server Source: https://github.com/acedatacloud/sunomcp/blob/main/vscode/README.md Alternative to the extension for offline or air-gapped environments: configure a local stdio MCP server using uvx to run mcp-suno. Requires uv installed and uses the ACEDATACLOUD_API_TOKEN environment variable. ```jsonc { "servers": { "suno": { "type": "stdio", "command": "uvx", "args": ["mcp-suno"], "env": { "ACEDATACLOUD_API_TOKEN": "${input:acedatacloud_api_token}" } } } } ``` -------------------------------- ### suno_get_lyric_format_guide Source: https://github.com/acedatacloud/sunomcp Returns lyric formatting guidance as markdown, including section markers, a full song-structure example, and tips for line length, rhymes, and consistent line counts. This tool confirms tool loading only and does not validate the API key or make network calls. ```APIDOC ## suno_get_lyric_format_guide ### Description Returns guidance on formatting lyrics for Suno music generation. ### Method MCP Tool ### Endpoint suno_get_lyric_format_guide ### Parameters None ### Response #### Success Response - **result** (string) - The formatting guide as markdown. ### Request Example ```python guide = await suno_get_lyric_format_guide() ``` ``` -------------------------------- ### suno_generate_music successful call example Source: https://github.com/acedatacloud/sunomcp Shows a successful call to suno_generate_music with a prompt. Returns a JSON string containing success, task_id, data, and mcp_async_submission polling guidance. ```python result = await suno_generate_music(prompt="Epic orchestral battle music with dramatic choir") # -> {"success": true, "task_id": "...", "data": [...], "mcp_async_submission": {...}} ``` -------------------------------- ### suno_get_lyric_format_guide tool definition Source: https://github.com/acedatacloud/sunomcp Defines the MCP tool that returns lyric formatting guidance as markdown, including section markers and song-structure examples. ```python @mcp.tool() async def suno_get_lyric_format_guide() -> str: """Get guidance on formatting lyrics for Suno music generation. ... """ ``` -------------------------------- ### Add Suno MCP server via Cline CLI Source: https://github.com/acedatacloud/sunomcp/blob/main/docs/cline.md Manual equivalent to install the Suno MCP server when the marketplace listing is unavailable. Installs one named server, not all Ace services; does not create an account, supply a key, or run a generation. ```bash cline mcp add suno-acedatacloud https://suno.mcp.acedata.cloud/mcp --transport http --yes ``` -------------------------------- ### suno_underpainting usage example Source: https://github.com/acedatacloud/sunomcp Shows a call to suno_underpainting with an audio_id and an underpainting_end of 90.0 seconds, leaving other parameters at their defaults. ```python result = await suno_underpainting(audio_id="upload-2", underpainting_end=90.0) ``` -------------------------------- ### suno_create_custom_model usage example Source: https://github.com/acedatacloud/sunomcp Shows how to call suno_create_custom_model with a name, a list of 8 audio URLs, and an idempotency key. The result is raw API response JSON containing a task_id, which can be polled with suno_get_task. ```python result = await suno_create_custom_model( name="My Band Style", audio_urls=[f"https://example.com/track{i}.mp3" for i in range(8)], idempotency_key="create-my-band-style-v1", ) ``` -------------------------------- ### AddProjectTrack and RenderProject usage Source: https://github.com/acedatacloud/sunomcp Example of adding a track to a project timeline (in beats) and rendering the final project. Both calls use idempotency keys; async is default for these actions. ```python from core.project_types import AddProjectTrack, RenderProject # add a track on the project timeline (beats), async by default result = await suno_manage_project( AddProjectTrack( action="add_track", id="proj-1", version_id="v9", audio_id="audio-4", name="Guitar", gain=1.0, start_beats=0, end_beats=64, ), idempotency_key="add-track-3", ) # render the final project result = await suno_manage_project( RenderProject(action="render", id="proj-1", version_id="v9", title="Final"), idempotency_key="render-final-1", ) ``` -------------------------------- ### Calling suno_archive_custom_model Source: https://github.com/acedatacloud/sunomcp Example invocation of the suno_archive_custom_model tool with a model ID. Returns the raw API response JSON. ```python result = await suno_archive_custom_model(model_id="cm-123") ``` -------------------------------- ### suno_optimize_style usage example Source: https://github.com/acedatacloud/sunomcp Shows how to call the suno_optimize_style tool with a rough style prompt. Returns raw API response as indented JSON, not passed through the formatter. ```python result = await suno_optimize_style(prompt="electronic dance party") ``` -------------------------------- ### suno_list_actions Source: https://github.com/acedatacloud/sunomcp Returns a categorized markdown string listing all available Suno API actions mapped to their MCP tools, along with workflow examples and notes on additional operations. This tool confirms tool loading only and does not validate the API key or make network calls. ```APIDOC ## suno_list_actions ### Description Returns a categorized markdown string of all available Suno API actions and corresponding tools. ### Method MCP Tool ### Endpoint suno_list_actions ### Parameters None ### Response #### Success Response - **result** (string) - Categorized markdown string (Music Generation, Upload-based Operations, Stems & Extraction, Audio Availability, Media Conversion, Persona, Custom Music Models, Lyrics, Task Management, Information, Workflow Examples, Additional operations). ### Request Example ```python result = await suno_list_actions() ``` ``` -------------------------------- ### suno_get_task usage example Source: https://github.com/acedatacloud/sunomcp Shows how to call suno_get_task with a task ID and the expected JSON response containing the task record and mcp_task_polling guidance. The tool sleeps 5 seconds before returning when the task is not terminal. ```python result = await suno_get_task(task_id="task-abc123") # -> {"id": "task-abc123", "request": {...}, "response": {"success": true, "data": [...]}, # "mcp_task_polling": {"state": "complete", "is_complete": true, "recommended_action": "stop", ...}} ``` -------------------------------- ### suno_cover_music usage example Source: https://github.com/acedatacloud/sunomcp Calls suno_cover_music to create a cover with an 80s synthwave remix prompt and style, with audio_weight set to 0.6. ```python result = await suno_cover_music( audio_id="audio-9", prompt="80s synthwave remix", style="synthwave, retro", audio_weight=0.6 ) ``` -------------------------------- ### main() Source: https://github.com/acedatacloud/sunomcp CLI entry point for the mcp-suno server. Parses arguments, validates configuration, prints a startup banner, imports prompts and tools for side-effect registration, and runs the server in either stdio or HTTP mode. ```APIDOC ## main() ### Description CLI entry point for the mcp-suno server. Parses arguments, validates configuration, prints a startup banner, imports prompts and tools for side-effect registration, and runs the server in either stdio or HTTP mode. ### Parameters #### Command-line Arguments - `--version` (flag) - Optional - Prints `mcp-suno ` from package metadata. - `--transport` (`stdio | http`) - Optional - Transport mode. Default: `stdio`. - `--port` (int) - Optional - Port for HTTP transport. Default: `8000`. ### Behavior - If `transport != "http"` and `settings.is_configured` is `False`, prints an error to stderr and exits with code 1. - stdio mode runs `mcp.run(transport="stdio")`. - HTTP mode sets `mcp.settings.stateless_http = True`, `mcp.settings.json_response = True`, `mcp.settings.streamable_http_path = "/mcp"`, builds a Starlette app, and runs `uvicorn.run(app, host="0.0.0.0", port=args.port)`. - `KeyboardInterrupt` exits 0; any other exception is logged and exits 1. ### Request Example ```python # stdio (default) mcp-suno # HTTP transport on a custom port mcp-suno --transport http --port 9000 mcp-suno --version ``` ``` -------------------------------- ### suno_delete_persona usage example Source: https://github.com/acedatacloud/sunomcp Example call to suno_delete_persona with persona_id and user_id parameters. ```python result = await suno_delete_persona(persona_id="persona-456", user_id="user-1") ``` -------------------------------- ### suno_check_audio_availability usage example Source: https://github.com/acedatacloud/sunomcp Returns raw API response JSON. Success reports data.available=true for the current channel; unknown availability raises an HTTP error (e.g. 503 availability_unknown), never available=false. Do not poll the returned task_id — this endpoint is synchronous. ```python result = await suno_check_audio_availability(audio_id="33333333-3333-4333-8333-333333333333") # -> {"success": true, "data": {"id": "...", "available": true}, ...} ``` -------------------------------- ### .env.example template Source: https://github.com/acedatacloud/sunomcp Repository template for environment variables. Includes API token, base URL, default model, request timeout, server name, transport, and log level. ```ini ACEDATACLOUD_API_TOKEN=your_api_token_here ACEDATACLOUD_API_BASE_URL=https://api.acedata.cloud SUNO_DEFAULT_MODEL=chirp-v4-5 SUNO_REQUEST_TIMEOUT=1800 MCP_SERVER_NAME=suno MCP_TRANSPORT=stdio LOG_LEVEL=INFO ``` -------------------------------- ### suno_upload_extend usage example Source: https://github.com/acedatacloud/sunomcp Calls suno_upload_extend to extend an uploaded audio track. Uses the same contract as suno_extend_music but for audio uploaded via suno_upload_audio with action 'upload_extend'. Parameters include audio_id, lyric, continue_at (gt=0), style, model, and callback_url. ```python result = await suno_upload_extend( audio_id="upload-1", lyric="[Verse 2]\nNew verse for my own music", continue_at=30.0 ) ``` -------------------------------- ### Replace a song section - MCP arguments Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md Example arguments for replacing a section of a completed song. Requires the completed song's audio ID and a valid interval where 0 <= replace_section_start < replace_section_end <= source duration. Pass local new lyrics in both 'lyric' and 'prompt'; 'replace_section_result_mode' defaults to 'full_song' to receive two complete songs. ```json { "audio_id": "YOUR_COMPLETED_AUDIO_ID", "replace_section_start": 30.0, "replace_section_end": 50.0, "lyric": "New words for this phrase", "prompt": "New words for this phrase", "replace_section_result_mode": "full_song" } ``` -------------------------------- ### Import prompts to register MCP prompts Source: https://github.com/acedatacloud/sunomcp Importing the prompts module registers three static guidance prompts on the MCP server via @mcp.prompt(). The prompts take no arguments and return markdown strings. ```python import prompts # registers all three prompts on `mcp` ``` -------------------------------- ### Using settings with SunoClient Source: https://github.com/acedatacloud/sunomcp Shows how to access the global settings instance and use its properties. is_configured returns False when no token is set, validate() raises ValueError if the token is missing, and SunoClient resolves token/base_url/timeout from settings. ```python from core.config import settings settings.is_configured # False when no token settings.validate() # raises ValueError client = SunoClient() # resolves token/base_url/timeout from settings ``` -------------------------------- ### Ask Kilo to list Suno models without generating Source: https://github.com/acedatacloud/sunomcp/blob/main/kilo/README.md Use this prompt to verify the MCP connection without incurring paid media generation. It checks discovery or a local information tool, not a billable action. ```text List the available Suno models using suno_list_models. Do not generate music. ``` -------------------------------- ### suno_concat_music usage example Source: https://github.com/acedatacloud/sunomcp Example call after several suno_extend_music calls, passing the last segment's audio ID to merge the chain. ```python # After several suno_extend_music calls: final = await suno_concat_music(audio_id="audio-3") ``` -------------------------------- ### suno_add_stem usage example Source: https://github.com/acedatacloud/sunomcp Example call to suno_add_stem generating a drums stem from audio ID 'audio-15' with style 'punchy rock drums' and max_mode disabled. The result is a JSON string from format_audio_result(). ```python result = await suno_add_stem( audio_id="audio-15", stem_type="drums", style="punchy rock drums", max_mode=False ) ``` -------------------------------- ### Code Quality Commands Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md Format, lint, and type-check the codebase using ruff and mypy. ```bash # Format code ruff format . # Lint code ruff check . # Type check mypy core tools ``` -------------------------------- ### GET /favicon.ico Source: https://github.com/acedatacloud/sunomcp Redirects to the favicon hosted on the AceData CDN. Returns a 301 redirect. ```APIDOC ## GET /favicon.ico ### Description Redirects to the favicon hosted on the AceData CDN. Returns a 301 redirect. ### Method GET ### Endpoint /favicon.ico ### Response #### Success Response (301) - Redirect to `https://cdn.acedata.cloud/l3ffw7.jpg`. ``` -------------------------------- ### FastMCP server singleton initialization Source: https://github.com/acedatacloud/sunomcp Module-level FastMCP instance in core/server.py (line 48). Import from core.server import mcp (also re-exported by core/__init__.py). Every tool and prompt registers against this instance. Server name defaults to "suno" (MCP_SERVER_NAME); icon URL is the AceDataCloud favicon. ```python mcp = FastMCP( settings.server_name, icons=[Icon(src="https://cdn.acedata.cloud/l3ffw7.jpg", mimeType="image/jpeg")], **mcp_kwargs, ) ``` -------------------------------- ### GET /suno/persona Source: https://github.com/acedatacloud/sunomcp Lists personas for a user. Supports pagination with limit and offset. This endpoint is billed-free. ```APIDOC ## GET /suno/persona ### Description Lists personas for a user. Supports pagination with limit and offset. This endpoint is billed-free. ### Method GET ### Endpoint /suno/persona ### Parameters #### Query Parameters - **user_id** (string) - Required - The user ID to list personas for - **limit** (integer) - Optional - Maximum number of personas to return (default 50) - **offset** (integer) - Optional - Number of personas to skip (default 0) ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful - **data** (array) - Array of persona objects ``` -------------------------------- ### SunoClient.__init__(api_token: str | None = None, base_url: str | None = None) Source: https://github.com/acedatacloud/sunomcp Initializes a SunoClient instance. Sets the API token, base URL, and timeout from settings if not provided. ```APIDOC ## SunoClient.__init__(api_token: str | None = None, base_url: str | None = None) ### Description Initializes a SunoClient instance. Sets the API token, base URL, and timeout from settings if not provided. ### Parameters - `api_token` (str | None) - Optional - Bearer token for api.acedata.cloud. Defaults to settings.api_token. - `base_url` (str | None) - Optional - API root, e.g. https://api.acedata.cloud. Defaults to settings.api_base_url. ### Attributes - `api_token` (str) - The API token. - `base_url` (str) - The base URL. - `timeout` (float) - Request timeout in seconds (default 1800). ### Example ```python from core.client import SunoClient client = SunoClient(api_token="...", base_url="https://api.acedata.cloud") ``` ``` -------------------------------- ### GET {auth_base_url}/oauth2/authorize Source: https://github.com/acedatacloud/sunomcp Browser redirect to the consent page. Initiates the OAuth 2.0 authorization flow with PKCE. ```APIDOC ## GET {auth_base_url}/oauth2/authorize ### Description Browser redirect to the consent page. Initiates the OAuth 2.0 authorization flow with PKCE. ### Method GET ### Endpoint {auth_base_url}/oauth2/authorize ### Parameters #### Query Parameters - **client_id** (string) - Required - The client identifier. - **redirect_uri** (string) - Required - The URI to redirect to after authorization. - **response_type** (string) - Required - Must be `code`. - **scope** (string) - Required - The requested scopes. - **state** (string) - Required - A state parameter for CSRF protection. - **code_challenge** (string) - Required - PKCE code challenge (S256). - **code_challenge_method** (string) - Required - Must be `S256`. ``` -------------------------------- ### Run Tests Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md Run unit tests, tests with coverage, and integration tests (requires API token). ```bash # Run unit tests pytest # Run with coverage pytest --cov=core --cov=tools # Run integration tests (requires API token) pytest tests/test_integration.py -m integration ``` -------------------------------- ### Check audio availability with suno_check_audio_availability Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md Call suno_check_audio_availability with the audio UUID from a completed song's id, not the generation task_id. It calls POST /suno/availability synchronously and currently costs no Credits. A successful response has data.id and data.available=true; do not poll the returned task_id. ```json {"audio_id":"33333333-3333-4333-8333-333333333333"} ``` -------------------------------- ### Cursor: Project-scope MCP configuration for Suno Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md JSON configuration for Cursor's MCP settings to add the hosted Suno server. Merge into /.cursor/mcp.json for project scope or ~/.cursor/mcp.json for personal machines. The URL-only config contains no token; do not commit it if a real token is added later. ```json { "mcpServers": { "suno": { "url": "https://suno.mcp.acedata.cloud/mcp" } } } ``` -------------------------------- ### GET /health Source: https://github.com/acedatacloud/sunomcp Health check endpoint for the MCP server. Returns a simple status object indicating the server is reachable. ```APIDOC ## GET /health ### Description Health check endpoint for the MCP server. Returns a simple status object indicating the server is reachable. ### Method GET ### Endpoint /health ### Response #### Success Response (200) - **status** (string) - Always "ok". ``` -------------------------------- ### ProjectInput base class with ConfigDict Source: https://github.com/acedatacloud/sunomcp Base class for all project request models. ConfigDict forbids extra fields and allows population by field name or alias. ```python class ProjectInput(BaseModel): model_config = ConfigDict(extra="forbid", populate_by_name=True) ``` -------------------------------- ### Call suno_list_models to list supported models/actions Source: https://github.com/acedatacloud/sunomcp/blob/main/vscode/README.md Send this prompt to the Chat agent to invoke the suno_list_models tool for a read-only check. It returns reference information without generating media and does not prove generation access. ```text Call suno_list_models only. Show supported models/actions. Do not generate anything. ``` -------------------------------- ### GET /.well-known/mcp/server-card.json Source: https://github.com/acedatacloud/sunomcp Returns the MCP server card containing server information, authentication requirements, and registered tools, prompts, and resources. ```APIDOC ## GET /.well-known/mcp/server-card.json ### Description Returns the MCP server card containing server information, authentication requirements, and registered tools, prompts, and resources. ### Method GET ### Endpoint /.well-known/mcp/server-card.json ### Response #### Success Response (200) - **serverInfo** (object) - `{name: str, version: str}` - `{"name": "MCP Suno", "version": }` - **authentication** (object) - `{required: bool, schemes: [str]}` - `{"required": true, "schemes": ["bearer"]}` - **tools** (array) - All registered tool cards, sorted by name. - **prompts** (array) - The three MCP prompts. - **resources** (array) - Always empty. ``` -------------------------------- ### Project Structure Tree Source: https://github.com/acedatacloud/sunomcp/blob/main/CLAUDE.md Shows the directory layout of the SunoMCP project, including core modules, tool modules, prompts, and tests. Useful for understanding the codebase organization. ```text core/ config.py — Settings dataclass (API token, base URL) server.py — FastMCP server singleton client.py — httpx async HTTP client types.py — Literal types (SunoModel, VocalGender, etc.) exceptions.py — Error classes (AuthError, APIError, TimeoutError) utils.py — Formatting helpers tools/ audio_tools.py — generate, custom, extend, cover, remaster, concat lyrics_tools.py — generate lyrics, mashup media_tools.py — MP4, WAV, MIDI, timing, vocal separation persona_tools.py — save/manage voice personas style_tools.py — optimize style descriptions task_tools.py — query task status, wait for completion info_tools.py — list models, capabilities prompts/ — LLM guidance prompts tests/ — pytest-asyncio + respx tests ``` -------------------------------- ### GET /sse Source: https://github.com/acedatacloud/sunomcp Legacy SSE transport endpoint for MCP. Provides a server-sent event stream for MCP communication. Requires Bearer authentication. ```APIDOC ## GET /sse ### Description Legacy SSE transport endpoint for MCP. Provides a server-sent event stream for MCP communication. Requires Bearer authentication. ### Method GET ### Endpoint /sse ### Authentication - Bearer token (via MCP auth) ### Response #### Success Response (200) - SSE stream; paired with `/messages` for client responses. ``` -------------------------------- ### GET /oauth/callback Source: https://github.com/acedatacloud/sunomcp OAuth callback endpoint for the MCP server. Handles the authorization code exchange with the upstream provider. Only mounted when OAuth is enabled. ```APIDOC ## GET /oauth/callback ### Description OAuth callback endpoint for the MCP server. Handles the authorization code exchange with the upstream provider. Only mounted when OAuth is enabled. ### Method GET ### Endpoint /oauth/callback ### Parameters #### Query Parameters - **state** (string) - Required - MCP state token. - **code** (string) - Required - Upstream authorization code. ### Response #### Success Response (302) - Redirect to client `redirect_uri` with `code` (+ `state` when present). #### Error Responses - **400** - `{"error": "Missing state or code parameter"}` - Missing `state` or `code`. - **400** - `{"error": "Invalid or expired state"}` - Unknown/expired `state`. - **502** - `{"error": "Failed to exchange authorization code"}` - Upstream token exchange failed. - **403** - `{"error": "No API credential found. Please create an API key at https://platform.acedata.cloud first."}` - No API credential obtainable. - **500** - `{"error": "Internal server error"}` - Unexpected exception. ``` -------------------------------- ### GET {platform_base_url}/api/v1/applications/ Source: https://github.com/acedatacloud/sunomcp Finds the user's Global Usage application. Used to locate an existing application of type Usage with global scope. ```APIDOC ## GET {platform_base_url}/api/v1/applications/ ### Description Finds the user's Global Usage application. Used to locate an existing application of type Usage with global scope. ### Method GET ### Endpoint {platform_base_url}/api/v1/applications/ ``` -------------------------------- ### SunoClient __init__ Source: https://github.com/acedatacloud/sunomcp Initializes the client with API token, base URL, and timeout. Falls back to settings values when arguments are not provided. ```python def __init__(self, api_token: str | None = None, base_url: str | None = None): self.api_token = api_token if api_token is not None else settings.api_token self.base_url = base_url or settings.api_base_url self.timeout = settings.request_timeout ``` -------------------------------- ### suno_remaster_music usage example Source: https://github.com/acedatacloud/sunomcp Calls suno_remaster_music with audio_id and variation_category set to "normal". ```python result = await suno_remaster_music(audio_id="audio-4", variation_category="normal") ``` -------------------------------- ### suno_get_timing Source: https://github.com/acedatacloud/sunomcp Gets word-level timing/subtitle data via client.get_timing (POST /suno/timing). Returns raw API response JSON with timestamps for karaoke/subtitles. ```APIDOC ## suno_get_timing ### Description Gets word-level timing/subtitle data via `client.get_timing` (`POST /suno/timing`). Returns raw API response JSON (timestamps for karaoke/subtitles). Useful with `suno_replace_section` to pick complete musical phrases. ### Method POST ### Endpoint /suno/timing ### Parameters #### Request Body - **audio_id** (str) - Required - The song ID to get timing/subtitle data for. ### Response #### Success Response Returns raw API response JSON (timestamps for karaoke/subtitles). ### Request Example ```python result = await suno_get_timing(audio_id="audio-1") ``` ``` -------------------------------- ### suno_manage_project Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md Manages studio projects with actions: create, retrieve, save, upload, add_track, generate_track, replace_section, commit_candidate, remove_track, and render. Requires an idempotency key for writes. ```APIDOC ## suno_manage_project ### Description Manages studio projects with actions: create, retrieve, save, upload, add_track, generate_track, replace_section, commit_candidate, remove_track, and render. Requires an idempotency key for writes. ### Method MCP Tool ### Parameters - **request** (required) - Action-specific schema with fields applicable to the operation. - **idempotency_key** (required for writes) - Caller-selected key for idempotent retries. ### Actions - **create** - Create a new project. - **retrieve** - Retrieve project state. - **save** - Save complete state. - **upload** - Upload material. - **add_track** - Add a track. - **generate_track** - Generate a track from source audio and completed project render audio. - **replace_section** - Replace a section. - **commit_candidate** - Commit a candidate to a track. - **remove_track** - Remove a track. - **render** - Render the project. ### Response Returns the project state and latest version_id. ``` -------------------------------- ### VS Code: Workspace MCP configuration for Suno Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md VS Code MCP configuration format for a local workspace, adding the hosted Suno server over HTTP. Save to a workspace config for a team or user profile for personal use. Use MCP: List Servers to check connection and tool loading. ```json { "servers": { "suno": { "type": "http", "url": "https://suno.mcp.acedata.cloud/mcp" } } } ``` -------------------------------- ### list_personas Source: https://github.com/acedatacloud/sunomcp Lists personas using the Suno API. This method uses a GET request with query parameters (all None values are filtered out). This operation is billed-free. ```APIDOC ## GET /suno/persona ### Description Lists personas using the Suno API. This method uses a GET request with query parameters (all None values are filtered out). This operation is billed-free. ### Method GET ### Endpoint /suno/persona ### Parameters #### Query Parameters - **kwargs** (Any) - Optional - Query parameters for the persona list request. None values are filtered out. ### Response #### Success Response (200) - **response** (dict[str, Any]) - The raw API response. ``` -------------------------------- ### suno_list_personas Source: https://github.com/acedatacloud/sunomcp Lists personas for a user via client.list_personas (GET /suno/persona). Billed-free; no billing-exemption header needed. Returns raw API response JSON with the persona list. ```APIDOC ## suno_list_personas ### Description Lists personas for a user via client.list_personas (GET /suno/persona). Billed-free; no billing-exemption header needed. Returns raw API response JSON with the persona list. ### Parameters #### Request Body - **user_id** (str) - Required - The user ID to list personas for. - **limit** (int) - Optional - Maximum number of personas to return. Default is 50. - **offset** (int) - Optional - Number of personas to skip for pagination. Default is 0. ### Response #### Success Response Returns: raw API response JSON with the persona list. ### Request Example ```python result = await suno_list_personas(user_id="user-1", limit=20, offset=0) ``` ``` -------------------------------- ### suno_check_audio_availability Source: https://github.com/acedatacloud/sunomcp/blob/main/README.md Checks whether audio is available before processing a cover or extension. It calls POST /suno/availability synchronously with an API token and costs no Credits. A successful response indicates positive evidence of availability at check time, but does not guarantee later operations will succeed. ```APIDOC ## suno_check_audio_availability ### Description Checks audio availability before processing a cover or extension. It calls POST /suno/availability synchronously with an API token and currently costs no Credits. Do not poll its returned task_id as though it were a generation job. ### Method POST ### Endpoint /suno/availability ### Parameters #### Request Body - **audio_id** (string) - Required - The audio UUID from a completed song's `id`, not the generation `task_id`. ### Response #### Success Response (200) - **data.id** (string) - The audio ID. - **data.available** (boolean) - True if availability was confirmed at check time. #### Error Response (400) Invalid audio IDs return HTTP 400; the MCP tool rejects malformed UUIDs before calling the API. #### Error Response (503) If availability cannot be confirmed, the API returns an error such as HTTP 503 `availability_unknown`, never `available=false`. ### Request Example ```json {"audio_id":"33333333-3333-4333-8333-333333333333"} ``` ``` -------------------------------- ### suno_get_mp4 Source: https://github.com/acedatacloud/sunomcp Gets an MP4 video of a generated song via client.get_mp4 (POST /suno/mp4). Returns a JSON string with task_id, MP4 info, and polling guidance. ```APIDOC ## suno_get_mp4 ### Description Gets an MP4 video of a generated song via `client.get_mp4` (`POST /suno/mp4`), formatted by `format_audio_result()`. ### Method POST ### Endpoint /suno/mp4 ### Parameters #### Request Body - **audio_id** (str) - Required - The song ID to get the MP4 video for. This is the 'id' field from a previous audio generation result. ### Response #### Success Response Returns a JSON string with `task_id`, MP4 info, and polling guidance. ### Request Example ```python result = await suno_get_mp4(audio_id="audio-1") ``` ``` -------------------------------- ### Instantiate SunoClient global singleton Source: https://github.com/acedatacloud/sunomcp Creates the global SunoClient instance with no arguments, resolving token and base URL from settings at import time. All tool modules import this instance via `from core.client import client`. ```python client = SunoClient() ``` -------------------------------- ### suno_list_actions tool definition Source: https://github.com/acedatacloud/sunomcp Defines the MCP tool that returns a categorized markdown reference of all Suno API actions mapped to MCP tools, including workflow examples and additional operations. ```python @mcp.tool() async def suno_list_actions() -> str: """List all available Suno API actions and corresponding tools. ... """ ``` -------------------------------- ### POST {platform_base_url}/api/v1/applications/ Source: https://github.com/acedatacloud/sunomcp Creates a new Global Usage application. Used when no existing application is found. ```APIDOC ## POST {platform_base_url}/api/v1/applications/ ### Description Creates a new Global Usage application. Used when no existing application is found. ### Method POST ### Endpoint {platform_base_url}/api/v1/applications/ ### Parameters #### Request Body - **type** (string) - Required - Must be `Usage`. - **scope** (string) - Required - Must be `Global`. ```