Skip to main content
Glama
lilypond-mcp

lilypond-mcp

lilypond-mcp

GNU LilyPond 소스를 배치 가능한 자산으로 변조(engrave)하는 MCP 서버입니다: 전체 페이지가 아니라 음악 크기에 맞춰진 크롭된(cropped) 독립형 EPS, PDF, SVG, PNG를 생성하여 InDesign 같은 페이지 레이아웃 소프트웨어에 바로 넣을 수 있습니다.

Tools

  • engrave_file — .ly 파일을 변조합니다. 기본값은 build/ 안의 크롭된 EPS이며, 에이전트가 결과를 확인할 수 있는 미리보기 PNG도 생성합니다.

  • engrave_code — 인라인으로 전달된 LilyPond 코드를 변조합니다. 디스크를 건드리지 않고 음악적 아이디어를 반복할 수 있습니다. 기본값은 PNG입니다.

  • lilypond_version — 서버가 변조에 사용하는 LilyPond 버전입니다. 올바른 \version 헤더를 고르는 데 사용합니다.

두 변조 도구 모두 formats(eps/pdf/svg/png), crop, include_dirs(공용 \include 라이브러리용), output_dir을 받습니다. 경로는 서버가 실행된 작업 디렉터리를 기준으로 해석됩니다. Claude Code .mcp.json 항목에서 그 기준 디렉터리는 프로젝트 루트입니다.

실패 시 결과에는 행 번호가 포함된 LilyPond의 진단 정보가 담겨 있어, 에이전트가 소스를 수정한 뒤 다시 시도할 수 있습니다.

Related MCP server: inkscape-mcp

이 서버가 흡수하는 LilyPond 2.26 특이점

  • EPS는 ps 백엔드의 크롭된 출력으로만 존재합니다(-dbackend=eps는 사라짐). crop 없는 EPS는 처음부터 거부됩니다.

  • SVG는 자체 백엔드를 가지며 두 번째 패스로 실행됩니다. 글리프가 외곽선(outline)으로 나오므로, 보거나 가져오기 위해 글꼴을 설치할 필요가 없습니다.

  • 크롭된 출력(NAME.cropped.EXT)은 일반 이름으로 이름을 바꿔 덮어쓰며, 남은 중간 파일은 정리됩니다.

  • lilypond -o는 작업 디렉터리를 변경하므로, include 경로는 호출 전에 절대 경로로 만듭니다.

실행

서버는 PATH에 node(≥ 20)와 lilypond가 필요합니다. 번들된 Nix 플레이크가 둘 다 제공하므로, 이를 사용하는 프로젝트의 .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 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

ActivityNo data
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    Render music notation from a JSON score to inline SVG (Verovio + Bravura), round-trippable MusicXML, and base64 MIDI in one call. Includes pre-flight validation with concrete fix suggestions and a curated music-theory knowledge search. Free, open, no auth, sponsored by Gradus School of Music Composition.
    5
    131 npm
    3
    MIT
  • A
    license
    C
    quality
    A
    maintenance
    Enables 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.
    90
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables MCP clients to create, inspect, edit, render, and export SVG/Inkscape documents through typed drawing tools, with a deterministic offline backend and an optional bridge to a locally running Inkscape instance for limited live editing and snapshots.
    5
    BSD 3-Clause