Skip to main content

musicxml-abc-mcp

MCP server that converts between MusicXML and ABC notation.

What it does

Bridges MusicXML (the standard but verbose XML format) and ABC notation (a compact, human-readable text format). The primary use case is enabling LLM-assisted score editing: MusicXML → ABC → Claude edits → ABC → MusicXML.

ABC is ideal for LLM editing because it is concise enough to fit in a context window and expressive enough to represent most choral music.

Tools

Tool Description
musicxml_to_abc Convert MusicXML to ABC notation; optionally filter to a single part
abc_to_musicxml Convert ABC notation back to MusicXML
validate_abc Parse an ABC string and return errors or warnings
list_capabilities Return server metadata: backend version, ABC standard
health_check Run a MusicXML → ABC → MusicXML round-trip smoke test and report status

Installation

cd musicxml-abc-mcp
uv sync --extra dev

Note: use --extra dev (not --group dev) to install pytest.

For a guided setup (installs uv if needed, then syncs dependencies), run ./install.sh — see SETUP.md for step-by-step instructions. Ready-made client configs (Claude Desktop, Cursor, Windsurf, Continue, Zed) are in examples/. If something doesn't work, check TROUBLESHOOTING.md.

Running

uv run musicxml-abc-mcp

No environment variables required.

Usage examples

All tools take and return strings directly (no file paths) — the MCP client is responsible for reading/writing files if needed.

// Convert full score to ABC
{
  "tool": "musicxml_to_abc",
  "arguments": {"musicxml": "<score-partwise>...</score-partwise>"}
}
// → {"abc": "X:1\nT:...\n...", "parts_included": ["Soprano", "Alto", "Tenor", "Bass"], "warnings": []}

// Extract just the Soprano part
{
  "tool": "musicxml_to_abc",
  "arguments": {"musicxml": "<score-partwise>...</score-partwise>", "part_id": "Soprano"}
}

// Convert edited ABC back to MusicXML
{
  "tool": "abc_to_musicxml",
  "arguments": {"abc": "X:1\nT:My Song\n..."}
}
// → {"musicxml": "<?xml version=\"1.0\"?>...", "warnings": []}

// Validate ABC before converting
{
  "tool": "validate_abc",
  "arguments": {"abc": "X:1\nT:My Song\n..."}
}

ABC notation basics

This server uses ABC standard v2.1:

  • c (lowercase) = C4 (middle C)
  • C (uppercase) = C3 (one octave below middle C)
  • Apostrophe raises an octave: c' = C5
  • Comma lowers an octave: C, = C2

Round-trips preserve notes within ±2%. Dynamics and complex articulations are not preserved.

Testing

# All tests including integration (round-trip SATB conversion)
VIRTUAL_ENV= .venv/bin/pytest tests/ -v

Dependencies

  • music21 — score parsing; ABC output uses a custom serializer (music21 9.x has no ABC writer)
  • mcp — MCP protocol

System requirements

  • Python 3.11+
  • No system libraries required

Metadata

Release files for musicxml-abc-mcp 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for musicxml-abc-mcp 0.2.1
File Size Uploaded
musicxml_abc_mcp-0.2.1.tar.gz 140.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for musicxml-abc-mcp 0.2.1
File Interpreter ABI Platform
musicxml_abc_mcp-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 152.5 kB

Release files / musicxml_abc_mcp-0.2.1.tar.gz

Download URL musicxml_abc_mcp-0.2.1.tar.gz
Size 140.5 kB
Tags Source
SHA-256 checksum
How to use checksums
16044a97853e8f59c109c9ab1638e9183df14e7544490ea6e49c0d809062cf5b
BLAKE2b-256 checksum
How to use checksums
14abb46b2059bcf70a74b041a93dde0cd451d87a37a87e67b2f430660d9ef45d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / musicxml_abc_mcp-0.2.1-py3-none-any.whl

Download URL musicxml_abc_mcp-0.2.1-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
851f9b4ba6a41c4b1791af9d7f47f0bbb3ec2c24715e98ec74a31c818f171528
BLAKE2b-256 checksum
How to use checksums
642e7307cb63eced0dbca00890e8e7492d4a60c6edc0ae5583bb8b27ee38b0e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page