DAW MIDI Generator MCP

DAW MIDI Generator MCP

Enables Claude AI to generate professional, production-ready MIDI files (chord progressions, drum patterns, bass lines, melodies, and full arrangements) compatible with any DAW including Logic Pro, Ableton Live, FL Studio, and more.

Category
Visit Server

README

DAW MIDI Generator MCP 🎡

An MCP (Model Context Protocol) server that enables Claude AI to generate professional MIDI files for any DAW.

License: MIT Python 3.10+


🎹 What It Does

This MCP server gives Claude the ability to generate complete, production-ready MIDI files:

  • Chord Progressions - Any key, any progression (I-V-vi-IV, ii-V-I, custom)
  • Drum Patterns - House, Techno, Trap with precise General MIDI mapping
  • Bass Lines - Steady, Syncopated, Walking patterns
  • Melodies - Major, Minor, Pentatonic scales
  • Full Arrangements - Chords + Drums + Bass in one command

All files are standard MIDI 1.0 compatible with every DAW.


βœ… Compatible DAWs

  • Logic Pro X
  • Ableton Live
  • FL Studio
  • Cubase
  • Pro Tools
  • Reaper
  • Bitwig Studio
  • Studio One
  • GarageBand
  • Any MIDI-compatible software

πŸ“‹ Requirements

  • macOS (tested on Sequoia 15.7.2+) or Linux
  • Python 3.10+
  • Claude Desktop (download here)
  • Any DAW that supports MIDI import

πŸš€ Installation

Step 1: Clone the Repository

git clone https://github.com/s2d01/daw-midi-generator-mcp.git
cd daw-midi-generator-mcp

Step 2: Install Python Dependencies

pip3 install -r requirements.txt

This installs:

  • mcp - Model Context Protocol library
  • mido - MIDI file generation library

Step 3: Get the Absolute Path

pwd

Copy the output (e.g., /Users/yourname/daw-midi-generator-mcp)

Step 4: Configure Claude Desktop

Open Claude Desktop's configuration file:

macOS:

nano ~/Library/Application\ Support/Claude/claude_desktop_config.json

Linux:

nano ~/.config/Claude/claude_desktop_config.json

Add this configuration (replace YOUR_USERNAME with your actual username):

{
  "mcpServers": {
    "daw-midi": {
      "command": "python3",
      "args": ["/Users/YOUR_USERNAME/daw-midi-generator-mcp/midi_generator_server.py"]
    }
  }
}

⚠️ CRITICAL: Use the absolute path from Step 3. Relative paths don't work.

Save the file:

  • In nano: Ctrl+O, Enter, Ctrl+X

Step 5: Restart Claude Desktop

Completely quit Claude Desktop:

  • macOS: Cmd+Q
  • Linux: Close the application

Wait 3 seconds, then reopen Claude Desktop.

Step 6: Verify Installation

Open Claude Desktop and type:

Create a chord progression in C major

Claude should generate a MIDI file and show you the path.


πŸ“‚ Project Structure

daw-midi-generator-mcp/
β”œβ”€β”€ README.md                    # This file
β”œβ”€β”€ midi_generator_server.py     # MCP server (runs automatically)
β”œβ”€β”€ requirements.txt             # Python dependencies
β”œβ”€β”€ LICENSE                      # MIT License
└── .gitignore                  # Git ignore rules

Output Directory

MIDI files are saved to:

~/Music/DAW/Claude_MIDI/

This directory is created automatically the first time the server runs. You don't need to create it manually.


🎼 How It Works

The Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   You ask       β”‚
β”‚   Claude        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Claude Desktop        β”‚
β”‚   (MCP Client)          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚ JSON-RPC over stdio
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   midi_generator_server.py  β”‚
β”‚   (MCP Server - Python)     β”‚
β”‚                             β”‚
β”‚   β€’ Receives tool calls     β”‚
β”‚   β€’ Generates MIDI events   β”‚
β”‚   β€’ Creates .mid files      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚
         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   ~/Music/DAW/          β”‚
β”‚   Claude_MIDI/          β”‚
β”‚   β€’ chords_*.mid        β”‚
β”‚   β€’ drums_*.mid         β”‚
β”‚   β€’ bass_*.mid          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Step-by-Step Example

1. You ask Claude:

Generate a house drum pattern at 128 BPM

2. Claude calls the MCP server:

{
  "method": "tools/call",
  "params": {
    "name": "generate_drum_pattern",
    "arguments": {
      "pattern_type": "house",
      "tempo": 128,
      "bars": 4
    }
  }
}

3. The Python server executes:

def create_drum_pattern_midi(pattern_type="house", tempo=128, bars=4):
    # Create MIDI file
    mid = MidiFile()
    track = MidiTrack()
    
    # Add tempo and time signature
    track.append(MetaMessage('set_tempo', tempo=...))
    
    # Generate drum events
    # Kick (MIDI 36) on beats 1, 2, 3, 4
    # Snare (MIDI 38) on beats 2, 4
    # Hi-hat (MIDI 42) on eighth notes
    
    # Save to ~/Music/DAW/Claude_MIDI/drums_house_20241130_154523.mid
    return filepath

4. Claude responds:

πŸ₯ Drum pattern created!

πŸ“ File: /Users/yourname/Music/DAW/Claude_MIDI/drums_house_20241130_154523.mid
🎢 Style: house
⏱️ Tempo: 128 BPM
πŸ“ Bars: 4

πŸ’‘ Import into your DAW and assign to a drum kit!

5. You import the file into your DAW

When Does the Server Run?

The server runs automatically in the background:

  • Starts: When you open Claude Desktop
  • Runs: While Claude Desktop is open
  • Stops: When you quit Claude Desktop

You never run it manually. Claude Desktop handles everything.

The Five Tools

The server exposes 5 tools to Claude:

Tool Name What It Does Parameters
generate_chord_progression Creates chord MIDI files key, progression, tempo, bars
generate_drum_pattern Creates drum patterns pattern_type (house/techno/trap), tempo, bars
generate_bass_line Creates bass lines key, pattern (steady/syncopated/walking), tempo, bars
generate_melody Creates melodies scale (major/minor/pentatonic), key, tempo, bars
create_full_arrangement Creates all 3 above key, genre, tempo, bars

πŸ’¬ Usage Examples

Chord Progressions

Create a chord progression in D minor
Generate a I-V-vi-IV progression in G major at 140 BPM
Make me 8 bars of C - F - Am - G chords
Create a jazz progression in Bb major

Output: Single MIDI file with chord voicings

Drum Patterns

Generate a house pattern at 128 BPM
Create 16 bars of techno drums at 135 BPM
Make me a trap beat
Generate a 4-bar house groove

Styles:

  • house - Four-on-floor kick, snare on 2-4, hi-hats on eighths
  • techno - Driving kick pattern, tight hi-hats, occasional open hats
  • trap - Syncopated kicks, 16th note hi-hats, hard snares

Bass Lines

Create a steady bass in A minor
Generate a syncopated bass in C at 125 BPM
Make me 8 bars of walking bass in F
Create a bass line in E minor

Patterns:

  • steady - Root notes on every beat (4/4 time)
  • syncopated - Off-beat grooves with rests
  • walking - Jazz-style ascending/descending patterns

Melodies

Generate a pentatonic melody in A minor
Create a melody in C major scale
Make me a lead line in E minor
Generate an 8-bar melody

Scales:

  • major - Happy, bright melodies
  • minor - Sad, dark melodies
  • pentatonic - Simple, catchy melodies (great for leads)

Full Arrangements

Create a complete house arrangement in C major at 128 BPM
Generate a techno base in A minor at 135 BPM
Make me 16 bars of trap in G major at 140 BPM
Create a full track arrangement

Output: 3 MIDI files (chords + drums + bass)


πŸ“₯ Importing into Your DAW

Logic Pro X / GarageBand

  1. File β†’ Import β†’ MIDI File
  2. Navigate to ~/Music/DAW/Claude_MIDI/
  3. Select one or more MIDI files
  4. Click Open

Or drag & drop files directly into the timeline.

Ableton Live

  1. Drag MIDI files from Finder into Session or Arrangement View
  2. Ableton automatically creates a new track
  3. Assign an instrument

FL Studio

  1. File β†’ Import β†’ MIDI file
  2. Navigate to ~/Music/DAW/Claude_MIDI/
  3. Select file and import

Cubase / Pro Tools / Reaper / Bitwig

Drag & drop MIDI files into the timeline.


πŸ”§ Technical Details

MIDI Specification

  • Format: MIDI 1.0 standard
  • Timing: 480 PPQ (pulses per quarter note)
  • Drums: General MIDI Channel 10 mapping
    • Kick: MIDI 36
    • Snare: MIDI 38
    • Closed Hi-hat: MIDI 42
    • Open Hi-hat: MIDI 46
  • Velocity: Dynamic (50-100)
  • Time Signature: 4/4 (currently)

Python Architecture

Main Components:

# MIDI Utilities
note_to_midi()        # Convert "C4" β†’ MIDI 60
get_chord_notes()     # Generate chord voicings

# MIDI Generators
create_chord_progression_midi()  # Chords
create_drum_pattern_midi()       # Drums
create_bass_line_midi()          # Bass
create_melody_midi()             # Melodies

# MCP Protocol Handlers
@app.list_tools()     # Exposes tools to Claude
@app.call_tool()      # Executes tool calls

Key Libraries:

  • mido - MIDI file creation and manipulation
  • mcp - Model Context Protocol server implementation
  • asyncio - Asynchronous I/O for MCP communication

πŸ› Troubleshooting

Server Won't Start

Error: ModuleNotFoundError: No module named 'mcp'

Solution:

pip3 install --upgrade mcp mido

Claude Doesn't See the Server

Problem: Claude says "I don't have access to that tool"

Solutions:

  1. Check the config path is absolute:
cat ~/Library/Application\ Support/Claude/claude_desktop_config.json

Should show: /Users/yourname/daw-midi-generator-mcp/midi_generator_server.py

Not: ~/daw-midi-generator-mcp/... ❌

  1. Check the logs:
tail -f ~/Library/Logs/Claude/mcp*.log

Look for:

[daw-midi] [info] Server started and connected successfully
  1. Completely restart Claude Desktop:
  • Cmd+Q (not just close window)
  • Wait 5 seconds
  • Reopen

Test the Server Manually

cd ~/daw-midi-generator-mcp
python3 midi_generator_server.py

Should output:

🎡 DAW MIDI Generator - MCP Server started!
πŸ“ MIDI files will be saved to: /Users/yourname/Music/DAW/Claude_MIDI

Press Ctrl+C to stop.

MIDI Files Are Empty or Don't Play

Check:

  • βœ… Assigned an instrument to the track
  • βœ… Track volume is not zero
  • βœ… Track is not muted
  • βœ… Using the correct MIDI channel (drums = channel 10)

Output Directory Not Created

The directory ~/Music/DAW/Claude_MIDI/ is created automatically by this line:

MIDI_OUTPUT_DIR.mkdir(parents=True, exist_ok=True)

If it doesn't exist:

  • The server hasn't run yet
  • Check file permissions on ~/Music/

πŸ› οΈ Customization

Change Output Directory

Edit midi_generator_server.py:

# Line ~25
MIDI_OUTPUT_DIR = Path.home() / "Music" / "YOUR_FOLDER" / "MIDI"

Add New Drum Patterns

Edit the patterns dict in create_drum_pattern_midi():

patterns = {
    "house": [...],
    "techno": [...],
    "trap": [...],
    "your_style": [...]  # Add here
}

Add New Scales

Edit the scales dict in create_melody_midi():

scales = {
    "major": [0, 2, 4, 5, 7, 9, 11, 12],
    "minor": [0, 2, 3, 5, 7, 8, 10, 12],
    "pentatonic": [0, 2, 4, 7, 9, 12],
    "blues": [0, 3, 5, 6, 7, 10, 12],  # Add here
}

Add New Tools

  1. Create a new generator function
  2. Register it in @app.list_tools()
  3. Handle it in @app.call_tool()

After any changes: Restart Claude Desktop


πŸ—ΊοΈ Roadmap

  • [ ] Support for alternate time signatures (3/4, 6/8, 7/8)
  • [ ] More drum patterns (breakbeat, dnb, funk)
  • [ ] Advanced chord voicings (9th, 11th, 13th)
  • [ ] Arpeggiators
  • [ ] Swing/groove quantization
  • [ ] MusicXML export
  • [ ] Integration with AI music generation models

🀝 Contributing

Pull requests are welcome! For major changes, please open an issue first.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Ideas for contributions:

  • More drum patterns
  • Additional scales and modes
  • Chord voicing variations
  • Time signature support
  • Humanization/randomization
  • MIDI effects (swing, velocity curves)

πŸ“„ License

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


πŸ‘€ Author

S2D01


πŸ™ Acknowledgments

  • Built with Anthropic's Claude and Model Context Protocol
  • MIDI handling powered by mido
  • Inspired by the need for AI-assisted music production

⭐ Support

If you find this project useful:

  • ⭐ Star this repository
  • πŸ› Report bugs in Issues
  • πŸ’‘ Suggest features in Issues
  • πŸ”§ Contribute code via Pull Requests

🎡 Happy music making!

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
Qdrant Server

Qdrant Server

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

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
E2B

E2B

Using MCP to run code via e2b.

Official
Featured