mcp-audio-analysis

mcp-audio-analysis

MCP 用于分析本地音频文件。

数据与应用分析
访问服务器

Tools

load

Loads an audio file and returns the path to the audio time series Offset and duration are optional, in seconds. Be careful, you will never know the name of the song.

get_duration

Returns the total duration (in seconds) of the given audio time series.

tempo

Estimates the tempo (in BPM) of the given audio time series using librosa. Offset and duration are optional, in seconds.

chroma_cqt

Computes the chroma CQT of the given audio time series using librosa. The chroma CQT is a representation of the audio signal in terms of its chromatic content, which is useful for music analysis. The chroma CQT is computed using the following parameters: - path_audio_time_series_y: The path to the audio time series (CSV file). It's sometimes better to take harmonics only - hop_length: The number of samples between frames. - fmin: The minimum frequency of the chroma feature. - n_chroma: The number of chroma bins (default is 12). - n_octaves: The number of octaves to include in the chroma feature. The chroma CQT is saved to a CSV file with the following columns: - note: The note name (C, C#, D, etc.). - time: The time position of the note in seconds. - amplitude: The amplitude of the note at that time. The path to the CSV file is returned.

mfcc

Computes the MFCC of the given audio time series using librosa. The MFCC is a representation of the audio signal in terms of its spectral content, which is useful for music analysis. The MFCC is computed using the following parameters: - path_audio_time_series_y: The path to the audio time series (CSV file). It's sometimes better to take harmonics only

beat_track

Computes the beat track of the given audio time series using librosa. The beat track is a representation of the audio signal in terms of its rhythmic content, which is useful for music analysis. The beat track is computed using the following parameters: - hop_length: The number of samples between frames. - start_bpm: The initial estimate of the tempo (in BPM). - tightness: The tightness of the beat tracking (default is 100). - units: The units of the beat track (default is "frames"). It can be frames, samples, time.

download_from_url

Downloads a file from a given URL and returns the path to the downloaded file. Be careful, you will never know the name of the song.

download_from_youtube

Downloads a file from a given youtube URL and returns the path to the downloaded file. Be careful, you will never know the name of the song.

README

MCP 音乐分析

此仓库包含一个 模型上下文提供器 (MCP),它使用 MCP 和 librosa 对本地、YouTube 链接或音频链接中的音频进行音频分析。

与 Claude Desktop 一起使用

<div style="display: flex; gap: 1rem;"> <img src="public/screen.png" alt="alt text" width="40%"> <img src="public/screen1.png" alt="alt text" width="40%"> </div>

安装

# 克隆仓库
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 .

与 Claude Desktop 一起使用

找到配置文件

配置文件的位置取决于您的操作系统:

  • 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 的起始时间

待办事项列表

  • [x] 添加音频文件下载的 URL
  • [x] 添加 YouTube 到音频文件的转换
  • [ ] 试验多个 Python 环境(测试)
  • [ ] 改进安装指南
  • [ ] 集成 Whisper 以获取歌词
  • [ ] 实施 Docker 解决方案

作者

Hugo How-Choong

推荐服务器

VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
AIO-MCP Server

AIO-MCP Server

🚀 集成了 AI 搜索、RAG 和多服务(GitLab/Jira/Confluence/YouTube)的一体化 MCP 服务器,旨在增强 AI 驱动的开发工作流程。来自 Folk。

精选
本地
Hyperbrowser

Hyperbrowser

欢迎来到 Hyperbrowser,人工智能的互联网。Hyperbrowser 是下一代平台,旨在增强人工智能代理的能力,并实现轻松、可扩展的浏览器自动化。它专为人工智能开发者打造,消除了本地基础设施和性能瓶颈带来的麻烦,让您能够:

精选
本地
BigQuery MCP Server

BigQuery MCP Server

这是一个服务器,可以让你的大型语言模型(LLM,比如Claude)直接与你的BigQuery数据对话!可以把它想象成一个友好的翻译器,它位于你的AI助手和数据库之间,确保它们可以安全高效地进行交流。

精选
MCP Web Research Server

MCP Web Research Server

一个模型上下文协议服务器,使 Claude 能够通过集成 Google 搜索、提取网页内容和捕获屏幕截图来进行网络研究。

精选
mcp-perplexity

mcp-perplexity

Perplexity API 的 MCP 服务器。

精选
MySQL MCP Server

MySQL MCP Server

允许人工智能助手通过受控界面列出表格、读取数据和执行 SQL 查询,从而使数据库探索和分析更安全、更有条理。

精选
mcp-codex-keeper

mcp-codex-keeper

作为开发知识的守护者,为 AI 助手提供精心策划的最新文档和最佳实践访问权限。

精选
MCP Etherscan Server

MCP Etherscan Server

通过 Etherscan 的 API 促进与以太坊区块链数据的交互,提供对余额、交易、代币转移、合约 ABI、gas 价格和 ENS 名称解析的实时访问。

精选
Perplexity Deep Research MCP

Perplexity Deep Research MCP

一个服务器,它允许 AI 助手使用 Perplexity 的 sonar-deep-research 模型进行网络搜索,并提供引用支持。

精选