
MusicXML Comparer
io.github.raulkivi由 GitHub 帳號 raulkivi 發布v0.2.1更新於 Nov 3, 2026
Music-aware, multi-level comparison of two MusicXML files
概覽
對兩份 MusicXML 樂譜進行音樂感知的多層級比較,從整體相似度一路細到單一音符的差異。
- 可以做什麼
- 以內嵌文字或檔案路徑比較兩份樂譜,回傳結構化差異結果
- 快速給出相似度分數與彙總統計,不含逐音符細節
- 依聲部名稱與小節範圍篩選列出音符層級變更
- 產生可讀的比較報告,涵蓋聲部、小節、調號與拍號變化
- 匯出帶逐音符顏色標註的 MusicXML,可內嵌回傳或寫入檔案
- 描述樂譜的標題、調號、拍號、速度、聲部、小節與長度
- 適用情境
- 適合比較同一作品的不同版本或改編、將 OMR 或轉換結果與可信的參考譜對照、驗證往返轉換的保真度、在模型或轉換邏輯變更後做回歸測試,以及確認編輯只動到預期的元素。
- 執行需求
- 以 Python 套件 comparer-mcp 透過 uvx 在本機執行;需要 Python 3.11+ 以及 music21 與 mcp 函式庫,不需系統函式庫。檔案路徑必須位於輸出資料夾(SHEET_MUSIC_OUTPUT_ROOT,預設為工作目錄)、用戶端根目錄,或 SHEET_MUSIC_INPUT_ROOTS 中列出的資料夾內。僅支援桌面用戶端。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 MusicXML Comparer,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
comparer-mcp
MCP server for music-aware comparison of MusicXML files. Provides structured, multi-level diffs that report what changed between two scores — from global similarity down to individual notes.
What it does
- Version / arrangement comparison — Compare different editions, arrangements, or simplifications of the same piece
- OMR quality evaluation — Compare
omr-mcpoutput against a known-good reference - Round-trip fidelity — Verify MusicXML → ABC → MusicXML through
musicxml-abc-mcp - Regression testing — Detect regressions when OMR models or conversion logic change
- Score editing validation — Confirm LLM-driven edits only changed intended elements
Installation
See SETUP.md for client config snippets (Claude Desktop, Cursor, Windsurf, Continue, Zed) and TROUBLESHOOTING.md if something doesn't work.
MCP Tools
Each score can be passed inline (reference_xml, target_xml) or as a file path
(reference_path, target_path; .musicxml, .xml or .mxl), exactly one of each pair. Paths
save copying whole scores through the conversation. They must be inside the output folder
(SHEET_MUSIC_OUTPUT_ROOT, default the working directory), one of the client's roots, or a folder
listed in SHEET_MUSIC_INPUT_ROOTS.
compare_musicxml, compare_musicxml_files, generate_comparison_report, and
export_annotated_musicxml all accept an optional options object:
Using the engine directly
The comparison engine (src/comparer_mcp/engine.py) has no MCP dependency and is fully usable as
a plain Python library, independent of the MCP server:
Errors are raised as comparer_mcp.engine.ProcessingError (e.g. for a missing file or invalid
MusicXML), carrying a .error_code attribute (FILE_NOT_FOUND, INVALID_INPUT, etc.) matching
the format the MCP tools return.
Testing
Dependencies
- music21 — MusicXML parsing, score object model, stream alignment
- numpy — distance matrix for note alignment (transitive via music21)
- mcp — MCP protocol
System requirements
- Python 3.11+
- No system libraries required
Phase status
來源:comparer-mcp/README.md,提交 5fcea5d
工具
0版本歷史
1- v0.2.1最新Sep 26, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分