Logo: MIDI MCP Server

MIDI MCP Server

Communautéit
tubone24

MIDI MCP Server is a Model Context Protocol (MCP) server that enables AI models to generate MIDI files from text-based music data. This tool allows for programmatic creation of musical compositions through a standardized interface.

Editeurtubone24
Repositorymidi-mcp-server
SproochTypeScript
Forks
11
Stären
52
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    MIDI MCP Server bitt MCP-Funktiounen un, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • Disponibel Tools: 0

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an deem MCP-Client ze konfiguréieren, deen Dir am léifste benotzt.

  • Interessi vun der Communautéit um Open-Source-Projet

    Zuele vum verlinkte Repository – Stären: 52, Forks: 11.

MseeP.ai Security Assessment Badge

Verified on MseeP

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.

demo

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) and parse_chord
  • Rich 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

Deployment Options

Option A — Remote (Cloudflare Workers)

A pre-deployed remote server is available:

https://midi-mcp-server.tubone24.workers.dev/mcp

Add it to any MCP client that supports Streamable HTTP (e.g., Claude.ai):

json
{
  "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:

bash
npm install
npm run build
json
{
  "mcpServers": {
    "musicComposer": {
      "command": "node",
      "args": ["/path/to/midi-mcp-server/build/index.js"]
    }
  }
}

Option C — Local HTTP

Run as a local Streamable HTTP server:

bash
node build/index.js --http
# or with a custom port:
node build/index.js --http --port=8080

The server exposes:

  • POST /mcp — MCP Streamable HTTP endpoint
  • GET /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).

mid

Input

FieldTypeRequiredDescription
titlestring✓Title of the composition
compositionobject✓Composition data (see schema below)

Output (structured content)

FieldTypeDescription
midiBase64stringBase64-encoded MIDI file data
titlestringComposition title
bpmnumberTempo used
trackCountnumberNumber 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

FieldTypeRequiredDescription
chordstring✓Chord name, e.g. "Cmaj7", "F#m7", "G7sus4"
octavenumber—Root octave (default: 4)

Output example

json
{
  "chord": "Cmaj7",
  "octave": 4,
  "midiNumbers": [60, 64, 67, 71],
  "noteNames": ["C4", "E4", "G4", "B4"]
}

Composition Schema

jsonc
{
  "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

FormatExampleDescription
MIDI number60Standard MIDI note number (0–127)
Note name"C4"Letter + optional accidental + octave
Pitch array[60, 64, 67]Multiple pitches played simultaneously
Chord fieldchord: "Cmaj7"Chord name expanded automatically

Supported accidentals: # (sharp), b (flat). Examples: "F#5", "Bb3".

Duration Reference

ValueDescription
'1'Whole note
'2'Half note
'4'Quarter note
'8'Eighth note
'16'Sixteenth note
'32'Thirty-second note
'd1' 'd2' 'd4' 'd8' 'd16'Dotted variants
'dd4'Double-dotted quarter
'T4' 'T8' …Triplet variants
4 (number)Beat-based: 1=quarter, 2=half, 4=whole, 0.5=eighth

Supported Chord Qualities

QualityExampleDescription
(none) / majC, CmajMajor
m / minDmMinor
dimBdimDiminished
augEaugAugmented
7G7Dominant 7th
maj7 / M7Cmaj7Major 7th
m7 / min7Am7Minor 7th
dim7Bdim7Diminished 7th
m7b5Bm7b5Half-diminished
aug7Eaug7Augmented 7th
6 / m6C6, Am66th
9 / maj9 / m9G99th variants
add9Cadd9Add 9th
11 / 13C11Extended
sus2 / sus4Gsus4Suspended
7sus4 / 7sus2G7sus47th suspended
power / 5G5Power chord

MCP Resources

The server exposes 7 music theory reference documents as MCP resources:

URIDescription
music-theory://harmonyIntervals, chord types, diatonic chords, cadences, voice leading
music-theory://chord-progressionsCommon progressions by mood/genre, substitutions, modulation
music-theory://counterpointSpecies counterpoint rules, consonance/dissonance, motion types
music-theory://modes-scalesDiatonic modes, minor scale variants, pentatonic/blues, genre guide
music-theory://orchestrationInstrument ranges, GM program numbers, texture types
music-theory://rhythm-patternsTime signatures, MIDI duration reference, genre grooves
music-theory://voice-leadingForbidden 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

javascript
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

melodic_minor_chorus.mid


Build & Development

bash
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:coverage

Dependencies

PackagePurpose
@modelcontextprotocol/sdkMCP server implementation (stdio & HTTP transports)
@modelcontextprotocol/ext-appsMCP Apps extension — interactive UI in conversation
midi-writer-jsMIDI file generation
@tonejs/midiMIDI parsing (preview UI)
soundfont-playerAudio playback in preview UI
zodInput schema validation

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "tubone24-midi-mcp-server": {
      "command": "",
      "args": []
    }
  }
}

MIDI MCP Server MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal MIDI MCP Server verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung, fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector: D'Optioun „Dësen Apparat“ ass ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Setzt de kopéierte Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

MIDI MCP Server als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a setzt d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Setzt d'MCP-Serverkonfiguratioun fir MIDI MCP Server an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert d'Säit, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "tubone24-midi-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "midi-mcp-server"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vun der Integratioun MIDI MCP Server. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vun der Integratioun MIDI MCP Server.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierten MCP-Tools an engem ausgewielte KI-Modell
Kënnt Dir mir mat MIDI MCP Server bei dëser Aufgab hëllefen?
MIDI MCP Server
Jo. Ech hunn et gelies.
Dat hunn ech mat MIDI MCP Server fonnt.

Heefeg gestallte Froen

Fir wat gëtt den MCP-Server MIDI MCP Server benotzt?

MIDI MCP Server ass en MCP-Server, deen et kompatibele KI-Clienten erlaabt, op extern Tools a Kontextinformatioune zouzegräifen. An TypingMind kënnt Dir dësen MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech MIDI MCP Server MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir MIDI MCP Server mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni den MCP-Server fir all Modell separat anzeriichten.

Firwat MIDI MCP Server MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann MIDI MCP Server verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Ären Aarbechtsoflaf beim Chatten an TypingMind organiséieren.

Wéi verbannen ech MIDI MCP Server MCP mat TypingMind?

MIDI MCP Server leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann den MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt MIDI MCP Server MCP an TypingMind zur Verfügung?

MIDI MCP Server stellt MCP-Funktioune zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agente zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir MIDI MCP Server MCP ze benotzen?

Nee. TypingMind ass nom Local-first-Prinzip opgebaut a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann MIDI MCP Server eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir deen MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇