mcpField
M
MusicXML Renderer

MusicXML Renderer

Local
github.com/raulkiviMedia & Design1Updated 2d ago

About MusicXML Renderer

MusicXML Renderer is an MCP server for rendering scores as multi-page PDFs or single-page PNG and SVG images. It uses Verovio for engraving without external tools or a GUI.

Key features

  1. 01Render full scores as multi-page PDFs
  2. 02Render a single page as PNG or SVG
  3. 03Render selected measure ranges
  4. 04Accept file paths or inline MusicXML
  5. 05Check capabilities and runtime health

Use cases

  1. 01Create print-ready score PDFs
  2. 02Export score pages as PNG or SVG
  3. 03Render selected measures for review

MCP support

As an MCP server, it exposes PDF and image rendering, capability, and health-check tools to clients. Clients provide MusicXML by path or inline and specify the output format and path.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"raulkivi-render": {
"command": "uvx",
"args": [
"render-mcp"
]
}
}
}
Run commanduvx render-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypirender-mcp0.2.2

Tools

4

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
musicxmlstringYesMusicXML document as a string
output_pathstringNoPath to write PDF file (auto-generated if omitted)

Details

From the project README

render-mcp

MCP server that renders MusicXML scores to PDF or PNG images.

What it does

Takes a MusicXML document and produces print-ready PDFs or screen-ready PNG images. Uses Verovio for layout and engraving — no external tools or GUI required.

Tools

ToolDescription
render_to_pdfRender the full score to a multi-page PDF file
render_to_imageRender a single page to PNG or SVG
list_capabilitiesReturn server metadata: backend version, supported formats, available renderers
health_checkCheck whether all runtime dependencies are available and the server is ready to render scores

Installation

Quick install: run ./install.sh for one-command setup, or see SETUP.md for a non-technical walkthrough. Ready-made client configs (Claude Desktop, Cursor, Windsurf, Continue, Zed) are in examples/. If something isn't working, check TROUBLESHOOTING.md.

Manual setup:

cd render-mcp
uv sync

libcairo is required for PNG output:

# Ubuntu / Debian (usually pre-installed on desktop systems)
sudo apt install libcairo2

Running

uv run render-mcp

No environment variables required.

Usage examples

// Render full score to PDF
{
  "tool": "render_to_pdf",
  "arguments": {
    "musicxml_path": "/path/to/score.mxl",
    "output_path": "/tmp/score.pdf"
  }
}

// Render page 1 to PNG at 150 DPI
{
  "tool": "render_to_image",
  "arguments": {
    "musicxml_path": "/path/to/score.mxl",
    "output_path": "/tmp/page1.png",
    "page": 1,
    "dpi": 150
  }
}

// Render only bars 17–24 (printed measure numbers, inclusive) to PDF
{
  "tool": "render_to_pdf",
  "arguments": {
    "musicxml_path": "/path/to/score.mxl",
    "measures": [17, 24]
  }
}

DPI range: 72–600. Default: 150. Page numbers are 1-indexed.

measures: [start, end] (optional, both tools) renders only those printed bars; a pickup bar is 0. The cut score keeps the key, time and clef in force at start. A reversed or out-of-range measures is an INVALID_PARAMETER error whose hint names the score's first and last bars.

Give the score as musicxml_path (.musicxml, .xml or .mxl) or inline as musicxml, not both. A path must lie inside SHEET_MUSIC_OUTPUT_ROOT (default: the working directory), one of the client's roots, or a folder listed in SHEET_MUSIC_INPUT_ROOTS; output_path must lie inside SHEET_MUSIC_OUTPUT_ROOT. describe_score returns a score's parts (IDs P1 …), key, time, tempo and length without rendering it.

Testing

# All tests including integration (Verovio runs in-process, no external tool needed)
VIRTUAL_ENV= .venv/bin/pytest tests/ -v

Dependencies

  • verovio — MusicXML engraving to SVG (pure Python, in-process)
  • cairosvg — SVG to PNG/PDF conversion
  • pypdf — multi-page PDF assembly
  • Pillow — image utilities
  • mcp — MCP protocol

System requirements

  • Python 3.11+
  • libcairo2 shared library (for PNG/PDF output via cairosvg)

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.