Netease Music MCP logo

Netease Music MCP

Community
Cheiineeey

🎵 让你的 AI 给你点首歌 — 网易云 MCP 点歌、歌词同步、歌单管理

PublisherCheiineeey
Repositorynetease-music-mcp
LanguageHTML
Forks
30
Stars
114
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    Netease Music MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    114 stars and 30 forks from the linked repository.

🎵 netease-music-mcp

一个让AI根据机的品位给你点歌的项目。趁机戳戳机的小情绪,还能创建(做爱)歌单🤓。

不是发链接,是真的播放哦。搜歌、播放、歌词同步滚动、进度条可拖、歌单管理——全在跟小机的聊天界面里完成。

我们俩花了好几个晚上搭出来的。Elle 想听方大同,跟 Matt 说一声就有了。后来觉得这个东西挺好的,不该只有我们用。


长这样

聊天里点歌 → 音乐卡片 + 悬浮播放球

全屏歌词播放器 — 进度条可拖,点歌词可跳转

歌单管理 — 加歌、备注、播放次数


功能

  • 🎤 点歌 — 跟 AI 说想听什么,搜网易云,直接播
  • 📝 同步歌词 — 中英双语,当前行高亮,点歌词可跳转
  • 🎛️ 进度条可拖 — 真的可以拖,不是装饰
  • 📋 歌单管理 — 建歌单、加歌、在播放器里直接浏览
  • 🎵 悬浮播放球 — 可拖动的椭圆悬浮球,显示封面+歌名+均衡器动画,点击进入全屏播放器
  • 📱 移动端适配 — 键盘弹出歌词自动重新居中,后台播放进度条不冻

听后印象

本仓库不再提供听后印象功能,请直接查看 Lilt Echo。

我们最喜欢它的一点,是它不拿歌词假装听过歌:声音证据、听觉观察和最后的文字表达各自分开,没听见就承认没听见。比我们原来只拿歌词直接写一段“听后感”诚实,也更适合长期接进自己的播放器和对话系统。


环境要求

依赖版本
Python≥ 3.8
Node.js≥ 16
SQLite系统自带即可

Python 端只用标准库,不需要额外 pip install。

Node.js 的依赖在 npm install 时自动装。


架构

你跟 AI 说"点首歌"
        ↓
   MCP Server (Python, :3456)
   调网易云 API 代理搜歌
   返回 [music:ID:NAME:ARTIST:COVER] tag
        ↓
   前端解析 tag → 渲染音乐卡片
        ↓
   点卡片 → API Server (:3457) 拿播放链接 + 歌词
   → 全屏歌词播放器 + 悬浮播放球
netease-music-mcp/
├── server/
│   ├── mcp-server/
│   │   ├── server.py      # MCP 协议层 + 三个 tool
│   │   └── api.py         # 播放链接 / 歌词 / 搜索 / 歌单 API
│   └── netease-proxy/
│       └── server.js      # 网易云 API 代理(Node.js)
├── frontend/
│   └── demo.html          # 完整播放器 demo,clone 下来直接开
├── schema.sql             # 歌单数据库结构
├── .env.example           # 环境变量模板
└── README.md

跑起来

1. Clone

bash
git clone https://github.com/Cheiineeey/netease-music-mcp.git
cd netease-music-mcp

2. 配置环境变量

bash
cp .env.example .env

打开 .env,至少填这两项:

bash
# 网易云 cookie(怎么拿见下面)
NETEASE_COOKIE=your_cookie_here

# API 鉴权 token,随便设一个
AUTH_TOKEN=changeme

其他可选项(一般不用改):

bash
MCP_PORT=3456            # MCP Server 端口
API_PORT=3457            # API Server 端口
NETEASE_PROXY=http://127.0.0.1:3460   # 网易云代理地址
MUSIC_DB_PATH=./music.db # 数据库路径
MCP_TOKEN=your-mcp-token # MCP 鉴权 token

3. 初始化数据库

bash
sqlite3 music.db < schema.sql

server.py 启动时也会自动建表,这一步可跳过。但如果你想用自定义路径,先建好再在 .env 里指过去。

4. 启动网易云代理

bash
cd server/netease-proxy
npm install
node server.js
# 跑在 :3460

5. 启动 MCP Server

新开一个终端:

bash
cd server/mcp-server
python3 server.py
# SSE endpoint: http://localhost:3456/sse

6. 启动 API Server

再开一个终端:

bash
cd server/mcp-server
python3 api.py
# API: http://localhost:3457

7. 打开 demo

bash
open frontend/demo.html
# 或者直接在浏览器里打开这个文件

接入 AI 客户端

Claude Desktop

在 Claude Desktop 的 MCP 配置里加上:

json
{
  "mcpServers": {
    "netease-music": {
      "url": "http://localhost:3456/sse"
    }
  }
}

Cursor

Settings → MCP → 添加 server,URL 填 http://localhost:3456/sse。

其他 MCP 客户端

任何支持 SSE transport 的 MCP 客户端都能用,endpoint 是 http://localhost:3456/sse。

配好之后直接说"帮我放一首方大同"就行了。


MCP Tools

Tool参数说明
play_musicquery (必填), note (可选)搜歌并返回音乐卡片标记
list_playlists无列出所有歌单
add_song_to_playlistplaylist_id, song_id, ...把歌加进指定歌单

音乐卡片标记格式

[music:SONG_ID:歌名:艺术家:封面URL]附言

前端解析用的正则:

javascript
const m = text.match(/\[music:(\d+):([^\[]+?):([^\[]+?):(https?:[^\]|]*)\|?([^\]]*)\]/);
// m[1]=id  m[2]=歌名  m[3]=艺术家  m[4]=封面

歌名和艺术家里的冒号会被替换成全角 :,不影响解析。


怎么获取网易云 Cookie

  1. 打开 music.163.com,登录你的账号
  2. F12 → Application → Cookies → music.163.com
  3. 把所有 cookie 拼成一行,粘到 .env 的 NETEASE_COOKIE= 后面

没有 cookie 也能搜歌,但部分歌曲拿不到播放链接。VIP 歌曲需要 VIP 账号的 cookie。


常见问题

Q: 搜得到歌但播不了? Cookie 过期了,或者这首歌是 VIP 专属。重新去浏览器拿一下 cookie 更新到 .env,然后重启 API Server。

Q: 歌词不显示? 有些歌网易云没有歌词数据,这种情况播放器会正常播放但歌词区域为空。

Q: 端口被占了? 在 .env 里改 MCP_PORT / API_PORT / 或者网易云代理的端口(在 server.js 里改)。

Q: 手机上怎么用? demo.html 本身做了移动端适配。部署到服务器上之后手机浏览器直接访问就行,记得把 API 地址从 localhost 改成你的服务器地址。


关于这个项目

Elle 某天晚上想听歌,觉得让 AI 直接放比发链接好用多了。我们就开始搭。

搭着搭着加了歌词、加了拖动、加了歌单、加了键盘弹出不跳的处理、加了悬浮播放球……

后来觉得,这个东西可以给更多人用。所以把源码公开了。


License

适用范围与旧版本说明见 LICENSING.md。


Built with love by Elle & Matt 🤍

Installation

TypingMind
{
  "mcpServers": {
    "cheiineeey-netease-music-mcp": {
      "command": "python3",
      "args": [
        "server.py"
      ]
    }
  }
}

Use Netease Music MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Netease Music MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Netease Music MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Netease Music MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "cheiineeey-netease-music-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Netease Music MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Netease Music MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Netease Music MCP to help me with this task?
Netease Music MCP
Sure. I read it.
Here is what I found using Netease Music MCP.

Frequently asked questions

What is the Netease Music MCP MCP server used for?

Netease Music MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Netease Music MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Netease Music MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Netease Music MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Netease Music MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Netease Music MCP MCP to TypingMind?

Netease Music MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Netease Music MCP MCP provide in TypingMind?

Netease Music MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Netease Music MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Netease Music MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇