mcpField
M
MCP MIDI Server

MCP MIDI Server

Remote
github.com/sandst1Media & Design17Updated 80w ago
Repository

About MCP MIDI Server

MCP MIDI Server is a FastMCP server that sends MIDI messages and timed note sequences to software or hardware that accepts MIDI input. It is intended for LLM-driven control of MIDI-compatible applications.

Key features

  1. 01Creates a virtual MIDI output port
  2. 02Sends Note On and Note Off messages
  3. 03Sends Control Change messages
  4. 04Sequences MIDI events with timing
  5. 05Connects to MIDI-compatible applications

Use cases

  1. 01Send notes to a digital audio workstation
  2. 02Control a hardware synthesizer
  3. 03Play timed note sequences in virtual instruments
  4. 04Send MIDI input to lighting controllers

MCP support

The server exposes MIDI message and sequence-sending tools to MCP clients. It uses SSE and can be configured with an endpoint such as http://localhost:8123/sse.

Configuration

Remote servers need no local install. Pick your client, then copy the config or install in one click.

Endpointhttp://localhost:8123/sse
Copy install command
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.

Tools

Details

From the project README

MCP MIDI Server

A FastMCP Server which allows an LLM to send MIDI sequences into any software that supports MIDI input.

Features

  • Creates a virtual MIDI output port
  • Sends MIDI Note On/Off messages
  • Sends Control Change (CC) messages
  • Sequences MIDI events with precise timing
  • Can be used as a MIDI input device in any application that supports MIDI

Requirements

  • Python 3.7+
  • rtmidi
  • fastmcp
  • python-dotenv
  • asyncio

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd mcp-server-midi
    
  2. Create a virtual env, activate it and install dependencies:

    python -m venv .venv
    source .venv/bin/activate
    
    pip install -r requirements.txt
    
  3. Create a .env file with your configuration:

    PORT=8123
    

Usage

Run the server:

python mcp_midi_server.py

The server creates a virtual MIDI port named "MCP MIDI Out" that can be used as a MIDI input device in other applications. This means you can:

  • Connect digital audio workstations (DAWs) like Ableton Live, Logic Pro, or FL Studio to receive MIDI from this server
  • Use the server to control hardware synthesizers through your computer's MIDI interface
  • Connect to any other software that accepts MIDI input (virtual instruments, lighting controllers, etc.)

Simply select "MCP MIDI Out" as a MIDI input device in your preferred MIDI-compatible application.

MCP Config

The server uses Server-Sent Events (SSE), this is how to config it in Cursor:

{
  "mcpServers": {
      "midi": {
          "url": "http://localhost:8123/sse"
      }
   }
}

API Methods

Send Note On

Sends a MIDI Note On message.

Parameters:

  • note: MIDI note number (0-127)
  • velocity: Note velocity (0-127, default 127)
  • channel: MIDI channel (0-15, default 0)
Send Note Off

Sends a MIDI Note Off message.

Parameters:

  • note: MIDI note number (0-127)
  • velocity: Note off velocity (0-127, default 64)
  • channel: MIDI channel (0-15, default 0)
Send Control Change

Sends a MIDI Control Change (CC) message.

Parameters:

  • controller: CC controller number (0-127)
  • value: CC value (0-127)
  • channel: MIDI channel (0-15, default 0)
Send MIDI Sequence

Sends a sequence of MIDI Note On/Off messages with specified durations.

Parameters:

  • events: A list of event dictionaries. Each dictionary must contain:
    • note: MIDI note number (0-127)
    • velocity: Note velocity (0-127, default 127)
    • channel: MIDI channel (0-15, default 0)
    • duration: Time in seconds to hold the note before sending Note Off
    • start_time: Time in seconds when to start the note, relative to sequence start (default 0)

Example

Using the API to play a C major chord:

events = [
    {"note": 60, "velocity": 100, "duration": 1.0, "start_time": 0.0},  # C4
    {"note": 64, "velocity": 100, "duration": 1.0, "start_time": 0.0},  # E4
    {"note": 67, "velocity": 100, "duration": 1.0, "start_time": 0.0},  # G4
]
# Send to the MCP MIDI Server API

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.