Connecting OpenCode to Suno MCP

📘 Overview: OpenCode MCP Overview →

You are writing a product release log in the terminal, and after finishing it you suddenly think: it would be more complete if there were a 30-second BGM to accompany the video version of the release notes. After connecting to the Suno MCP Server, OpenCode can directly write songs on the spot based on the mood, style, and rhythm you describe, without switching to a browser or needing a separate music generation account.

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

Get an API Token

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

  1. Open the Ace Data Cloud Console - Application List, obtain your API Token, and keep it as a backup.
  2. If you have not logged in or registered yet, you will be automatically redirected to the login page; after logging in or registering, you will automatically return to the current page.
  3. Confirm that the key allows access to the required APIs, and view the balance and limits in the console.

Get Ace Data Cloud API Key

The API Key for general applications can be reused within its authorization scope. Documentation and screenshots are recommended to show only masked forms, such as YOUR_ACEDATACLOUD_API_KEY; do not paste the full Token into public repositories, Issues, screenshots, or chat logs.

Want to use Claude Desktop / the Claude.ai web version to authorize directly with one-click OAuth? See the Suno MCP Claude.ai / Desktop tutorial.

Configure OpenCode

First run opencode --version. For 2.x users, set ACEDATACLOUD_API_KEY in the terminal, then execute the following commands.

opencode mcp add suno --global --url https://suno.mcp.acedata.cloud/mcp --header 'Authorization=Bearer {env:ACEDATACLOUD_API_KEY}'
opencode reload
opencode mcp list

OpenCode 1.x Configuration

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

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

export ACEDATACLOUD_API_KEY="replace with your real Token"

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

Global: shared by all projects

File location: ~/.config/opencode/opencode.json, suitable for "my own machine, configure it once, and use it in 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}" }
    }
  }
}

A Bearer API Key is used here. "oauth": false makes OpenCode send request headers according to this configuration.

Project-level: effective only for the current project

File location: opencode.json in the root directory of the current project. For services with the same name, the definition in the project takes priority. Suitable for team sharing, single-repository customization, or temporarily enabling an MCP only in a certain 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, make sure to use the {env:ACEDATACLOUD_API_KEY} placeholder instead of a real Token to avoid leaks.

Please start OpenCode from a terminal where this environment variable has been set and exported.

Verify the Connection

After configuration, run:

opencode mcp list

Seeing suno connected means the handshake was successful. If it fails, check whether ACEDATACLOUD_API_KEY has been exported, the hosted address, and whether Authorization includes the Bearer prefix. Models and tool Schemas change continuously; please select a model that supports native tool calling from the current directory.

Typical Scenarios

After configuration is complete, you can directly invoke it in an OpenCode session using natural language, without first switching to /mcp:

Write a song in one sentence

Write an upbeat lofi hip-hop track, about 2 minutes long, with no lyrics, to use as background music for a programming video

Custom lyrics + style

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

Cover a generated song

Turn the previous song into a jazz-style cover

Continue from the chorus

The chorus is good; continue for another 30 seconds from after the chorus

Tool List

The table below lists commonly used tools. For full names, see the real-time tool list of the hosted service.

Tool Description
suno_generate_music Generate a complete song from a one-sentence description
suno_generate_custom_music Write your own lyrics, define the style and vocals
suno_extend_music Continue an existing song from a certain timestamp
suno_cover_music Create a 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 a vocal style