lilypond-mcp
lilypond-mcp
MCP-сервер, который гравирует исходники GNU LilyPond в готовые к размещению ассеты: обрезанные, самостстаточные EPSIL, PDF, SVG и PNG, по размеру соответствующие музыке, а не полной странице, — их можно сраза вставлять в программы вёрстки, например в InDesign.
Инструменты
engrave_file— гравирует файл.lр. По умолчанию — обрезанный EPSIL вbuild/; так же создаётся превью PNG, по ктором агент может проверить результат.engrave_code— гравирует код LilyPond, переданный напрямую, для итераций по муѕкальной идей, не затрigers disc. По умолчанию — PNG.ilyult_version— версия LilyPond, с которой рабодеет сервер, для правилного заголофка\version.
Оба инструмента гравировку при нимают formats (eps/pdf/svg/png), crop, include_dirs (для общих \include-библиотек) и output_uir. Пути разрешаются относително раочего каталога, в котором запущен сервер: для записи Clade Code в .mcp.json это значит корневой каталог.
При сбое ультат содержит диагностику LilyPond, включая номера строк, так агент монет исправить исходник и повторить.
Related MCP server: inkscape-mcp
Причуды LilyPond 2.26, кторые берёт на сеья сервер
EPSIL–выход теперь существет только в виде обрезанного выхода из
ps–бекенда (-oleисчез); EPSIL безcropотклоняеется сра зу.SVG: — собственный бекенд сентября запускется вторым проходом; глифы выходят контурными, поэthat для про смогра и импорта не нуомется установлива шрифты.
Обрезанные выоды (
output.cropped.EXT) переименowyваются повер обычного имени, а лишние промежуточных файлы убороются.lilypond -oменяет рабочий каталог, поэтому путые включений становятся абсолютными до вызова.
Запуск
Серверу нужны node (≥ 20) и lilypond в PATH. Благодясь входящей в комплеct Nix flake, который предо ставляет и то, и другое, у потреблющего проекта .mcp.json выглядит так:
{
"mcpServers": {
"lilypond": {
"command": "nix",
"args": [
"develop", "../lilypond-mcp",
"--command", "node", "../lilypond-mcp/dist/index.js"
]
}
}
}Разработка
direnv allow # or: nix develop
npm install
npm run build # tsc → dist/
npm test # vitest; engraves real snippets, needs lilypond on PATHЛицензия
MIT. Сервер оркеструн GPL-лицензированные профов гравировку (LilyPond, Ghostscript) как отдельные программы — анализ и правила проэктирования, сохраня щие чисту, в LICENSING.md.
Available Tools
3 toolsengrave_codeEngrave LilyPond CodeAIdempotent
Engrave LilyPond code passed inline, without needing a source file on disk. Useful for iterating on a musical idea: engrave, read the preview PNG, adjust, repeat. For anything worth keeping, write a .ly file and use engrave_file instead.
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | LilyPond source code, e.g. '\version "2.26.0" { c\' e\' g\' }' | |
| crop | No | Crop assets to the music itself (required for EPS) | |
| name | No | Basename for the generated assets | snippet |
| formats | No | Asset formats to generate; png is handy while iterating on a snippet | |
| preview | No | Attach the preview PNG to the result as an image, so the engraving is visible inline without reading a file. Turn off for batch runs. | |
| output_dir | No | Directory the generated assets are written to (created if missing) | build |
| include_dirs | No | Directories searched by \include, e.g. a shared settings library |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | Yes | |
| errors | No | |
| outputs | Yes | |
| previewPng | No | Cropped PNG of the engraved music — read this file to inspect the result |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare the safety profile (readOnlyHint false, idempotentHint true, destructiveHint false). The description adds useful behavioral context — that it engraves from an in-memory string, that a preview PNG comes back for iteration, and that it is not the persistence path. It does not itself state that assets are written to a directory, but the schema and annotations cover that.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, front-loaded with the core capability, then the iteration workflow, then the hand-off to the sibling. Zero filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present and 100% parameter coverage, the description need not restate outputs. It supplies the workflow and sibling routing an agent needs to pick this tool correctly, and nothing material is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and every parameter (crop, name, formats, preview, output_dir, include_dirs) is documented in the schema, so the baseline is 3. The description echoes the preview workflow but adds no syntax or format semantics beyond what the schema already provides.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('Engrave LilyPond code') and immediately differentiates scope: inline code with no source file on disk. This cleanly separates it from the sibling engrave_file, which requires a .ly file.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit when-to-use ('iterating on a musical idea: engrave, read the preview PNG, adjust, repeat') and an explicit when-not-to + alternative ('For anything worth keeping, write a .ly file and use engrave_file instead'). This is textbook routing guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
engrave_fileEngrave LilyPond FileAIdempotent
Engrave a LilyPond (.ly) source file into publication-quality music notation assets. Cropped assets are sized to the music, ready to place in page-layout software. Use PDF for InDesign placement (fonts embedded the way Adobe accepts, crop/bleed/trim/art boxes all defined); SVG has glyphs as outlines for the web; EPS embeds fonts in a form Ghostscript accepts but InDesign ignores. On failure, errors carries the LilyPond diagnostics, including line numbers.
| Name | Required | Description | Default |
|---|---|---|---|
| crop | No | Crop assets to the music itself instead of a full page. Required for EPS; what you want for assets placed in a layout. | |
| name | No | Basename for the assets; defaults to the source filename without .ly | |
| source | Yes | Path to the .ly file, relative to the project root or absolute | |
| formats | No | Asset formats to generate. PDF is the format to place in InDesign (fonts embedded the way Adobe accepts, all PDF boxes defined); EPS embeds fonts in a form InDesign ignores. | |
| preview | No | Attach the preview PNG to the result as an image, so the engraving is visible inline without reading a file. Turn off for batch runs. | |
| output_dir | No | Directory the generated assets are written to (created if missing) | build |
| include_dirs | No | Directories searched by \include, e.g. a shared settings library |
Output Schema
| Name | Required | Description |
|---|---|---|
| ok | Yes | |
| errors | No | LilyPond diagnostics when compilation fails |
| outputs | Yes | Absolute path per generated format |
| previewPng | No | Cropped PNG of the engraved music — read this file to inspect the result |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare non-read-only, idempotent, non-destructive, so the safety profile is covered. The description goes beyond them with failure behavior ('errors' carries LilyPond diagnostics including line numbers), crop semantics, and the preview PNG being attached inline — real behavioral context. It stops short of stating runtime cost or overwrite behavior of output_dir.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with the purpose, then format-selection rationale, then failure behavior — every sentence carries distinct information with no filler or repetition. Sized appropriately for a tool with multiple output formats and layout-software considerations.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With a 7-parameter schema fully described and an output schema present, the description supplies exactly the missing layer: format tradeoffs and error reporting. An agent has everything needed to invoke it correctly without opening the schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3 and the schema already documents each parameter. The description still adds meaning not in the schema, notably that SVG glyphs are outlines for web use and the font-embedding distinction between PDF and EPS. It says nothing extra about name, output_dir, or include_dirs resolution beyond their schema text.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a concrete verb and resource ('Engrave a LilyPond (.ly) source file') and states the output class ('publication-quality music notation assets'), which is far more specific than the title alone. The phrase 'source file' implicitly separates it from the sibling engrave_code, but the distinction is never made explicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives strong, actionable guidance on which output format to choose and why (PDF for InDesign, SVG outlines for web, EPS for Ghostscript but not InDesign), plus the crop and preview conditions. It does not tell the agent when to prefer engrave_file over engrave_code or when to call lilypond_version, which is the one routing gap.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
lilypond_versionLilyPond VersionARead-only
Report the LilyPond version this server engraves with. Use it to pick the right \version header for new .ly files.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| version | Yes | LilyPond version banner, e.g. 'GNU LilyPond 2.26.0 (running Guile 3.0)' |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
readOnlyHint=true already tells the agent this is a safe read, and an output schema exists, so return format is covered. The description still adds a genuinely useful behavioral fact: the reported version is the one the server actually engraves with, which is what makes the compatibility check valid.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, zero filler, with the core identity of the tool front-loaded before the usage hint. Every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter read tool with an output schema and a readOnly annotation, the description covers everything an agent needs: what is reported and why to call it. No gaps remain.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so there is no parameter semantics to convey; the 4 baseline applies. Nothing in the description is needed to understand the (empty) input.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Report') and a precisely scoped resource ('the LilyPond version this server engraves with'), which is meaningfully narrower than just 'the LilyPond version'. It is inherently distinct from the engrave_* siblings, though it never names them explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Use it to pick the right \version header for new .ly files' gives a concrete triggering situation for calling the tool. There are no competing alternatives to disambiguate against, so no explicit exclusion is needed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v0.2.1- Changed
engrave_code1 field changed- added
Input schema / properties / previewAdded value: +{ + "default": true, + "description": "Attach the preview PNG to the result as an image, so the engraving is visible inline without reading a file. Turn off for batch runs.", + "type": "boolean" +}
- Changed
engrave_file1 field changed- added
Input schema / properties / previewAdded value: +{ + "default": true, + "description": "Attach the preview PNG to the result as an image, so the engraving is visible inline without reading a file. Turn off for batch runs.", + "type": "boolean" +}
3 tool updates
v0.1.0- First observed
engrave_code - First observed
engrave_file - First observed
lilypond_version
TDQS
Scored across 3 tools
The three tools have clearly distinct purposes: engrave_file operates on a .ly path, engrave_code takes inline source, and lilypond_version reports the engine version. The descriptions explicitly contrast the two engrave tools, reducing any misselection risk.
engrave_file and engrave_code share a consistent verb_noun pattern, but lilypond_version breaks it with a noun_noun form. The deviation is minor and still readable as a cohesive set.
Three tools is a tight, focused scope appropriate for a single-purpose LilyPond engraver wrapper. It's on the lean side but each tool earns its place without redundancy.
Core workflow (engrave file, engrave inline, check version) is fully covered with no dead ends for typical use. A preview/validate-only or batch operation is absent, but agents can work around this via engrave_code plus engrave_file.
Maintenance
Related MCP Connectors
Generate and vectorize clean, editable SVG graphics from text, images, or both.
Compile LaTeX to PDF without installing TeX Live. No API key needed to start.
Generate PDFs and images from HTML, Markdown, URLs or JSON templates.
Render HTML, Markdown, or URLs to images, PDF, or branded artifacts; extract and watch pages.
Related MCP Servers
- AlicenseAqualityDmaintenanceConverts diagrams (Mermaid, PlantUML, Graphviz, etc.) to SVG, PNG, PDF, or JPEG images using Kroki.io. Supports generating diagram URLs and downloading diagrams to local files.28 npm8MIT
- AlicenseCqualityAmaintenanceEnables headless and secure control of Inkscape for creating, inspecting, and resizing SVG documents, and exporting to PNG, PDF, and SVG with validation of size, pages, structure, and hashes.90MIT
- AlicenseBqualityAmaintenanceEnables driving Inkscape headlessly from an MCP client, with verified SVG editing, rendering, optimization, and animation tools.23MIT
- AlicenseNot gradedqualityBmaintenanceTurns structured JSON content into resolved, audited infographic plans and renders them as SVG or executable Figma Plugin API scripts, exposing theme packs, grammars, planning, auditing and export tools over stdio. Also lets hosts inspect theme provenance and layout decisions so different tools produce identical frames.MIT