npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yuezheng2006/suno-mcp-server

v0.3.2

Published

MCP server for Suno AI music generation

Readme

Suno MCP Server

MCP (Model Context Protocol) server for Suno AI music generation. 为开发者提供便捷的 Suno AI 音乐生成能力。

功能特性

  • 🎵 音乐生成:支持灵感模式、自定义模式、纯音乐模式
  • 📝 歌词创作:AI 生成两组歌词供选择
  • ⏱️ 音乐延长:延长现有音乐到任意时长
  • 🎤 翻唱功能:用新歌词和风格翻唱音乐
  • ✂️ 局部编辑:编辑音乐特定时间段的歌词
  • 编辑确认:局部编辑后确认替换生成完整歌曲
  • 🎚️ 音轨分离:分离人声和伴奏(2轨/12轨)
  • 🎨 音色管理:创建、使用和查看音色列表
  • ⬆️ 音频上传:上传外部音频进行处理
  • 🔄 音质重制:使用 v5 模型提升音质
  • ✂️ 音乐裁剪:裁剪或删除音乐特定时间段
  • 💰 余额查询:查看账户剩余额度
  • ☁️ CDN上传:上传本地音频到 Cloudflare R2 获取公开 URL (v0.3.0+)

安装

npm install -g @suno-cn/mcp-server

配置

Claude Desktop 配置

编辑 Claude Desktop 配置文件:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

添加以下配置:

{
  "mcpServers": {
    "suno": {
      "command": "suno-mcp",
      "env": {
        "SUNO_API_TOKEN": "your-api-token-here",
        "SUNO_API_BASE_URL": "https://payapi.damobi.cn",
        "SUNO_DEFAULT_MODEL": "v5"
      }
    }
  }
}

环境变量

Suno API 配置:

| 变量名 | 必填 | 默认值 | 说明 | |--------|------|--------|------| | SUNO_API_TOKEN | ✅ | - | Suno API 令牌 | | SUNO_API_BASE_URL | ❌ | https://payapi.damobi.cn | API 基础地址 | | SUNO_DEFAULT_MODEL | ❌ | v5 | 默认模型版本 | | SUNO_POLLING_INTERVAL | ❌ | 5000 | 轮询间隔(毫秒) | | SUNO_MAX_WAIT_TIME | ❌ | 300000 | 最大等待时间(毫秒) |

CDN 存储配置(可选,用于 suno_upload_to_cdn):

| 变量名 | 必填 | 说明 | |--------|------|------| | R2_ACCOUNT_ID | ✅ | Cloudflare 账户 ID | | R2_ACCESS_KEY_ID | ✅ | R2 访问密钥 ID | | R2_SECRET_ACCESS_KEY | ✅ | R2 机密访问密钥 | | R2_BUCKET_NAME | ✅ | R2 存储桶名称 | | R2_PUBLIC_URL | ❌ | R2 公开访问 URL |

💡 提示:如果不配置 R2 环境变量,可以在调用 suno_upload_to_cdn 时通过参数传递配置。

工具列表

1. suno_generate_music - 生成音乐

生成 AI 音乐,支持多种模式和高级参数。

参数:

  • description (string): 音乐描述(灵感模式)
  • lyrics (string): 歌词内容(自定义模式)
  • title (string, 可选): 歌曲标题
  • style (string, 可选): 音乐风格
  • instrumental (boolean, 默认 false): 是否生成纯音乐
  • modelVersion (string, 默认 v5): 模型版本 (v3.5/v4/v4.5/v5)
  • vocalGender (string, 可选): 声音性别 (f/m)
  • styleWeight (number, 可选): 风格参考度 (0-1)
  • weirdnessConstraint (number, 可选): 怪异约束度 (0-1)
  • variationLevel (string, 可选): 变化程度 (subtle/normal/high, 仅v5)
  • wait (boolean, 默认 true): 是否等待生成完成

示例:

生成一首关于星空的温柔民谣

2. suno_generate_lyrics - 生成歌词

根据主题生成两组歌词供选择。

参数:

  • theme (string): 歌词主题
  • wait (boolean, 默认 true): 是否等待完成

3. suno_get_task - 查询任务

查询任务状态和结果。

参数:

  • taskId (number): 任务 ID
  • wait (boolean, 默认 false): 是否等待完成

4. suno_list_my_music - 列出音乐

列出最近生成的音乐,获取 Suno ID。

参数:

  • page (number, 默认 1): 页码
  • limit (number, 默认 10): 每页数量
  • status (string, 默认 completed): 过滤状态 (all/completed/processing/failed)

5. suno_extend_music - 延长音乐

延长现有音乐。

参数:

  • sunoId (string): 音乐 Suno ID
  • continueAt (number): 从第几秒开始延长
  • modelVersion (string, 默认 v5): 模型版本
  • wait (boolean, 默认 true): 是否等待完成

6. suno_cover_song - 翻唱音乐

用新歌词和风格翻唱音乐。

参数:

  • sunoId (string): 要翻唱的音乐 ID
  • lyrics (string): 新歌词
  • title (string, 可选): 新标题
  • style (string, 可选): 新风格
  • modelVersion (string, 默认 v5): 模型版本
  • wait (boolean, 默认 true): 是否等待完成

7. suno_edit_section - 局部编辑

编辑音乐的指定时间段。

参数:

  • sunoId (string): 音乐 ID
  • startTime (number): 开始时间(秒)
  • endTime (number): 结束时间(秒)
  • newLyrics (string): 新歌词
  • fullLyrics (string, 可选): 完整歌词
  • style (string, 可选): 风格
  • mode (string, 默认 smart): 编辑模式 (smart/classic/fixed)
  • wait (boolean, 默认 true): 是否等待完成

8. suno_separate_audio - 分离音轨

将音乐分离成独立音轨。

参数:

  • sunoId (string): 音乐 ID
  • mode (string, 默认 vocals_instrumental): 分离模式 (vocals_instrumental/full_stems)
  • wait (boolean, 默认 true): 是否等待完成

9. suno_upload_audio - 上传音频

上传外部音频到 Suno。

参数:

  • url (string): 音频文件 URL
  • wait (boolean, 默认 true): 是否等待完成

10. suno_create_voice - 创建/使用音色

提取音色并生成新歌曲。

参数:

  • action (string): 操作类型 (create/use)
  • sourceSunoId (string): 源音乐 ID(创建时)
  • voiceName (string): 音色名称(创建时)
  • voiceId (string): 音色 ID(使用时)
  • artistClipId (string): 音色歌曲 ID(使用时)
  • lyrics (string): 新歌词(使用时)
  • title (string, 可选): 标题(使用时)
  • style (string, 可选): 风格(使用时)
  • wait (boolean, 默认 true): 是否等待完成

11. suno_remaster - 重制音质

使用 v5 模型重制音乐。

参数:

  • sunoId (string): 音乐 ID
  • variationLevel (string, 默认 normal): 变化程度 (subtle/normal/high)
  • wait (boolean, 默认 true): 是否等待完成

12. suno_confirm_edit - 确认编辑替换

局部编辑后确认替换,生成完整歌曲。

参数:

  • clipId (string): 编辑后返回的片段 ID
  • wait (boolean, 默认 true): 是否等待完成

说明: 使用 suno_edit_section 后必须调用此工具才能获得完整歌曲

13. suno_get_credits - 查询余额

查询账户剩余额度。

参数:

14. suno_list_voices - 获取音色列表

获取已创建的音色列表。

参数:

  • page (number, 默认 1): 页码
  • limit (number, 默认 10): 每页数量

15. suno_crop_music - 裁剪音乐

裁剪音乐保留指定时间段,或删除指定时间段。

参数:

  • sunoId (string): 音乐 ID
  • startTime (number): 开始时间(秒)
  • endTime (number): 结束时间(秒)
  • removeSection (boolean, 默认 false): 是否删除该时间段
  • wait (boolean, 默认 true): 是否等待完成

16. suno_upload_to_cdn - 上传音频到 CDN

上传本地音频文件到 Cloudflare R2 CDN,返回公开可访问的 URL。可用于提供给 Suno 作为参考音频。

🔐 安全提示:此功能使用内置的默认 R2 配置,需要提供访问密码(默认:0824)以防止滥用。

参数:

  • filePath (string, 必需): 本地音频文件路径(绝对路径或相对路径)
  • filename (string, 可选): 自定义文件名,不提供则使用原文件名
  • password (string, 可选): 访问密码,默认 0824
  • r2Config (object, 可选): 自定义 R2 配置,不提供则使用默认配置
    • accountId (string): Cloudflare 账户 ID
    • accessKeyId (string): R2 访问密钥 ID
    • secretAccessKey (string): R2 机密访问密钥
    • bucketName (string): R2 存储桶名称
    • publicUrl (string, 可选): R2 公开访问 URL

环境变量配置(可选):

# 自定义密码
R2_PASSWORD=your-custom-password

# 自定义 R2 配置(可选,不配置则使用内置默认配置)
R2_ACCOUNT_ID=your-account-id
R2_ACCESS_KEY_ID=your-access-key-id
R2_SECRET_ACCESS_KEY=your-secret-access-key
R2_BUCKET_NAME=your-bucket-name
R2_PUBLIC_URL=https://your-public-url  # 可选

使用示例

生成音乐

请用 Suno 生成一首关于自由的摇滚歌曲

延长音乐

先列出我最近的音乐,然后延长第一首到 3 分钟

局部编辑工作流

1. 列出我的音乐
2. 编辑第一首歌的 30秒-60秒 部分
3. 确认替换生成完整歌曲

音色管理

1. 查看我创建的所有音色
2. 使用指定音色生成新歌曲

完整工作流

1. 查询账户余额
2. 生成一首关于星空的民谣
3. 把它延长到 4 分钟
4. 分离出人声和伴奏
5. 裁剪保留 0-180 秒部分

模型版本对比

| 版本 | API参数 | 特点 | 适用场景 | |-----|---------|------|---------| | v3.5 | chirp-v3-5 | 稳定版本 | 基础音乐生成 | | v4 | chirp-v4 | 音质提升 | 高质量音乐 | | v4.5 | chirp-auk/bluejay | 新增高级参数 | 精细控制风格 | | v5 | chirp-crow | 最新最强 | 推荐使用 |

开发

本地开发

# 克隆仓库
git clone <repo-url>
cd mcp

# 安装依赖
npm install

# 开发模式运行
npm run dev

# 构建
npm run build

调试

使用 Claude Desktop 配置:

{
  "mcpServers": {
    "suno-dev": {
      "command": "node",
      "args": ["/path/to/mcp/dist/index.js"],
      "env": {
        "SUNO_API_TOKEN": "your-token"
      }
    }
  }
}

发布

# 登录 npm
npm login

# 发布
npm publish --access public

License

MIT

相关链接