MIDI MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MIDI MCP ServerCreate a MIDI file with a C major chord progression"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MIDI MCP Server
A Model Context Protocol (MCP) server for AI-driven MIDI composition. Generate MIDI files from structured JSON data, with chord name support, an interactive piano-roll preview UI, and multiple deployment modes.

Looking for the Agent Skills approach? It composes better songs with less context: tubone24/midi-agent-skill
Features
Two MCP tools:
create_midi(with interactive preview UI) andparse_chordRich pitch input: MIDI numbers, note name strings (
"C4"), pitch arrays, or chord names ("Cmaj7")Chord library: 25+ chord qualities — major, minor, dim, aug, 7th, maj7, m7, sus2, sus4, power, and more
Flexible durations: numeric beats, standard strings (
'4','8'), dotted ('d4'), triplet ('T8')Music theory resources: 7 built-in reference documents accessible as MCP resources
Three transport modes: stdio, HTTP, or Cloudflare Workers (remote)
MCP App UI: Piano-roll visualization and audio playback rendered directly in the conversation
Related MCP server: CHUK Music MCP Server
Deployment Options
Option A — Remote (Cloudflare Workers)
A pre-deployed remote server is available:
https://midi-mcp-server.tubone24.workers.dev/mcpAdd it to any MCP client that supports Streamable HTTP (e.g., Claude.ai):
{
"mcpServers": {
"midi": {
"type": "http",
"url": "https://midi-mcp-server.tubone24.workers.dev/mcp"
}
}
}Option B — Local stdio (recommended for desktop clients)
Build and configure as a local stdio server:
npm install
npm run build{
"mcpServers": {
"musicComposer": {
"command": "node",
"args": ["/path/to/midi-mcp-server/build/index.js"]
}
}
}Option C — Local HTTP
Run as a local Streamable HTTP server:
node build/index.js --http
# or with a custom port:
node build/index.js --http --port=8080The server exposes:
POST /mcp— MCP Streamable HTTP endpointGET /health— Health check ({"status":"ok","version":"0.2.0"})
Tools
create_midi
Generate a MIDI file from structured composition data. Returns base64-encoded MIDI and renders an interactive piano-roll preview with audio playback in supported MCP clients (MCP App).

Input
Field | Type | Required | Description |
|
| ✓ | Title of the composition |
|
| ✓ | Composition data (see schema below) |
Output (structured content)
Field | Type | Description |
|
| Base64-encoded MIDI file data |
|
| Composition title |
|
| Tempo used |
|
| Number of tracks generated |
parse_chord
Parse a chord name and return its component MIDI pitches and note names. Useful for understanding voicings before composing.
Input
Field | Type | Required | Description |
|
| ✓ | Chord name, e.g. |
|
| — | Root octave (default: |
Output example
{
"chord": "Cmaj7",
"octave": 4,
"midiNumbers": [60, 64, 67, 71],
"noteNames": ["C4", "E4", "G4", "B4"]
}Composition Schema
{
"bpm": 120, // tempo (also accepted: "tempo")
"timeSignature": { "numerator": 4, "denominator": 4 }, // optional, default 4/4
"tracks": [
{
"name": "Piano", // optional
"instrument": 0, // GM program number 0–127 (optional)
"notes": [
{
"pitch": 60, // MIDI number, note name "C4", or array [60, 64, 67]
"chord": "Cmaj7", // OR use chord name (overrides pitch)
"beat": 1, // beat position (1-based); OR use startTime
"startTime": 0, // tick offset (alias: "time")
"duration": "4", // see Duration Reference below
"velocity": 100, // 0–127 (optional, default 100)
"channel": 0 // MIDI channel 0–15 (optional)
}
]
}
]
}Pitch Input Formats
Format | Example | Description |
MIDI number |
| Standard MIDI note number (0–127) |
Note name |
| Letter + optional accidental + octave |
Pitch array |
| Multiple pitches played simultaneously |
Chord field |
| Chord name expanded automatically |
Supported accidentals: # (sharp), b (flat). Examples: "F#5", "Bb3".
Duration Reference
Value | Description |
| Whole note |
| Half note |
| Quarter note |
| Eighth note |
| Sixteenth note |
| Thirty-second note |
| Dotted variants |
| Double-dotted quarter |
| Triplet variants |
| Beat-based: |
Supported Chord Qualities
Quality | Example | Description |
(none) / |
| Major |
|
| Minor |
|
| Diminished |
|
| Augmented |
|
| Dominant 7th |
|
| Major 7th |
|
| Minor 7th |
|
| Diminished 7th |
|
| Half-diminished |
|
| Augmented 7th |
|
| 6th |
|
| 9th variants |
|
| Add 9th |
|
| Extended |
|
| Suspended |
|
| 7th suspended |
|
| Power chord |
MCP Resources
The server exposes 7 music theory reference documents as MCP resources:
URI | Description |
| Intervals, chord types, diatonic chords, cadences, voice leading |
| Common progressions by mood/genre, substitutions, modulation |
| Species counterpoint rules, consonance/dissonance, motion types |
| Diatonic modes, minor scale variants, pentatonic/blues, genre guide |
| Instrument ranges, GM program numbers, texture types |
| Time signatures, MIDI duration reference, genre grooves |
| Forbidden parallels, voicing strategies, non-chord tones |
MCP clients that support resource reading can pass these to the AI as context, enabling theory-aware composition.
Example Composition
const composition = {
bpm: 120,
timeSignature: { numerator: 4, denominator: 4 },
tracks: [
{
name: "Piano",
instrument: 0,
notes: [
{ chord: "Cmaj7", beat: 1, duration: "2", velocity: 90 },
{ chord: "Am7", beat: 3, duration: "2", velocity: 90 },
{ chord: "Fmaj7", beat: 5, duration: "2", velocity: 90 },
{ chord: "G7", beat: 7, duration: "2", velocity: 90 }
]
},
{
name: "Melody",
instrument: 0,
notes: [
{ pitch: "E4", beat: 1, duration: "4", velocity: 100 },
{ pitch: "G4", beat: 2, duration: "4", velocity: 100 },
{ pitch: "A4", beat: 3, duration: "2", velocity: 110 }
]
}
]
};Demo
The prompt below generates an 8-bar melodic minor choral piece:
Create an 8-bar choral piece in a slightly minor, melodic scale.https://github.com/user-attachments/assets/e20ebef0-fdbf-4e72-910d-41b94183f9d9
Build & Development
npm install
# Full build (UI + server)
npm run build
# Build steps individually
npm run build:ui # Vite — builds the MCP App preview HTML
npm run build:server # tsc — compiles TypeScript server
# Deploy to Cloudflare Workers
npm run deploy
# Run tests
npm test
npm run test:coverageDependencies
Package | Purpose |
| MCP server implementation (stdio & HTTP transports) |
| MCP Apps extension — interactive UI in conversation |
| MIDI file generation |
| MIDI parsing (preview UI) |
| Audio playback in preview UI |
| Input schema validation |
Available Tools
2 toolscreate_midiCreate MIDIA
Generate a MIDI file from structured composition data with chord support. Supports single notes, note arrays (chords), and chord names (5, 6, 7, 9, 11, 13, maj, m, min, dim, etc.). Returns base64-encoded MIDI data and displays an interactive preview with piano-roll notation and playback.
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Title of the composition | |
| composition | No | Composition object with bpm (number), optional timeSignature ({numerator, denominator}), and tracks (array of {name?, instrument?, notes: [{pitch, chord?, beat?, startTime?, duration, velocity?, channel?}]}) |
Output Schema
| Name | Required | Description |
|---|---|---|
| bpm | Yes | |
| title | Yes | |
| midiBase64 | Yes | |
| trackCount | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses that the tool returns base64-encoded MIDI data and shows an interactive preview, which is useful. However, it does not mention any side effects, limitations, or prerequisites beyond the input schema, leaving some behavioral ambiguity.
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?
The description is concise and well-structured, with two sentences that front-load the main purpose and then provide key details about output and preview. There is no redundant information or 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?
Given the tool's simplicity (2 parameters, output schema present), the description covers the essential aspects: what it does, the output format, and the interactive preview. It does not mention the behavior when composition is omitted (since title is the only required parameter), but this is a minor gap.
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 description adds value beyond the input schema by elaborating on the chord support feature, listing specific chord types (5, 6, 7, 9, 11, 13, maj, m, min, dim, etc.). It also clarifies that the composition data must be structured, reinforcing the schema's meaning.
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 uses a specific verb ('Generate') and resource ('MIDI file'), clearly stating the tool's function. It also mentions chord support, which distinguishes it from the sibling parse_chord tool, even though it does not explicitly name it.
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?
The description clearly indicates the tool should be used when generating a MIDI file from structured composition data. However, it does not explicitly mention when not to use it or provide alternatives, such as referencing the sibling parse_chord tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
parse_chordA
Parse a chord name and return its component MIDI pitches. Useful for understanding chord voicings.
| Name | Required | Description | Default |
|---|---|---|---|
| chord | Yes | Chord name (e.g., "Cmaj7", "Dm", "F#m7", "G7sus4") | |
| octave | No | Octave for the root note (default: 4) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden. It states the output (MIDI pitches) but does not mention read-only nature, error handling for invalid chord names, whether pitches are sorted, or how octave affects non-root notes. Behavior is partly transparent but gaps remain.
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?
The description is two concise sentences, front-loaded with the action, and contains no filler. Every word contributes meaning.
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 simple tool with 2 parameters and no output schema, the description is adequate but incomplete. It does not specify the exact return format (e.g., array of integers, sorted order) or how octave interacts with chord voicing internals. More detail would improve completeness.
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 description coverage is 100%: both chord and octave have descriptions. The tool description adds no further parameter meaning, so it does not exceed the baseline provided by the schema.
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?
Description clearly states the verb (parse) and resource (chord name) and the result (component MIDI pitches). This differentiates it from the sibling create_midi, which generates MIDI rather than parsing chords.
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?
The phrase 'Useful for understanding chord voicings' implies a use case but does not explicitly state when to use this tool versus create_midi, nor does it provide exclusions or prerequisites. It gives context but lacks clear when-to-use/when-not-to-use guidance.
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.0- First observed
create_midi - First observed
parse_chord
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: create_midi generates MIDI files from composition data, while parse_chord analyzes chord names into pitches. No overlap or ambiguity exists.
Both tool names follow a consistent verb_noun pattern (create_midi, parse_chord), making the naming predictable and intuitive.
With only 2 tools, the server is minimal but appropriately scoped for a niche MIDI/chord utility. The low count is justified by the focused domain, though it is on the thin side.
The server covers generation of MIDI files and chord parsing, addressing its core purpose. Minor gaps like MIDI file reading or conversion exist, but they are not obvious omissions for the stated functionality.
Maintenance
Related MCP Connectors
- VocunoOAuthcom.vocuno
AI music studio: song generation with vocals, covers, stems, voice conversion, mastering, editing.
Convert projects between Logic, Ableton, FL Studio and REAPER; generate, separate, transcribe
- mozonicOAuthcom.mozonic
AI mixing and mastering: analyze your mixes, run DSP autofix, render stems, and master tracks.
Image, video, music and text generation across 100+ models through one endpoint.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables LLMs to compose and play multi-track MIDI music through natural language prompts. Supports outputting to software or hardware synthesizers for enhanced audio quality.29 npm24MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI-assisted music composition through copyable pattern templates, style constraints, and arrangement tools that compile to MIDI files. Provides 30+ tools for managing musical structures, layers, patterns, and styles with deterministic compilation from YAML arrangements.1MIT
- AlicenseNot gradedqualityBmaintenanceIntegrates AI-powered music generation with professional production tools, enabling autonomous music creation workflows from MIDI input to live streaming.5MIT
- AlicenseBqualityBmaintenanceEnables LLMs to compose music by describing musical intent using high-level operations like notes, chords, dynamics, and tempo, then renders the composition into standard MIDI files.47MIT