MIDI Composition Tools MCP Server

MIDI Composition Tools MCP Server

Enables AI-assisted MIDI music generation and composition through natural language, supporting style, tempo, key, and instrument selection.

Category
Visit Server

README

MIDI Composition Tools

An MCP (Model Context Protocol) toolkit for AI-powered MIDI composition with theory tools, orchestration, and analysis.

What is MCP?

The Model Context Protocol (MCP) is an open source standard created by Anthropic to standardize how AI (LLMs) communicate with external tools and services through a JSON-RPC interface.

Features

  • AI Music Generation: Uses AI models to create musical compositions
  • MIDI Output: Generates standard MIDI files
  • Flexible Configuration: Define style, tempo, duration, and instruments
  • MCP Protocol: Standardized interface compatible with MCP clients

Installation

cd mini-services/mcp-music-generator
bun install

Development

bun run dev

The server will start in stdio (stdin/stdout communication) for integration with MCP clients.

Available Tools

generate_music

Generates an AI music composition and returns it as MIDI.

Parameters:

  • prompt (string): Description of the desired music
  • style (string, optional): Music style (e.g., "classical", "jazz", "electronic", "rock", "ambient")
  • tempo (number, optional): BPM of the music (default: 120)
  • duration (number, optional): Duration in seconds (default: 30)
  • key (string, optional): Key (e.g., "C", "A", "F#m")
  • timeSignature (string, optional): Time signature (default: "4/4")

Returns:

  • midiData (string): Base64 encoded MIDI file
  • midiFile (string): MIDI filename
  • description (string): Description of the generated music

list_instruments

Lists available MIDI instruments (General MIDI).

Returns:

  • instruments (array): List of instruments with ID and name

generate_melody

Generates a melody based on a prompt.

Parameters:

  • prompt (string): Melody description
  • length (number, optional): Number of notes (default: 16)
  • key (string, optional): Key (default: "C")

Returns:

  • notes (array): List of notes with duration and pitch
  • midiData (string): MIDI in base64

MCP Client Integration

Claude Desktop

Add to your Claude Desktop configuration file:

{
  "mcpServers": {
    "music-generator": {
      "command": "bun",
      "args": ["/home/z/my-project/mini-services/mcp-music-generator/src/index.ts"],
      "env": {}
    }
  }
}

Other MCP Clients

The server implements the standard MCP protocol through stdio:

bun run src/index.ts

Usage with AI

When connected to an MCP client, the AI assistant can:

  1. Receive requests like "Create a smooth jazz music"
  2. Use the generate_music tool with appropriate parameters
  3. Receive the generated MIDI file
  4. Explain the created composition

Interaction Example:

User: "Generate a smooth classical music in C major"

AI: Using the generate_music tool:

  • style: "classical"
  • key: "C"
  • tempo: 80
  • duration: 60

Result: MIDI file with a classical composition in C major.

Project Structure

mcp-music-generator/
├── src/
│   ├── index.ts          # MCP server entry point
│   ├── mcp-server.ts     # MCP protocol implementation
│   ├── music-generator.ts # Music generation logic
│   └── midi-writer.ts   # MIDI file generator
├── package.json
├── tsconfig.json
└── README.md

MCP Protocol

The server implements:

  • Initialize: Initial connection setup
  • Tools/List: List of available tools
  • Tools/Call: Tool execution
  • Resources/List: List of available resources
  • Resources/Read: Resource reading
  • Prompts/List: List of available prompts
  • Prompts/Get: Get prompts

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured