OpenCode Integration with Suno MCP

📘 OverviewOpenCode MCP Overview →

You are writing a product release log in the terminal, and suddenly think: it would be even more complete if there was a 30-second BGM accompanying the video version of the release notes. After connecting to the Suno MCP Server, OpenCode can directly write songs on-site based on the emotions, styles, and rhythms you describe, without switching to a browser or needing a separate music generation account.

Suno MCP is suitable for generating release soundtracks, product demo BGMs, demo video background music, or even complete songs with lyrics in OpenCode.

Obtain API Token

Before using the Suno MCP Server, you need to prepare an Ace Data Cloud API Token. OpenCode and Claude Code share a set of Tokens, and the acquisition process is the same:

  1. Open the Ace Data Cloud Console - Application List to obtain your API Token for backup.
  2. If you are not logged in or registered, you will be automatically redirected to the login page; after logging in or registering, you will automatically return to the current page.
  3. The first application will have a free quota available, allowing you to experience the Suno MCP service for free.

Obtain Ace Data Cloud API Key

One Token can be used for all MCP Servers provided by Ace Data Cloud, without needing to apply separately for Suno. The documentation and screenshots suggest displaying only a de-sensitized format, such as YOUR_ACEDATACLOUD_API_KEY, and not posting the complete Token in public repositories, Issues, screenshots, or chat records.

Want to use Claude Desktop / Claude.ai web version for direct OAuth one-click authorization? Please see the Suno MCP Claude.ai / Desktop Tutorial.

Configure OpenCode

OpenCode uses a single opencode.json file to describe all MCP Servers, which can be placed in two locations; choose one according to the "scope of application" below. The field structure in both locations is exactly the same, with the only difference being priority.

It is strongly recommended to first write the Token to the environment variable:

export ACEDATACLOUD_API_KEY="replace with your real Token"

Then reference it in opencode.json using the {env:ACEDATACLOUD_API_KEY} placeholder to avoid writing the real Token into the file.

Global: Shared by all projects

File location: ~/.config/opencode/opencode.json, suitable for "my own machine, set up once, usable for all projects."

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "suno": {
      "type": "remote",
      "url": "https://suno.mcp.acedata.cloud/mcp",
      "enabled": true,
      "oauth": false,
      "headers": { "Authorization": "Bearer {env:ACEDATACLOUD_API_KEY}" }
    }
  }
}

⚠️ "oauth": false cannot be omitted. AceData's MCP Server uses Bearer Token authentication and does not go through the OAuth process; OpenCode will by default treat 401 as an OAuth challenge and automatically redirect, causing opencode mcp list to show SSE error: Non-200 status code (401). Explicitly declaring "oauth": false allows OpenCode to directly call with Authorization: Bearer ..., and opencode mcp debug suno will also echo OAuth explicitly disabled, indicating it is effective.

Project-level: Effective only for the current project

File location: opencode.json in the root directory of the current project, which will override the global configuration. Suitable for team sharing, single repository customization, or temporarily enabling a certain MCP in a specific project.

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "suno": {
      "type": "remote",
      "url": "https://suno.mcp.acedata.cloud/mcp",
      "enabled": true,
      "oauth": false,
      "headers": { "Authorization": "Bearer {env:ACEDATACLOUD_API_KEY}" }
    }
  }
}

If the project-level opencode.json will be committed to Git, please ensure to use the {env:ACEDATACLOUD_API_KEY} placeholder instead of the real Token to avoid leaks.

💡 If the .env in Shell is not explicitly exported, you need to use set -a && source .env && set +a to pass the variables to the OpenCode process; otherwise, opencode debug config will show "Authorization": "Bearer " (placeholder not resolved).

Verify Connection

After configuration, run:

opencode mcp list
opencode mcp debug suno

Seeing suno connected indicates a successful handshake. If it fails, check whether ACEDATACLOUD_API_KEY has been exported, whether oauth is set to false, and whether Authorization includes the Bearer prefix. The model and tool Schema will continue to change, so please select models that support native tool calls from the current directory.

Typical Scenarios

After configuration, you can directly call using natural language in the OpenCode session without switching to /mcp:

Write a song in one sentence

Write a cheerful lofi hip-hop song, about 2 minutes long, without lyrics, to be used as background music for a programming video.

Custom lyrics + style

Sing these lyrics in indie rock style: (paste lyrics), male voice, 2 minutes 30 seconds.

Cover an already generated song

Change the last song to a jazz style cover.

Continue from the chorus

The chorus is nice, continue for another 30 seconds from the chorus.

Tool List

The table below lists the main tools; you can obtain the current complete list by using curl -X POST https://suno.mcp.acedata.cloud/mcp -H 'Authorization: Bearer <token>' -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","id":1,"method":"tools/list"}':

Tool Description
suno_generate_music Generate a complete song from a one-sentence description
suno_generate_custom_music Write your own lyrics, define style and vocals
suno_extend_music Continue an existing song from a certain point
suno_cover_music Cover in a different style
suno_mashup_music Mash up two songs into one
suno_stems_music Separate vocals and accompaniment
suno_generate_lyrics AI-generated lyrics
suno_create_persona Save vocal styles