MIDI Files logo

MIDI Files

Community
xiaolaa2

A powerful MCP tool for parsing and manipulating MIDI files based on Tone.js. This library leverages the Model Context Protocol (MCP) to enable AI assistants to easily read, analyze, and modify MIDI files without dealing with the complexities of the MIDI file format.

Publisherxiaolaa2
Repositorymidi-file-mcp
LanguageJavaScript
Forks
2
Stars
8
Available tools
11
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    MIDI Files exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 11 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    8 stars and 2 forks from the linked repository.

🎵 MIDI File MCP

smithery badge license tonejs MCP


📖 Introduction

This is a MIDI file parsing and manipulation tool based on Tone.js and the @tonejs/midi library, providing functionality through MCP (Model Context Protocol) services. This tool allows you to easily read, analyze and modify MIDI files without delving into the complexities of the MIDI file format.

✨ Features

  • Read MIDI file information
  • Get and modify track, note, control change, and pitch bend information
  • Set MIDI file tempo (BPM)
  • Add new notes, control changes, and pitch bends to specific tracks
  • Add new tracks
  • Comprehensive error handling

📥 Prerequisites

  1. Install Node.js: Ensure that the npx command can run normally. It is recommended to install the latest stable version from the Node.js official website

🔧 Usage

Use with an MCP client, supported clients include but are not limited to:

Installing via Smithery

To install MIDI File Parser for Claude Desktop automatically via Smithery:

bash
npx -y @smithery/cli install @xiaolaa2/midi-file-mcp --client claude

Cursor Configuration Example

Configure midi-file-mcp in Cursor:

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

🎹 Using MIDI Parser MCP with Absolute Paths

All operations in MIDI Parser MCP require the absolute path to the MIDI file. This ensures that the tool can correctly locate and manipulate your MIDI files regardless of the current working directory.

Example Prompts

Here are some example prompts you can use with your AI assistant:

  1. Get MIDI File Information:

    Can you show me information about the MIDI file at D:\path\to\your\file.mid?
  2. Analyzing Tracks:

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

    Change the tempo of D:\path\to\your\file.mid to 120 BPM.
  4. Working with Notes:

    Show me all notes in track 1 of D:\path\to\your\file.mid.
  5. Adding Notes:

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

Available Operations

OperationDescriptionParameters
get_midi_infoGet general MIDI file informationfilePath
set_tempoSet the tempo (BPM) of a MIDI filefilePath, bpm
get_tracks_infoGet information about all tracksfilePath
get_track_info_by_indexGet information about a specific trackfilePath, trackIndex
get_notes_by_indexGet all notes from a specific trackfilePath, trackIndex
get_pitchbends_by_indexGet all pitch bends from a specific trackfilePath, trackIndex
get_controlchanges_by_indexGet all control changes from a specific trackfilePath, trackIndex
add_notes_by_indexAdd notes to a specific trackfilePath, trackIndex, notes
add_controlchanges_by_indexAdd control changes to a specific trackfilePath, trackIndex, controlchanges
add_pitchbends_by_indexAdd pitch bends to a specific trackfilePath, trackIndex, pitchbends
add_trackAdd a new track to the MIDI filefilePath

Note: Always use double backslashes (\\) or forward slashes (/) in file paths when working with Windows paths to avoid errors.

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

🙏 Acknowledgements

Thanks to the following projects and libraries, without which this tool would not be possible:

Installation

TypingMind
Prerequisites:

Node.js 18+

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

Available Tools

  • get_midi_info

    Get midi file info

  • set_tempo

    Set tempo for midi file

  • get_tracks_info

    Get tracks info from midi file

  • get_track_info_by_index

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

  • get_notes_by_index

    Get notes from midi file by track index

  • get_pitchbends_by_index

    Get pitchbends from midi file by track index

  • get_controlchanges_by_index

    Get controlchanges from midi file by track index

  • add_notes_by_index

    Add notes to midi file by track index

  • add_controlchanges_by_index

    Add controlchanges to midi file by track index

  • add_pitchbends_by_index

    Add pitchbends to midi file by track index

  • add_track

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

Use MIDI Files MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MIDI Files is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add MIDI Files as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the MIDI Files MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "midi-files": {
      "command": "npx",
      "args": [
        "-y",
        "midi-file-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the MIDI Files MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the MIDI Files MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MIDI Files to help me with this task?
MIDI Files
Sure. I read it.
Here is what I found using MIDI Files.

Frequently asked questions

What is the MIDI Files MCP server used for?

MIDI Files is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MIDI Files MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MIDI Files with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MIDI Files MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MIDI Files connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MIDI Files MCP to TypingMind?

MIDI Files runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does MIDI Files MCP provide in TypingMind?

MIDI Files exposes 11 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MIDI Files MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MIDI Files requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇