MIDI Analyzer MCP Server

MIDI Analyzer MCP Server

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.

Category
访问服务器

README

MIDI Analyzer MCP Server

A Model Context Protocol (MCP) server for analyzing MIDI SMF (Standard MIDI File) files. This server provides comprehensive tools for loading, parsing, and analyzing MIDI files.

Features

  • MIDI File Loading: Load and parse MIDI SMF files
  • File Summary: Get comprehensive information about MIDI files (format, PPQ, tempo, time signature, key signature, etc.)
  • Track Analysis: List and analyze individual tracks with filtering capabilities
  • Event Extraction: Extract and filter MIDI events with advanced filtering options
  • Memory Management: Keep loaded files in memory for efficient repeated access

Available Tools

1. load_midi_file

Load and parse a MIDI SMF file from a specified path.

Parameters:

  • filePath (string): Path to the MIDI file

Returns:

  • fileId: Unique identifier for the loaded file
  • filePath: Path to the loaded file
  • format: MIDI format type (0, 1, or 2)
  • trackCount: Number of tracks
  • ppq: Pulses per quarter note
  • totalEvents: Total number of events

2. get_midi_summary

Get comprehensive summary information about a MIDI file.

Parameters:

  • fileId (string, optional): ID of loaded file
  • filePath (string, optional): Path to MIDI file

Returns:

  • Complete summary including format, PPQ, total ticks, track count, tempo info, time signatures, key signatures

3. get_tracks_list

Get list of tracks with optional filtering.

Parameters:

  • fileId or filePath: File identifier
  • channelFilter (number, optional): Filter by MIDI channel (0-15)
  • programFilter (number, optional): Filter by program number (0-127)

Returns:

  • Array of track information including names, channels, programs, event counts

4. get_track_details

Get detailed information about a specific track.

Parameters:

  • fileId or filePath: File identifier
  • trackIndex (number): Track index to analyze
  • timeRange (object, optional): Filter events by time range
  • eventTypeFilter (array, optional): Filter by event types
  • valueFilter (object, optional): Filter by specific values

Returns:

  • Track metadata and filtered events

5. get_midi_events

Extract MIDI events with comprehensive filtering.

Parameters:

  • fileId or filePath: File identifier
  • timeRange (object, optional): Time range filter
  • eventTypeFilter (array, optional): Event type filter
  • trackFilter (array, optional): Track filter
  • valueFilter (object, optional): Value filter

Returns:

  • Filtered array of MIDI events

Installation

Prerequisites

  • Node.js (version 18 or higher)
  • npm (comes with Node.js)

Adding to Claude Code

Method 1: Using npx (Recommended - No Local Installation Required)

Add the following configuration to your Claude Code settings file:

{
  "mcpServers": {
    "midi-analyzer": {
      "command": "npx",
      "args": ["sin5ddd/midi-analyzer-mcp"]
    }
  }
}

This method automatically downloads and runs the latest version from GitHub without requiring local installation.

Method 2: Local Installation (For Development or Offline Use)

  1. Clone the repository:

    git clone https://github.com/sin5ddd/midi-analyzer-mcp.git
    cd midi-analyzer-mcp
    
  2. Install dependencies:

    npm install
    
  3. Build the project:

    npm run build
    
  4. Configure Claude Code:

For Windows:

{
  "mcpServers": {
    "midi-analyzer": {
      "command": "node",
      "args": ["C:\\path\\to\\midi-analyzer-mcp\\dist\\index.js"],
      "cwd": "C:\\path\\to\\midi-analyzer-mcp"
    }
  }
}

For Unix/Linux/macOS:

{
  "mcpServers": {
    "midi-analyzer": {
      "command": "node",
      "args": ["/path/to/midi-analyzer-mcp/dist/index.js"],
      "cwd": "/path/to/midi-analyzer-mcp"
    }
  }
}

Configuration File Locations

Claude Code configuration files are located at:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Quick Setup with npx (Recommended)

  1. Add to Claude Code configuration:

    {
      "mcpServers": {
        "midi-analyzer": {
          "command": "npx",
          "args": ["sin5ddd/midi-analyzer-mcp"]
        }
      }
    }
    
  2. Restart Claude Code to load the new MCP server.

  3. Test the installation by asking Claude Code:

    "Load the MIDI file at [path] and analyze its contents"
    

Local Development Setup

  1. Clone and setup the repository:

    git clone https://github.com/sin5ddd/midi-analyzer-mcp.git
    cd midi-analyzer-mcp
    npm install
    npm run build
    
  2. Add to Claude Code configuration:

    {
      "mcpServers": {
        "midi-analyzer": {
          "command": "node",
          "args": ["/path/to/midi-analyzer-mcp/dist/index.js"],
          "cwd": "/path/to/midi-analyzer-mcp"
        }
      }
    }
    

Development

Local Development

npm run dev

Build for Production

npm run build

Run in Production

npm start

Troubleshooting

  1. Installation Issues:

    • Ensure Node.js version 18+ is installed: node --version
    • Check npm version: npm --version
    • Try clearing npm cache: npm cache clean --force
  2. Claude Code Integration:

    • Verify the path to dist/index.js is correct and absolute
    • Ensure the project has been built with npm run build
    • Check Claude Code logs for MCP server startup errors
    • Make sure Node.js is accessible from the command line
  3. Runtime Issues:

    • Verify MIDI file paths are correct and accessible
    • Check file permissions for MIDI files
    • Ensure MIDI files are valid SMF format
  4. Updates:

    For npx method: Updates are automatic - npx always downloads the latest version.

    For local installation:

    cd /path/to/midi-analyzer-mcp
    git pull origin main
    npm install
    npm run build
    

    Then restart Claude Code.

Event Types

The server recognizes the following MIDI event types:

  • noteOn: Note on events
  • noteOff: Note off events
  • noteAftertouch: Note aftertouch
  • controller: Control change
  • programChange: Program change
  • channelAftertouch: Channel aftertouch
  • pitchBend: Pitch bend
  • sysEx: System exclusive
  • meta: Meta events (tempo, time signature, etc.)

Filtering Options

Time Range

Filter events by MIDI tick range:

{
  "timeRange": {
    "startTick": 0,
    "endTick": 1920
  }
}

Value Filter

Filter events by specific values:

{
  "valueFilter": {
    "value1": 60,  // e.g., note number
    "value2": 100, // e.g., velocity
    "value3": 0    // e.g., third value if present
  }
}

Error Handling

The server provides detailed error messages for:

  • File not found
  • Invalid MIDI files
  • Out of range track indexes
  • Invalid parameters

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选