Skip to main content
Glama

🎵 MIDI 文件 MCP

执照 tonejs 微胶囊钙


📖 简介

这是一款基于 Tone.js 和 @tonejs/midi 库的 MIDI 文件解析和操作工具,通过 MCP(模型上下文协议)服务提供功能。此工具可让您轻松读取、分析和修改 MIDI 文件,而无需深入研究 MIDI 文件格式的复杂性。

Related MCP server: music21-mcp

✨ 特点

  • 读取 MIDI 文件信息

  • 获取并修改音轨、音符、控制变化和弯音信息

  • 设置 MIDI 文件速度 (BPM)

  • 向特定音轨添加新音符、控制变化和弯音

  • 添加新曲目

  • 全面的错误处理

📥 先决条件

  1. 安装Node.js :确保 npx 命令可以正常运行,建议从Node.js 官网安装最新稳定版本

🔧 使用方法

与 MCP 客户端一起使用,支持的客户端包括但不限于:

游标配置示例

在 Cursor 中配置 midi-file-mcp:

"midi-file-mcp": {
    "command": "npx",
    "args": [
        "-y",
        "midi-file-mcp"
    ]
}

🎹 使用 MIDI 解析器 MCP 和绝对路径

MIDI Parser MCP 中的所有操作都需要 MIDI 文件的绝对路径。这确保了无论当前工作目录如何,该工具都能正确定位和操作您的 MIDI 文件。

示例提示

以下是一些您可以与 AI 助手一起使用的示例提示:

  1. 获取 MIDI 文件信息:

    Can you show me information about the MIDI file at D:\path\to\your\file.mid?
  2. 分析曲目:

    Please analyze all tracks in D:\path\to\your\file.mid and tell me how many notes are in each track.
  3. 设置节奏:

    Change the tempo of D:\path\to\your\file.mid to 120 BPM.
  4. 使用注释:

    Show me all notes in track 1 of D:\path\to\your\file.mid.
  5. 添加注释:

    Add a C4 note at position 0 with a duration of 1 beat to track 0 in D:\path\to\your\file.mid.

可用操作

手术

描述

参数

获取midi信息

获取常规 MIDI 文件信息

文件路径

设置节奏

设置 MIDI 文件的节奏 (BPM)

文件路径,bpm

获取轨迹信息

获取有关所有曲目的信息

文件路径

通过索引获取轨迹信息

获取有关特定曲目的信息

文件路径、轨道索引

通过索引获取笔记

获取特定曲目的所有音符

文件路径、轨道索引

通过索引获取弯音

获取特定音轨的所有弯音

文件路径、轨道索引

通过索引获取控制更改

获取特定轨道的所有控制变化

文件路径、轨道索引

按索引添加注释

向特定轨道添加注释

文件路径、曲目索引、注释

通过索引添加控制更改

将控制更改添加到特定轨道

文件路径、轨道索引、控制变化

按索引添加弯音

为特定音轨添加弯音

文件路径、音轨索引、弯音

添加轨道

向 MIDI 文件添加新音轨

文件路径

注意:使用 Windows 路径时,请始终在文件路径中使用双反斜杠 ( \\ ) 或正斜杠 ( / ),以避免出现错误。

📄 许可证

本项目遵循 MIT 许可证。详情请参阅 LICENSE 文件。

🙏 致谢

感谢以下项目和库,如果没有它们,这个工具就不可能实现:

Available Tools

11 tools
add_controlchanges_by_indexC

Add controlchanges to midi file by track index

Inputs: filePath (required), trackIndex (required), controlchanges (required).

add_notes_by_indexB

Add notes to midi file by track index

Inputs: filePath (required), trackIndex (required), notes (required).

add_pitchbends_by_indexC

Add pitchbends to midi file by track index

Inputs: filePath (required), trackIndex (required), pitchbends (required).

add_trackB

Add a new track to midi file and return the new track info

Inputs: filePath (required).

get_controlchanges_by_indexC

Get controlchanges from midi file by track index

Inputs: filePath (required), trackIndex (required).

get_midi_infoC

Get midi file info

Inputs: filePath (required).

get_notes_by_indexB

Get notes from midi file by track index

Inputs: filePath (required), trackIndex (required).

get_pitchbends_by_indexB

Get pitchbends from midi file by track index

Inputs: filePath (required), trackIndex (required).

get_track_info_by_indexB

Get track info from midi file by track index. name, instrument, channel, endOfTrackTicks, duration, durationTicks, noteCount

Inputs: filePath (required), trackIndex (required).

get_tracks_infoC

Get tracks info from midi file

Inputs: filePath (required).

set_tempoC

Set tempo for midi file

Inputs: filePath (required), bpm (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool targets a distinct resource (notes, controlchanges, pitchbends, tracks, tempo, info) with clear operations (get, add, set), making them easily distinguishable.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with snake_case, e.g., add_notes_by_index, get_midi_info, set_tempo. No mixed conventions.

    Tool Count5/5

    11 tools is well-scoped for MIDI file manipulation, covering essential read and write operations without being excessive or thin.

    Completeness3/5

    The tool set covers adding and getting notes, control changes, and pitch bends, but lacks update and delete operations for those events, as well as removing tracks or clearing data.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables comprehensive analysis of MIDI SMF files including loading, parsing, track analysis, event extraction with filtering, and detailed file summaries. Supports memory management for efficient repeated access to loaded MIDI files.
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Exposes 16 music21 MIDI analysis and editing tools to AI agents, enabling them to read, edit, generate, and analyze MIDI files through natural language.
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A game-agnostic MCP toolkit for composing chiptune/retro MIDI and rendering game audio, enabling AI agents to generate multi-track MIDI files and render them to OGG/WAV.
      7
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that transcribes audio files into MIDI and MusicXML scores, converts MIDI to notation, and extracts playable note data for DAWs. It enables Claude to turn raw recordings into editable, shareable music scores via three simple tools.
      1
      -