此仓库包含一个使用 MCP 和 librosa 进行音频分析的 模型上下文提供者(MCP),支持本地音频文件、YouTube 链接或音频链接。
要通过 Smithery 自动安装 Music Analysis 到 Claude Desktop:
npx -y @smithery/cli install @hugohow/mcp-music-analysis --client claude
# 克隆仓库
git clone git@github.com:hugohow/mcp-music-analysis.git
cd mcp-music-analysis
# 创建虚拟环境并安装
uv venv
source .venv/bin/activate # 在 Windows 上:.venv\Scripts\activate
uv pip install -e .
配置文件的位置取决于您的操作系统:
macOS:
~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows:
%APPDATA%\Claude\claude_desktop_config.json
Linux:
~/.config/Claude/claude_desktop_config.json
在您的 claude_desktop_config.json 中添加以下内容:
{
"mcpServers": {
"music-analysis": {
"command": "uvx",
"args": ["-n", "mcp-music-analysis"]
}
}
}
这里是一些您可以在对话或聊天环境中使用的示例提示。一旦服务器运行,MCP 将理解这些请求并执行相关的工具:
你能分析一下 /Users/hugohow-choong/Desktop/sample-6s.mp3 的节拍吗?
你能告诉我 https://download.samplelib.com/mp3/sample-15s.mp3 的时长吗?
请计算这个文件的 MFCC:/path/to/another_audio.mp3
/path/to/music.wav 的频谱质心值是多少?
我想知道 https://www.youtube.com/watch?v=8HFiFd9vx1c 的起始时间。
Hugo How-Choong