Music21 Composer MCP
Enables generation and export of musical compositions to MIDI format, including melody generation, musical transformations, chord realization, and voice addition using the music21 library.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Music21 Composer MCP
A composition-focused MCP server built on music21, designed for generative workflows.
Features
generate_melody - Constraint-based melody generation
transform_phrase - Musical transformations (sequence, inversion, retrograde, etc.)
reharmonize - Generate alternative chord progressions
add_voice - Counterpoint and voice generation
realize_chord - Chord symbol to voicing
export_midi - Export to MIDI format
Related MCP server: mcp-score
Installation
# Clone the repository
git clone <repo-url>
cd music21-composer-mcp
# Install with dev dependencies
pip install -e ".[dev]"Quick Start
Start the HTTP server
composer-mcp --mode http --port 8000API Usage
# Export notes to MIDI
curl -X POST http://localhost:8000/export_midi \
-H "Content-Type: application/json" \
-d '{"stream": "C4, D4, E4, G4", "tempo": 120}'API Documentation
With the server running, visit http://localhost:8000/docs for interactive API documentation.
Input Formats
The API accepts three input formats:
1. Note List (simplest)
C4, D4, E4, G4 # Quarter notes (default)
C4:h, D4:q, E4:e # With durations (h=half, q=quarter, e=eighth)
C#4:qd, Bb3:h # Accidentals and dotted notes2. ABC Notation
X:1
M:4/4
K:C
CDEF|GABc|3. MusicXML
Standard MusicXML format.
Development
# Run tests
pytest
# Run with coverage
pytest --cov=composer_mcp
# Format code
black src tests
ruff check src testsImplementation Status
Tool | Status |
| Implemented |
| Phase 2 |
| Phase 2 |
| Phase 3 |
| Phase 4 |
| Phase 5 |
MCP adapter | Phase 6 |
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Deterministic music theory for agents: analyze, voice, reharmonize, conduct — computed, not guessed
Autonomous music production for AI agents with MIDI generation, QC and provenance.
Browser DAW for AI assistants: build multitrack songs with MIDI, effects, stems and generation.
MCP server for Producer/Riffusion AI music generation
Related MCP Servers
- AlicenseAqualityCmaintenanceRender 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.5103 npm3MIT
- AlicenseAqualityBmaintenanceAI-powered music notation server that lets you create and edit scores using natural language, integrating with MuseScore for live manipulation.2353 PyPI32MIT
- AlicenseAqualityCmaintenanceDeterministic music-theory MCP server and API for AI agents — analyze chords, run Roman-numeral analysis, generate voicings, and reharmonize progressions. Computed from music theory, not hallucinated.584 npm13PolyForm Noncommercial 1.0.0
- -licenseNot gradedqualityNot gradedmaintenanceMCP server for vibe coding with music, enabling format conversion (LilyPond, MusicXML, MIDI, ABC, etc.), audio-to-sheet transcription, and transposition with robust fallback outputs.1-