
Audio Sonic MCP
io.github.ripunjay-kashyap由 GitHub 帳號 ripunjay-kashyap 發布v1.2.0更新於 Oct 24, 2026
Local-first audio analysis: BPM, musical key, production profile, and CLAP vibe embeddings.
概覽
在本機對歌曲或 YouTube 連結做音訊分析,回傳 BPM、調性、氛圍標籤與製作特徵。
- 可以做什麼
- Audio Sonic MCP 把本機音訊分析引擎提供給 AI 助理使用。它透過非同步工作模式接收 YouTube 連結,先回傳工作 ID,再輪詢狀態,最後產出結構化的聲音簽章:速度、含分段轉調對應的調性、512 維 CLAP 氛圍向量與可讀風格標籤,以及人聲位置、瞬態衝擊、立體聲寬度與主要頻率峰值等製作分析。check_health 工具會回報 FFmpeg、Python 套件、選用的 madmom 節拍追蹤器與工作目錄是否可用。另有命令列工具可分析本機音訊檔案。
- 適用情境
- 適合需要讓助理描述音樂或音訊的情境:整理曲庫、比較速度與調性、產生情緒或風格標籤,或輸出製作層面的摘要。也適合希望音訊不離開本機的離線工作流程。
- 執行需求
- 以本機程序透過 stdio 執行。需要 Python 3.10+ 與 PATH 中的 FFmpeg,並在虛擬環境中安裝此套件;選用的 [clap] 額外元件會引入 torch、torchaudio、transformers 與 demucs,約需 4 GB 磁碟空間。JOBS_ROOT 指定下載音訊、WAV 與分軌的工作目錄。首次完整 ML 執行會下載約 600 MB 模型權重。不需要 API 金鑰。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Audio Sonic MCP,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
🎵 Audio Sonic MCP
[Tests] [License: MIT] [Python 3.10+] [MCP]
Turn any song into a structured "sonic signature" — extracting tempo, musical key, a 512-dimension CLAP vibe embedding, human-readable vibe tags, and a production profile — from a single local call.
Audio Sonic MCP runs entirely on your local machine (requiring no API keys, external servers, or cloud dependencies) and exposes two premium access points to the same underlying high-fidelity audio analysis engine:
🎹 Quick Taste: What You Get
1. Musician-Friendly CLI Summary (--summary mode)
2. Comprehensive JSON (Returned by MCP and CLI by default)
⚡ Key Features
- 🥁 Tempo & Beat Tracking — Full BPM computation with variable-tempo drift detection and transient windowing.
- 🎹 Key & Harmonic Mapping — Computes structural musical key + mode, generating a detailed
key_maptracking section-by-section modulations. - 🌈 Vibe & Style Embeddings — Compiles a 512-dimensional CLAP embedding and human-readable style tags (covering energy, texture, mood, and genre) using zero-shot music vocab classification.
- 🎚️ Production Analytics — Measures vocal spatial presence, transient punch coefficients, stereo width, and dominant frequency peaks.
- 🤖 MCP-Native System — Fully exposes 4 standardized Model Context Protocol tools for instant integration into AI tools.
- 🪶 Robust Graceful Degradation — Automatically utilizes a CUDA GPU if present and falls back to CPU; gracefully degrades to HPSS and standard librosa feature arrays if heavy deep learning packages (
[clap]) are omitted. - 🔒 100% Offline & Private — All conversion, separation, and inference occur locally.
📦 Installation & Setup
System Prerequisites
Ensure you have Python 3.10+ and FFmpeg installed and accessible on your system PATH.
Installing FFmpeg:
- macOS:
brew install ffmpeg - Linux (Debian/Ubuntu):
sudo apt update && sudo apt install -y ffmpeg - Windows: Run
winget install Gyan.FFmpegvia PowerShell (Administrator), or download manually from ffmpeg.org and add thebindirectory to your system environment variables.
Step-by-Step Installation
-
Clone the Repository
-
Initialize Virtual Environment
-
Install Dependencies Choose between the lightweight core engine or the full high-fidelity ML suite:
- Option A: Full High-Fidelity ML Suite (Recommended) Includes demixing stems (Demucs) and zero-shot vibe vectors (CLAP). Requires ~4 GB disk space.
- Option B: Core Lightweight Pipeline Uses standard digital signal processing (HPSS/librosa). Rapid install and minimal footprint.
[!NOTE] The optional
[clap]stack installstorch,torchaudio,transformers, anddemucs. Without these, the server automatically switches to light fallbacks (HPSS instead of Demucs, standard feature matrices instead of CLAP vectors, and leaves outvibe_tags).
🤖 MCP Client Configuration Guide
Audio Sonic MCP registers itself as a standard package script. This enables you to run it using the global executable name (audio-sonic-mcp) directly from your virtual environment's bin folder, or run the script file manually.
1. Claude Desktop Setup
Open your Claude configuration file:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Add the server to your mcpServers object:
[!IMPORTANT] Windows Users: Always use double backslashes (
\\) in JSON configuration paths. Point the executable directly to the.exeinside your.venv\Scripts\directory.
2. Cursor IDE Integration
To integrate Audio Sonic MCP into Cursor's AI pane:
- Navigate to Settings ➔ Features ➔ MCP.
- Click + Add New MCP Server.
- Fill in the parameters:
- Name:
audio-sonic-mcp - Type:
command - Command:
/path/to/audio-sonic-mcp/.venv/bin/audio-sonic-mcp(use.exeextension on Windows)
- Name:
3. Windsurf Integration
Open your Windsurf MCP configurations file (typically found at ~/.codeium/windsurf/mcp_config.json) and append the configuration:
4. Cline (VS Code Extension) Setup
Open Cline's MCP setting file (usually located at %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json or equivalent platform storage) and add:
🤖 Interaction Flow for AI Agents & LLMs
LLMs automatically learn how to use this server by reading its exposed tool definitions. Because audio stem separation and CLAP embeddings are computationally demanding, Audio Sonic MCP uses an Asynchronous Fire-and-Forget Job Pattern.
Automated LLM Workflow
Natural Prompts to Try
- "Check the health of my audio-sonic-mcp server to make sure all ML components are ready."
- "Submit this YouTube track for sonic analysis:
https://www.youtube.com/watch?v=XXXXXX." - "Check the progress of my sonic signature job
sig_a1b2c3d4and summarize the BPM, production width, and vibe once complete."
🎚️ CLI Usage (Local Files)
For musicians, engineers, and producers working directly in the terminal, you can analyze a full-length local file directly without running any background servers:
CLI Command Options Reference
Supported File Formats: wav, mp3, flac, ogg, m4a, aac.
🔧 Environment Variables Reference
Configure environment options by declaring these variables in your active terminal session, container environment, or the env block of your MCP configuration file:
🐳 Docker / Podman Execution
If you prefer to avoid setting up local Python libraries, running via containers encapsulates FFmpeg, yt-dlp, and the core Python dependencies (CPU-based pipeline):
To connect Claude Desktop to your Docker container, configure claude_desktop_config.json:
⚙️ How it Works under the Hood
Audio Sonic MCP pipelines are constructed modularly, using transactional checkpoints to ensure reliability.
- Stem Demixing: Meta AI's Demucs (
mdx_extra) separates the track into isolation stems (vocals,drums,bass,other). If missing, it gracefully drops back to Harmonic-Percussive Source Separation (HPSS). - Analysis engine: librosa extracts rhythmic and tonal structures, matching chord patterns and sub-bass movements against Krumhansl-Schmuckler and Phrygian template engines.
- Semantic Vibe Tagging: LAION CLAP (
laion/larger_clap_music_and_speech) runs zero-shot inference against high-coverage aesthetic descriptors (moods, textures, genres), choosing top candidates across stylistic poles.
🩺 Resiliency & Troubleshooting
1. One-Time Setup Download Delays
Upon the very first analysis job utilizing the full ML pipeline, demucs and transformers will download their pre-trained model weights (approximately 400 MB for Demucs, and 200 MB for CLAP).
- The server redirects download progress indicators to
stderrso they do not corrupt the JSON-RPC standard stream. - During this download,
get_job_statuswill remain inrunning. Allow 1–3 minutes depending on your network speed. Subsequent startups take under 10 seconds.
2. FastMCP Concurrency Controls
Model inference on multi-staged architectures is highly CPU/VRAM intensive. To protect consumer hardware and virtual environments from crashing (OutOfMemory exceptions), Audio Sonic MCP enforces a strict global serialization lock (CONCURRENCY_LOCK).
- If you submit multiple URLs simultaneously, they will be processed sequentially.
- Polling
get_job_statusfor subsequent jobs will reportqueuedorrunningwhile they wait in the pipeline queue.
3. Windows Librosa Deadlock Fix
FastMCP thread dispatching under Windows can cause Numba compilation deadlocks inside background worker threads. To prevent this, Audio Sonic MCP incorporates a Pre-warming Routine (_prewarm_librosa() and _prewarm_demucs()) on launch. It forces JIT compile of resampling, HPSS, and mono-mixing functions in the main thread before starting the RPC listener.
4. BPM Accuracy and the bpm_engine Field
Tempo is estimated by madmom's RNN beat tracker. madmom is an optional dependency: it is unmaintained (latest release 0.16.1, classifiers stop at Python 3.7) and requires a Cython build, so it cannot be installed reliably everywhere and is not part of the default install.
When madmom is unavailable the pipeline falls back to librosa. That fallback is good on steady four-on-the-floor material but can lock onto a 2:3 or octave multiple of the true tempo — on one of our regression fixtures it reports 99.4 BPM against a ground truth of 148.
So the tempo is never reported unqualified. Every payload carries a bpm_engine field naming the engine that actually produced the number:
check_health reports madmom's status explicitly. To enable the accurate path:
If the build fails on a recent Python, use 3.10 for the analysis environment — madmom has no wheels for newer interpreters.
5. Diagnosing with check_health
If the server reports as degraded or tools are missing, call the check_health tool or check CLI warnings. It queries:
- Availability of
ffmpegon the execution path. - Installation status of Python packages (
librosa,soundfile,mcp, etc.). - Presence of the optional
madmombeat tracker, and whichbpm_enginewill be used as a result. - Access permissions to the
JOBS_ROOTdirectory.
🛠️ Development & Testing
Run unit tests inside your virtual environment to verify the mathematical pipelines using synthesized audio waveforms:
📄 License
Distributed under the MIT License. See LICENSE for details.
© 2026 Ripunjay Kashyap. All rights reserved.
來源:README.md,提交 1cb0e3e
工具
0版本歷史
1- v1.2.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分