本项目提供了一个 模型上下文提供程序(MCP),借助 MCP 和 librosa 对音频进行全面分析。它支持本地文件、YouTube 链接或音频链接等多种输入方式,为音乐分析带来了极大的便利。
此仓库包含的模型上下文提供程序,能让你轻松对音频进行分析。下面为你详细介绍使用方法。
通过 Smithery 可自动安装 Music Analysis for 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 .
根据操作系统的不同,配置文件的位置也有所不同:
~/Library/Application\ Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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
什么是 music.wav 文件的频谱质心值?
我想要了解 https://www.youtube.com/watch?v=8HFiFd9vx1c 的节奏起始时间。
文档未提及许可证信息,故跳过此章节。
Hugo How - Choong