MusicXML Renderer

io.github.raulkivi由 GitHub 账号 raulkivi 发布v0.2.2更新于 Oct 24, 2026

Renders MusicXML scores to PDF, PNG or SVG

发布方自己的服务:render.ai Presentations

已验证STDIO仅桌面文件与存储媒体与设计

概览

AI 生成的概览

本地 MCP 服务器,使用 Verovio 将 MusicXML 乐谱渲染为可打印的 PDF 或页面图片(PNG/SVG),无需外部排版工具。

可以做什么
  • 将完整 MusicXML 乐谱渲染为多页 PDF 文件
  • 将单页渲染为指定 DPI 的 PNG 或 SVG
  • 仅渲染指定范围内的小节
  • 在不渲染的情况下查看乐谱的声部、调号、拍号、速度与长度
  • 返回后端版本、支持的格式与运行环境就绪状态
适用场景
适合需要把 MusicXML 或压缩的 .mxl 乐谱转成 PDF 或图片用于打印、预览、分享,或只导出部分小节的场景。适用于乐谱存放在本地文件夹的桌面环境。
运行要求
以 stdio 方式在本地运行,通常通过 uvx 从 PyPI 包 render-mcp 启动。需要 Python 3.11+,输出 PNG/PDF 还需 libcairo2 共享库。无需环境变量或账号,但可选的 SHEET_MUSIC_OUTPUT_ROOT 与 SHEET_MUSIC_INPUT_ROOTS 可限定可读写目录。仅支持桌面端。
安装前请注意
它会写入文件:output_path 必须位于配置的输出根目录内,输入路径也受允许目录限制。建议把这些根目录指向专门的乐谱文件夹,而不是宽泛的目录,以免助手读取或覆盖无关文件。

安装

在 SourceWeft 中

  1. 打开 控制台中的 MusicXML Renderer,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

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:

bash
cd render-mcpuv sync

libcairo is required for PNG output:

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

Running

bash
uv run render-mcp

No environment variables required.

Usage examples

json
// 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

bash
# 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)

来源:render-mcp/README.md,提交 5fcea5d

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.2.2最新Oct 17, 2026
  2. v0.2.1Sep 26, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Render 集成