Skip to main content
Glama

MCP MIDI 服务器

FastMCP 服务器允许 LLM 将 MIDI 序列发送到任何支持 MIDI 输入的软件。

特征

  • 创建虚拟 MIDI 输出端口

  • 发送 MIDI 音符开/关消息

  • 发送控制变更 (CC) 消息

  • 以精确的时间对 MIDI 事件进行排序

  • 可在任何支持 MIDI 的应用程序中用作 MIDI 输入设备

Related MCP server: Vibe Composer MIDI MCP

要求

  • Python 3.7+

  • rtmidi

  • fastmcp

  • python-dotenv

  • 异步

安装

  1. 克隆存储库:

    git clone <repository-url>
    cd mcp-server-midi
  2. 创建虚拟环境,激活它并安装依赖项:

    python -m venv .venv
    source .venv/bin/activate
    
    pip install -r requirements.txt
  3. 使用您的配置创建一个.env文件:

    PORT=8123

用法

运行服务器:

python mcp_midi_server.py

服务器会创建一个名为“MCP MIDI Out”的虚拟 MIDI 端口,可在其他应用程序中用作 MIDI 输入设备。这意味着您可以:

  • 连接数字音频工作站 (DAW),如 Ableton Live、Logic Pro 或 FL Studio,以从此服务器接收 MIDI

  • 使用服务器通过计算机的 MIDI 接口控制硬件合成器

  • 连接到任何其他接受 MIDI 输入的软件(虚拟乐器、照明控制器等)

只需在您首选的 MIDI 兼容应用程序中选择“MCP MIDI Out”作为 MIDI 输入设备。

MCP 配置

服务器使用服务器发送事件(SSE),这是在 Cursor 中配置它的方法:

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

API 方法

发送注释

发送 MIDI Note On 消息。

参数:

  • note :MIDI 音符编号(0-127)

  • velocity :音符速度(0-127,默认127)

  • channel :MIDI 通道(0-15,默认 0)

发送注释关闭

发送 MIDI 音符关闭消息。

参数:

  • note :MIDI 音符编号(0-127)

  • velocity :音符关闭速度(0-127,默认64)

  • channel :MIDI 通道(0-15,默认 0)

发送控制变更

发送 MIDI 控制变化 (CC) 消息。

参数:

  • controller :CC控制器编号(0-127)

  • value :CC值(0-127)

  • channel :MIDI 通道(0-15,默认 0)

发送 MIDI 序列

发送具有指定持续时间的一系列 MIDI 音符开/关消息。

参数:

  • events :事件字典列表。每个字典必须包含:

    • note :MIDI 音符编号(0-127)

    • velocity :音符速度(0-127,默认127)

    • channel :MIDI 通道(0-15,默认 0)

    • duration :发送 Note Off 之前保持音符的时间(秒)

    • start_time :相对于序列开始的时间(以秒为单位)(默认值为 0)

例子

使用 API 弹奏 C 大调和弦:

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

执照

麻省理工学院

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    An MCP server that enables AI models to control electronic music instruments by sending MIDI messages to hardware synths and drum machines. It supports various MIDI commands including notes, control changes, and system exclusive messages through USB or DIN MIDI interfaces.
    10
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that connects AI assistants to FL Studio for music production via Virtual MIDI. It enables users to control transport, manage the mixer, write notes, and manipulate plugin parameters through natural language.
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sandst1/mcp-server-midi'

If you have feedback or need assistance with the MCP directory API, please join our Discord server