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 choir-music-assistant pipeline.
Tools
| Tool | Description |
|---|---|
recognize_sheet |
Convert a single image (file path or base64) to MusicXML string |
recognize_sheet_to_file |
Convert a single image and write MusicXML to a file |
recognize_sheets |
Process multiple pages and merge them into one MusicXML document |
list_capabilities |
Return server metadata: backend version, input/output formats, available tools |
Installation
cd omr-mcp
uv sync
On first run, oemer downloads ~100 MB of model checkpoints. This happens once and is cached.
Running
uv run omr-mcp
No environment variables required.
Claude Desktop configuration
{
"mcpServers": {
"omr": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/omr-mcp", "run", "omr-mcp"]
}
}
}
Usage examples
// Recognize a single image file
{"tool": "recognize_sheet", "arguments": {"image_path": "/path/to/scan.png"}}
// Recognize from base64-encoded image
{"tool": "recognize_sheet", "arguments": {"image_base64": "<base64 data>", "mime_type": "image/jpeg"}}
// Process multiple pages into one score
{"tool": "recognize_sheets", "arguments": {"image_paths": ["/path/page1.png", "/path/page2.png"]}}
// Save result directly to file
{"tool": "recognize_sheet_to_file", "arguments": {"image_path": "/path/scan.png", "output_path": "/tmp/score.mxl"}}
Testing
# Unit tests (fast, no model required)
VIRTUAL_ENV= .venv/bin/pytest tests/ -v
# Integration tests (requires model download, ~10 min per page)
VIRTUAL_ENV= .venv/bin/pytest tests/ -v -m integration
Test samples
SATB a cappella samples are available in test_samples/pdmx_satb_samples/:
pdmx_satb_samples/
├── mxl/ # MusicXML ground truth
├── pdf/ # PDF scores
└── png/ # PNG images (OMR input)
Source: PDMX dataset — 250K+ public domain scores.
Dependencies
- oemer — deep learning OMR engine (UNet + SVM, ONNX Runtime)
- Pillow — image loading and validation
- defusedxml — safe XML parsing
- mcp — MCP protocol
Performance notes
- Processing time: 3–5 minutes per page on CPU
- oemer output may vary slightly between runs — 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)
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file omr_mcp-0.1.2.tar.gz.
File metadata
- Download URL: omr_mcp-0.1.2.tar.gz
- Upload date:
- Size: 142.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc427f8b3a2a23e23411ee6e2a151bf1c1d8d5f8720a78fc881263247486d714
|
|
| MD5 |
026de7f55a361112c690f3dade92953c
|
|
| BLAKE2b-256 |
fe9c7c9a2086012685a73777d905dea8359c68881f757a7ad0b12a2c8a64c1aa
|
Provenance
The following attestation bundles were made for omr_mcp-0.1.2.tar.gz:
Publisher:
publish.yml on raulkivi/music-assistant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omr_mcp-0.1.2.tar.gz -
Subject digest:
fc427f8b3a2a23e23411ee6e2a151bf1c1d8d5f8720a78fc881263247486d714 - Sigstore transparency entry: 2481858293
- Sigstore integration time:
-
Permalink:
raulkivi/music-assistant@7ff9527a4037d29c77405611f71c19f607945c70 -
Branch / Tag:
refs/tags/omr-mcp/v0.1.2 - Owner: https://github.com/raulkivi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ff9527a4037d29c77405611f71c19f607945c70 -
Trigger Event:
push
-
Statement type:
File details
Details for the file omr_mcp-0.1.2-py3-none-any.whl.
File metadata
- Download URL: omr_mcp-0.1.2-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6798bd424dd4eb6c1b3d9eea6b11f8dae04105573a0f24b21d0503dfb5621c10
|
|
| MD5 |
777e1f031988d1ea9fb5b5140c806b1f
|
|
| BLAKE2b-256 |
e1c73804c916bfd23a3529b2ebaf8523b85b77b93380144e5f94b5752c58364d
|
Provenance
The following attestation bundles were made for omr_mcp-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on raulkivi/music-assistant
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
omr_mcp-0.1.2-py3-none-any.whl -
Subject digest:
6798bd424dd4eb6c1b3d9eea6b11f8dae04105573a0f24b21d0503dfb5621c10 - Sigstore transparency entry: 2481858371
- Sigstore integration time:
-
Permalink:
raulkivi/music-assistant@7ff9527a4037d29c77405611f71c19f607945c70 -
Branch / Tag:
refs/tags/omr-mcp/v0.1.2 - Owner: https://github.com/raulkivi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7ff9527a4037d29c77405611f71c19f607945c70 -
Trigger Event:
push
-
Statement type: