Skip to main content
Glama
netease-music-mcp

netease-music-mcp

by a2tem1sia

网易云音乐 MCP Connector(非官方)

CI Release License: MIT Node.js >= 20 MCP

中文 · English

让 Claude 直接访问网易云音乐:搜歌、看歌单 / 专辑 / 歌手 / 歌词 / 评论 / 排行榜,扫码登录后还能看每日推荐、"我喜欢的音乐"、听歌排行,以及新建歌单、往歌单里加歌、收藏歌曲。

本项目与网易公司无关。网易云音乐没有公开 API,这里用的是网页版 (music.163.com) 自己调用的接口,网易改接口时可能需要更新。

能做什么

分类

工具

说明

需要登录

搜索

search

歌曲 / 专辑 / 歌手 / 歌单 / 用户 / 按歌词搜歌 / 播客

详情

get_song_detail get_album get_artist get_playlist

批量歌曲信息、专辑曲目、歌手简介 + 热门歌曲 + 专辑、歌单曲目(分页)

歌词

get_lyrics

原文 + 中文翻译 + 罗马音,可选保留时间轴

发现

get_toplists get_similar_songs get_comments

官方排行榜、相似歌曲、热门评论 / 最新评论

登录

login_qr_start login_qr_check get_login_status logout

扫码登录,登录状态自动保存

我的

get_daily_recommendations get_recommended_playlists get_liked_songs get_user_playlists get_listening_history get_recent_plays

每日推荐、推荐歌单、我喜欢的音乐、我的歌单、听歌排行、最近播放

✅

修改

like_song create_playlist update_playlist_tracks

收藏 / 取消收藏、新建歌单、歌单加歌 / 删歌

✅

播放(仅电脑本地)

play_in_app playback_control

让网易云客户端播放指定歌曲 / 歌单 / 专辑,播放 / 暂停、切歌、音量(见控制播放)

结果里的 link 是网页链接,点开就能在浏览器或 App 里播放。

Related MCP server: Cloud Music MCP Server

工作原理

flowchart LR
  C["Claude<br/>Desktop / Code / claude.ai"] -- "MCP (stdio 或 HTTP)" --> S["netease-music-mcp<br/>24 个工具"]
  S -- "weapi(网页版加密)" --> W["music.163.com"]
  S -- "eapi(PC 客户端加密)" --> E["interfacepc.music.163.com"]
  S -. "登录状态" .-> K[("~/.netease-music-mcp/cookie.json")]
  S -. "orpheus:// 链接 / 系统媒体键(仅本地)" .-> A["电脑上的网易云客户端"]

连接器把 Claude 的工具调用翻译成网易云网页版 / PC 客户端的加密请求,再把返回结果精简成适合模型阅读的格式。某个接口被拒绝(例如被识别为境外网络)时,会自动换用另一种接口重试。

安装

需要 Node.js 20 或更新版本(用 .mcpb 一键安装时,Claude Desktop 会使用自带的 Node)。

方式一:Claude Desktop 一键安装(推荐)

  1. 从 Releases 下载最新版本的 .mcpb 文件(或者克隆本仓库后运行 npm install && npm run pack:mcpb 自己生成)。

  2. 双击这个 .mcpb 文件,或者把它拖进 Claude Desktop 的 设置 → 扩展 页面。

  3. 点 安装。Cookie 那一栏留空即可。

  4. 在对话里说"登录网易云",用网易云音乐 App 扫描二维码。

方式二:Claude Desktop 手动配置

先在项目目录运行 npm install && npm run build,然后编辑 claude_desktop_config.json(设置 → 开发者 → 编辑配置):

{
  "mcpServers": {
    "netease-music": {
      "command": "node",
      "args": ["/绝对路径/netease-music-mcp/dist/index.js"]
    }
  }
}

方式三:Claude Code

claude mcp add netease-music -- node /绝对路径/netease-music-mcp/dist/index.js

方式四:claude.ai 网页版 / 手机 App(远程连接器)

claude.ai 上的自定义连接器是从 Anthropic 的服务器访问你的连接器的,所以需要把它部署到一台有公网 HTTPS 地址的服务器上:

npm install && npm run build
MCP_AUTH_TOKEN="换成一串至少 16 位的随机字符" PORT=8787 node dist/index.js --http

再用 Caddy / Nginx 等反向代理加上 HTTPS,然后在 claude.ai 的 设置 → 连接器 → 添加自定义连接器 里填:

https://你的域名/mcp/<MCP_AUTH_TOKEN>
  • 令牌就是访问密码,拿到这个 URL 的人都能操作你的网易云账号,不要外泄。也支持 Authorization: Bearer <token> 请求头,此时 URL 用 /mcp。

  • 没设置 MCP_AUTH_TOKEN 时会随机生成一个并打印在日志里(只在本次运行有效)。

  • 健康检查:GET /healthz。

  • 服务器最好在中国大陆或网易云能正常访问的地区,否则部分接口可能受限。

登录

扫码登录(推荐):对 Claude 说"登录网易云"。Claude 会调用 login_qr_start 显示二维码(图片,或者一段由方块字符组成的二维码),用网易云音乐 App 右上角的"扫一扫"扫码并在手机上确认,再让 Claude 检查登录状态。

如果看不到二维码图片:图片也保存在系统临时目录的 netease-music-login-qr.png(具体路径见返回结果中的 qr_image_path)。

Cookie 登录(扫码被风控拦截时使用):

  1. 用电脑浏览器登录 https://music.163.com

  2. 按 F12 → Application(应用) → Cookies → https://music.163.com

  3. 复制 MUSIC_U 的值

  4. 填到扩展设置的"网易云 Cookie"里,或者设置环境变量 NETEASE_COOKIE=<MUSIC_U 的值>(也可以填完整的 Cookie 串)

登录状态保存在 ~/.netease-music-mcp/cookie.json(权限 600,只有你自己能读),可以用环境变量 NETEASE_COOKIE_FILE 修改位置。说"退出网易云登录"会删除这个文件。

控制播放(仅电脑本地)

连接器装在你自己的电脑上(Claude Desktop 扩展、Claude Code)时,会多出两个工具:

  • play_in_app:让电脑上的网易云客户端播放指定的歌曲、歌单、专辑、歌手热门歌曲或电台,客户端没开时会先启动。用的是网页版「在客户端播放」按钮同款的 orpheus:// 链接。

  • playback_control:播放 / 暂停、上一首、下一首、调节音量、静音。通过系统媒体键实现,作用于系统当前"正在播放"的应用(正在用网易云听歌时就是网易云);音量调节的是系统音量。

    • macOS:第一次使用会弹出授权提示,到 系统设置 → 隐私与安全性 → 辅助功能 里打开 Claude(Claude Code 则是你的终端 App)。

    • Windows:不需要额外设置。

    • Linux:需要安装 playerctl,并且播放器支持 MPRIS。

几点说明:

  • 测试情况:已在 macOS 实机上验证,play_in_app 会让客户端直接开始播放,playback_control 的暂停、下一首可用。Windows 和 Linux 只做了模拟测试,还没在真机上验证,欢迎反馈。

  • 远程模式(claude.ai 自定义连接器)默认不提供这两个工具,因为它们控制的是运行连接器的那台机器。如果你就是在自己电脑上运行 HTTP 模式,可以设置 NETEASE_LOCAL_CONTROL=1 打开。

  • 网易云没有公开的远程播放控制接口,所以无法从云端控制手机上的播放。"接力播放"接口实测提交成功但手机端没有任何反应。

  • 想知道正在听什么,可以用 get_recent_plays:它来自网易云的播放记录,所有设备通用,但通常比实际播放晚几分钟。

试试这样问

  • "搜一下周杰伦的《晴天》,把歌词和翻译给我"

  • "网易云热歌榜现在前 20 是哪些歌?"

  • "看看我今天的每日推荐,挑 5 首适合写代码时听的"

  • "分析一下我最近一周的听歌排行,我的口味是什么样的"

  • "新建一个叫'雨天'的歌单,放 15 首安静的华语歌进去"

  • "这首歌的热门评论都在说什么?"

  • "我刚才听的那首叫什么?"

  • "用网易云放一下我的 sleep 歌单"(需要本地安装)

  • "下一首" / "暂停" / "声音小一点"(需要本地安装)

修改类操作(收藏、建歌单、加歌)会改动你的真实账号,Claude 会先跟你确认。

隐私

  • 连接器只和网易云音乐的服务器(music.163.com、interfacepc.music.163.com)通信,不会把数据发给其它第三方。

  • 你的登录 Cookie 只保存在运行连接器的那台机器上。

常见问题

现象

原因 / 解决

扫码时提示"触发风控验证" (8821)

网易云对接口登录做了限制,改用上面的 Cookie 登录。

"需要登录网易云音乐"

还没登录,或登录已过期(MUSIC_U 一般几周到几个月有效),重新扫码即可。

"无法连接网易云音乐服务器"

当前网络访问不了 music.163.com,检查网络 / 代理。

需要通过 HTTP 代理才能上网

Node.js 默认不走系统代理。设置环境变量 NODE_USE_ENV_PROXY=1(需要 Node ≥ 22.21),它会读取 HTTPS_PROXY。

提示"网易云把当前网络识别为境外"

部分接口对境外 IP 返回加密数据。连接器会自动换用其它接口,换不了时才会出现这个提示。部署到海外服务器时可能遇到。

歌曲标记 unavailable: true

该歌曲在网易云下架或没有版权。

某个接口返回错误码

网易可能改了接口,欢迎提交 issue。

开发

npm install
npm test            # 编译 + 运行测试(使用本地模拟的网易云服务器,不访问外网)
npm run pack:mcpb   # 生成 Claude Desktop 扩展 netease-music-mcp-<版本>.mcpb
npm run test:live   # 连真实的网易云逐个调用只读工具(不会修改账号)
                    #   加 NETEASE_COOKIE=<MUSIC_U> 可同时测试需要登录的接口

源码结构:

src/
  crypto.ts    weapi / eapi 请求加密
  client.ts    HTTP 客户端、cookie、weapi→eapi 自动回退
  cookies.ts   cookie 解析与保存
  format.ts    把原始返回精简成模型友好的结构
  tools.ts     全部 MCP 工具定义
  http.ts      Streamable HTTP 传输(远程连接器)
  index.ts     入口(默认 stdio,--http 为远程模式)

接口与加密参考了开源项目 NeteaseCloudMusicApi。

贡献者

欢迎提交 issue 和 pull request。

版本记录见 CHANGELOG.md。


English

netease-music-mcp is an unofficial MCP server that connects Claude to NetEase Cloud Music (网易云音乐), China's popular music streaming service. It is not affiliated with NetEase.

  • 24 tools (22 in remote mode): search (songs, albums, artists, playlists, users, lyrics, podcasts); song, album, artist and playlist details; lyrics with translations; comments; charts; similar songs; QR-code login; daily recommendations; liked songs; your playlists; listening history; editing playlists or liking songs; and, when running on your own computer, playing songs or playlists in the NetEase desktop client and controlling playback through system media keys. Claude asks before any change to your account.

  • Install: download the .mcpb from Releases and open it in Claude Desktop, or run claude mcp add netease-music -- node /path/to/dist/index.js for Claude Code. node dist/index.js --http serves Streamable HTTP with token auth for claude.ai custom connectors.

  • Login: say "log in to NetEase Cloud Music" and scan the QR code with the NetEase app, or set NETEASE_COOKIE to your MUSIC_U cookie.

  • Tested against the real NetEase servers with npm run test:live, logged in and anonymous.

  • Uses the undocumented web (weapi) and PC client (eapi) endpoints, which NetEase may change at any time.

Available Tools

24 tools
create_playlist新建歌单A

在当前用户账号下新建一个歌单,返回歌单 ID。之后可用 update_playlist_tracks 添加歌曲。会修改用户账号,调用前请确认。

Inputs: name (required), private.

get_album专辑详情B
Read-only

获取专辑信息和曲目列表。

Inputs: id (required).

get_artist歌手详情C
Read-only

获取歌手简介和热门歌曲,可选附带专辑列表。

Inputs: id (required), top_songs, album_limit, album_offset, +1 more.

get_comments评论A
Read-only

获取歌曲 / 歌单 / 专辑 / MV 的评论。第一页会附带热门评论。

Inputs: id (required), limit, offset, resource_type.

get_daily_recommendations每日推荐A
Read-only

获取当前登录用户的每日推荐歌曲(需要登录)。

Inputs: no named parameters.

get_liked_songs我喜欢的音乐A
Read-only

获取用户“喜欢”的歌曲(默认当前登录用户),和 App 里“我喜欢的音乐”歌单顺序一致:最近喜欢的在前,附带喜欢的日期。

Inputs: uid, limit, offset.

get_listening_history听歌排行B
Read-only

获取用户的听歌排行(最近一周或所有时间)。他人的听歌排行可能因隐私设置不可见。

Inputs: uid, limit, period.

get_login_status登录状态A
Read-only

查看当前是否已登录网易云音乐,以及登录账号的基本信息。

Inputs: no named parameters.

get_lyrics获取歌词A
Read-only

获取歌曲歌词,包括原文、中文翻译和罗马音(如果有)。

Inputs: id (required), with_timestamps.

get_playlist歌单详情B
Read-only

获取歌单信息和其中的歌曲(支持分页)。排行榜也可以用这个工具查看。

Inputs: id (required), limit, offset.

get_recent_plays最近播放A
Read-only

获取当前登录用户最近播放的歌曲(来自所有设备,按时间倒序,通常有几分钟延迟),可以回答“我刚才在听什么”。需要登录。

Inputs: limit.

get_similar_songs相似歌曲B
Read-only

根据一首歌获取网易云推荐的相似歌曲。

Inputs: id (required), limit.

get_song_detail歌曲详情A
Read-only

根据歌曲 ID 批量获取歌曲信息(歌名、歌手、专辑、时长、是否 VIP)。

Inputs: ids (required).

get_toplists排行榜列表A
Read-only

获取网易云所有官方排行榜(飙升榜、新歌榜、热歌榜、原创榜等)。用 get_playlist 查看某个榜单的歌曲。

Inputs: no named parameters.

get_user_playlists用户歌单A
Read-only

获取用户创建和收藏的歌单(默认当前登录用户;他人的公开歌单也可以查)。

Inputs: uid, limit, offset.

like_song喜欢 / 取消喜欢A
Idempotent

把歌曲加入(或移出)当前用户的“我喜欢的音乐”。会修改用户账号,调用前请确认。

Inputs: id (required), like.

login_qr_check扫码登录:检查状态A

检查二维码登录状态。可设置 wait_seconds 在服务器端等待用户扫码(每 2 秒轮询一次),登录成功后自动保存登录状态。

Inputs: login_key (required), wait_seconds.

login_qr_start扫码登录:生成二维码A

生成网易云音乐登录二维码。把二维码展示给用户(返回的图片,或把 qr_text 原样放进代码块),请用户用网易云音乐 App 扫码并在手机上确认,然后调用 login_qr_check。

Inputs: no named parameters.

logout退出登录A
DestructiveIdempotent

清除本连接器保存的网易云登录状态。

Inputs: no named parameters.

playback_control播放控制A

控制这台电脑上的播放:播放/暂停、上一首、下一首、调节系统音量、静音。通过系统媒体键实现,作用于系统当前“正在播放”的应用(正在用网易云听歌时就是网易云)。macOS 第一次使用需要在“系统设置 → 隐私与安全性 → 辅助功能”里允许 Claude。

Inputs: action (required), times.

play_in_app在网易云客户端播放A

让这台电脑上的网易云音乐客户端播放指定的歌曲、歌单、专辑、歌手热门歌曲或电台(客户端没打开时会先启动)。ID 可以从 search、get_* 等工具获得。

Inputs: id (required), type.

update_playlist_tracks歌单增删歌曲A
DestructiveIdempotent

向当前用户自己创建的歌单添加或移除歌曲。会修改用户账号,调用前请确认。

Inputs: song_ids (required), playlist_id (required), op.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 24 tools

    Disambiguation4/5

    Most tools target clearly distinct resources and actions (get_artist vs get_album vs get_playlist, play_in_app vs playback_control). The main potential confusion is among the personal-listening tools (get_listening_history vs get_recent_plays vs get_liked_songs), but the descriptions explicitly differentiate them. Boundaries are generally clear.

    Naming Consistency4/5

    The dominant pattern is snake_case verb_noun (get_artist, get_lyrics, create_playlist, update_playlist_tracks, like_song), which is predictable. Minor deviations exist: login_qr_start/login_qr_check use noun_action ordering, and a few bare names (search, logout, playback_control) drop the object. Still largely readable and consistent.

    Tool Count3/5

    24 tools is on the heavy side (16-25 band) for a music client. Each tool does cover a distinct function, so none are clearly redundant, but the surface is large enough that it feels crowded relative to the domain. Borderline rather than ideal.

    Completeness4/5

    Coverage is broad: search, detail/lyrics, artist/album/playlist, comments, similar songs, toplists, recommendations, full auth lifecycle, user library (liked, playlists, history, recent), and playback control. Minor gaps remain (e.g., no delete_playlist, no comment posting, no explicit MV/podcast playback), but core workflows are complete.

    Maintenance

    ActivityNo data
    ResponsivenessNo recent community issues

    Related MCP Connectors

    • Spotify MCP server for ChatGPT, Claude and any AI agent: search songs and artists, list playlists, read playlist songs, create playlist, add songs to playlist, remove songs from playlist, set playlist public or private and save to Liked Songs in your own Spotify account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Spotify yourself; Cotlet does not store your password and you need no Spotify API key. About the official Spotify API: Spotify has a full Web API and, since 23 Apr 2026, an official connector for Claude (checked 5 Nov 2026). The API needs an app you register, and in development mode the app owner must have Premium and the app allows 5 users; unlimited users need a registered business with at least 250,000 monthly users. Setup and FAQ: https://cotlet.dev/integrations/spotify-api-mcp-server

      https://cotlet.dev/mcp/v1/spotify
    • Generate full songs with vocals, instrumentals and sound effects from text. One server for Suno, Google Lyria, Mureka, MiniMax, ACE-Step, YuE and ElevenLabs. Your agent can quote the credit cost before generating, start a song, wait for it to finish and return download links. Sign in with OAuth; optional daily credit caps; retries never charge twice.

      https://www.raomusic.com/api/mcp
    • Music industry tools for AI agents: artist research, catalogs, release plans and content.

      https://api.recoupable.dev/mcp
    • Bandsintown MCP server for ChatGPT, Claude and any AI agent: add event, update event, delete event, send fan message, get fan stats and list upcoming events in your own Bandsintown account. Cotlet works in the account through your Cloud Browser, a real Chrome where you sign in to Bandsintown yourself; Cotlet does not store your password and you need no Bandsintown API key. About the official Bandsintown API: Bandsintown has a public API, but it only reads: artist info and artist events (checked 11 Oct 2026). You cannot add, edit or delete events, post to followers or read Insights through it, and each API key is tied to one artist. Setup and FAQ: https://cotlet.dev/integrations/bandsintown-api-mcp-server

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Controls the official NetEase Cloud Music desktop client on Windows, enabling AI to search, play, manage queues, and adjust playback settings via a local control channel.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables local QR-code login to NetEase Cloud Music and read-only access to complete liked-song pagination, playlists, search, song details, daily recommendations, and listening history with whole-library recommendation de-duplication.
      MIT