Skip to main content
Glama
pnilan

midi-mcp

by pnilan
README.md
# midi-mcp

MCP server that lets Claude control electronic music instruments via MIDI. Exposes tools for sending MIDI messages (notes, CC, program changes, pitch bend, sysex) to hardware synths and drum machines connected via USB or DIN MIDI.

## Setup

Requires [uv](https://docs.astral.sh/uv/).

```bash
cd midi-mcp
uv sync
```

## Usage

### Add to Claude Code

```bash
claude mcp add midi-mcp -- uv --directory /path/to/midi-mcp run midi-mcp
```

Or add manually to your MCP config:

```json
{
  "mcpServers": {
    "midi-mcp": {
      "command": "uv",
      "args": ["--directory", "/path/to/midi-mcp", "run", "midi-mcp"]
    }
  }
}
```

### Run standalone

```bash
uv run midi-mcp
```

## Tools

| Tool | Description |
|------|-------------|
| `list_midi_ports` | List available MIDI output ports |
| `open_midi_port` | Open a specific MIDI output port by name |
| `close_midi_port` | Close the currently open port |
| `get_midi_status` | Return current port name and connection state |
| `send_note_on` | Send Note On (channel, note, velocity) |
| `send_note_off` | Send Note Off (channel, note, velocity) |
| `send_cc` | Send Control Change (channel, control, value) |
| `send_program_change` | Send Program Change (channel, program) |
| `send_pitchwheel` | Send Pitch Bend (channel, value) |
| `send_sysex` | Send SysEx message (list of data bytes) |

## Dependencies

- [mcp[cli]](https://pypi.org/project/mcp/) - MCP Python SDK with FastMCP
- [mido](https://mido.readthedocs.io/) - MIDI message library
- [python-rtmidi](https://pypi.org/project/python-rtmidi/) - Real-time MIDI I/O backend

TDQS

A3.7/5.0

Scored across 10 tools

Disambiguation5/5

Each tool has a distinct purpose with no overlap: port management (list/open/close/status), and specific MIDI message types (note on/off, CC, pitch bend, program change, sysex). The descriptions clearly differentiate them, eliminating any ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with snake_case (e.g., list_midi_ports, send_note_on). The verbs are appropriate and predictable across the set, making the naming highly consistent.

Tool Count5/5

With 10 tools, this server is well-scoped for MIDI operations. It covers essential port management and a comprehensive set of MIDI message types, with each tool serving a clear and necessary function in the domain.

Completeness5/5

The tool set provides complete coverage for basic MIDI output: port lifecycle (list, open, close, status) and all standard message types (note on/off, CC, pitch bend, program change, sysex). There are no obvious gaps for the stated purpose.

Maintenance

ActivityInactive
ResponsivenessNo issues