Skip to main content
Glama
wspringer

lilypond-mcp

lilypond-mcp

Servidor MCP que graba a las fuentes de GNU LilyPond and las convierte in activos colocados: EPS, PDF, SVG y PNG recortados y autocontenidos, dimensionados a la música en lugar de a la página completa — listos para insertir en programas de maquetación como InDesign.

Herramientas

  • engr_file — graba un .ly file. Por defecto, EPS recortado en build/; también genera un PNG de preview para que el agente pueda inspect and verify.

  • eng_code — graba código LilyPond passed in in Línea, for iterar a over an idea musical without having to use the disc. Por defecto, PNG.

  • lilypond_version — la versión of LilyPond with the one servidor fret, para elegir the cirected \version tres.

A ambas "engrave" accept formats (eps/pdf/svg/png), crop, includes inc_dirs (para shared includ libraries), and output_dir. Las rutas se resuelven depending on the root directory where, launch the server, the server launch, the Claude Code entry for the .mcp.json of a project, the areas to be run in the .mcp.json from Claude, that the directory is the root.

In case de error, result contains the diagment de diagnostics de LilyPond, includes the line number, for an agent can correct the source and complete reattempt all.

Related MCP server: inkscape-mcp

Particularidades de LilyPond 2.26 que este servidor absorbe

  • El EPS only exists as a "recortado" output of the ps backend (-dbackend=eps` has demise); it is no longer possible to see "EPS" without "crop" that will not be rejected from current.

  • El SVG means with its own backend "own" y "macarry out is made as a second pass; the glyphs leave as contornos, so you do not need to have installed sources to view or import them.

  • Las salidas recortadas (NAME.cropped.EXT) se renombran sobre el nombre simple y se eliminan los archivos intermedios sobrantes.

  • lilypond -o change el directorio de trabajo; donc las rutas de inclusion are, made before absolute, called.

Ejecución

El servidor is "node (≥20) and lilypond on its PATH. Con "el included flake {{Nix}} provides both, el .mcp.json from a proyect that consumes it will have this image:

{
  "mcpServers": {
    "lilypond": {
      "command": "nix",
      "args": [
        "develop", "../lilypond-mcp",
        "--command", "node", "../lilypond-mcp/dist/index.js"
      ]
    }
  }
}

Desarrollo

direnv allow      # or: nix develop
npm install
npm run build     # tsc → dist/
npm test          # vitest; engraves real snippets, needs lilypond on PATH

Licencia

MIT. El servidor orchestrates gravados with license GPL (LilyPond, Ghostscript) as procesors se separated — consultation LICENSING.md for the analysis and the design rules that keep the separation clean.

Available Tools

3 tools
engrave_codeEngrave LilyPond CodeA
Idempotent

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.

NameRequiredDescriptionDefault
codeYesLilyPond source code, e.g. '\version "2.26.0" { c\' e\' g\' }'
cropNoCrop assets to the music itself (required for EPS)
nameNoBasename for the generated assetssnippet
formatsNoAsset formats to generate; png is handy while iterating on a snippet
previewNoAttach 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_dirNoDirectory the generated assets are written to (created if missing)build
include_dirsNoDirectories searched by \include, e.g. a shared settings library

Output Schema

NameRequiredDescription
okYes
errorsNo
outputsYes
previewPngNoCropped PNG of the engraved music — read this file to inspect the result

TDQS

A4.5/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines5/5

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 FileA
Idempotent

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.

NameRequiredDescriptionDefault
cropNoCrop assets to the music itself instead of a full page. Required for EPS; what you want for assets placed in a layout.
nameNoBasename for the assets; defaults to the source filename without .ly
sourceYesPath to the .ly file, relative to the project root or absolute
formatsNoAsset 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.
previewNoAttach 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_dirNoDirectory the generated assets are written to (created if missing)build
include_dirsNoDirectories searched by \include, e.g. a shared settings library

Output Schema

NameRequiredDescription
okYes
errorsNoLilyPond diagnostics when compilation fails
outputsYesAbsolute path per generated format
previewPngNoCropped PNG of the engraved music — read this file to inspect the result

TDQS

A4.2/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines4/5

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 VersionA
Read-only

Report the LilyPond version this server engraves with. Use it to pick the right \version header for new .ly files.

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription
versionYesLilyPond version banner, e.g. 'GNU LilyPond 2.26.0 (running Guile 3.0)'

TDQS

A4.2/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines4/5

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.

  1. 2 tool updatesv0.2.1
    • Changedengrave_code1 field changed
      • addedInput schema / properties / preview
        Added 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"
        +}
    • Changedengrave_file1 field changed
      • addedInput schema / properties / preview
        Added 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"
        +}
  2. 3 tool updatesv0.1.0
    • First observedengrave_code
    • First observedengrave_file
    • First observedlilypond_version

TDQS

A4.3/5.0

Scored across 3 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count4/5

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.

Completeness4/5

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

ActivitySlowing
ResponsivenessResponsive

Related MCP Connectors

Related MCP Servers