
Sheet Music OMR
io.github.raulkivi由 GitHub 账号 raulkivi 发布v0.2.2更新于 Oct 24, 2026
Converts photos or scans of printed sheet music to MusicXML with optical music recognition
概览
本地 MCP 服务器,用光学乐谱识别把印刷乐谱的照片或扫描件转换为 MusicXML。
- 可以做什么
- 识别单张乐谱图片(文件路径或 base64),以内联文本或保存文件路径返回 MusicXML
- 处理多页图片并合并为一份 MusicXML 乐谱
- 可在两种识别引擎间选择:默认 oemer,或用于多声部 SATB 合唱谱的 audiveris
- 查看服务器元数据、支持的输入输出格式以及运行时依赖健康状态
- 适用场景
- 当你手上有印刷乐谱的扫描件或照片,希望助手生成可编辑的 MusicXML,尤其是要接入后续乐谱处理流程,或需要数字化多页谱、合唱谱时适用。
- 运行要求
- 以本地 Python 进程运行(需 Python 3.11 及以上),通过 uvx 或 uv run 启动;无需账号或 API 密钥。首次使用会下载模型文件(oemer 约 100 MB,audiveris 约 80 MB);audiveris 引擎还需要 dpkg-deb 解包其自带二进制。可用 OMR_AUDIVERIS_HOME 指定 Audiveris 下载目录。
安装
在 SourceWeft 中
- 打开 控制台中的 Sheet Music OMR,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
omr-mcp
MCP server that converts sheet music images to MusicXML using optical music recognition (OMR).
What it does
Takes a photo or scan of printed sheet music and returns a MusicXML document. Handles single pages or multi-page scores. Feeds directly into the rest of the sheet-music-mcp pipeline.
Two selectable OMR backends, via an optional engine argument on the recognition tools:
oemer(default) — fast, no extra download beyond the ~100 MB model checkpoints. Best for single/two-staff scores; flattens multi-staff (SATB) choir scores into one part (see "Known limitations" below).audiveris— correctly separates multi-staff SATB scores into simultaneous parts. Requires 300+ DPI source images and a larger (~80 MB) first-use download; runs as a subprocess.
Tools
Installation
On first run, oemer downloads ~100 MB of model checkpoints. This happens once and is cached.
Quick install: bash install.sh sets up everything in one command and prints a ready-to-paste
client config — see SETUP.md. Ready-made configs for Claude Desktop, Cursor, Windsurf,
Continue, and Zed are in examples/. Having trouble? Check
TROUBLESHOOTING.md.
Running
No environment variables required.
Claude Desktop configuration
Usage examples
Large results come back as {"musicxml_path": ..., "score_summary": {...}, "metadata": ...}, with
the file under <SHEET_MUSIC_OUTPUT_ROOT>/scores/ (default: the server's working directory). Pass
that path to the other servers' tools as musicxml_path instead of copying the score.
Testing
Test samples
SATB a cappella samples are available in test_samples/pdmx_satb_samples/:
Source: PDMX dataset — 250K+ public domain scores.
Dependencies
- oemer — default deep learning OMR engine (UNet + SVM, ONNX Runtime)
onnxruntime>=1.30— releases after 1.19 reject the negative ConvTranspose pads baked into oemer'sunet_bigcheckpoint;onnx_compat.pyrewrites them into the equivalentoutput_paddingbefore each recognition (needsonnx). This allows Python 3.11–3.14 (seedocs/HANDOVER.mdgotchas)opencv-python-headless==4.10.0.84— pinned; 5.x changedcv2.HoughLinesP()'s return shape, which crashes oemer's staffline extraction (seepyproject.tomlcomments /docs/HANDOVER.mdgotchas)- Pillow — image loading and validation
- defusedxml — safe XML parsing
- mcp — MCP protocol
- Audiveris — optional alternate OMR engine (
engine="audiveris"). Not a Python dependency: a self-contained binary (bundles its own JRE) downloaded automatically on first use of that engine. Requiresdpkg-deb(present on virtually all Debian/Ubuntu systems) to extract it — no root/system install.
Known limitations
- oemer's default output loses SATB voice structure. oemer reads multi-staff choir systems
sequentially rather than simultaneously, so a 4–5 voice SATB score comes out as a single merged
<part>with the clef alternating back and forth, instead of one part per voice — real data loss, not a benign modeling difference (confirmed by inspecting generated MusicXML), and architectural in oemer itself (its rhythm-alignment code hard-asserts at most 2 simultaneous staff tracks — see docs/HANDOVER.md). Useengine="audiveris"for multi-staff choir scores — it correctly separates voices into simultaneous parts, verified against real fixtures. Requires 300+ DPI source images.
Performance notes
- Processing time: ~90–100s per page on CPU for
oemeronce its model checkpoints are cached; ~7–15s per page foraudiverisin testing (despite JVM subprocess startup overhead) - Output may vary slightly between runs (both engines) — do not assert on exact XML equality
- The generated MusicXML is functionally correct but may not pass strict schema validation
System requirements
- Python 3.11+
- No system libraries required (ONNX Runtime is bundled via pip)
来源:omr-mcp/README.md,提交 5fcea5d
工具
0版本历史
2- v0.2.2最新Oct 17, 2026
- v0.2.1Sep 26, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分