Skip to main content
Glama
fl-studio-mcp

fl-studio-mcp

by Arnau10a

fl-studio-mcp

CI Python 3.10+ License: MIT

A bidirectional Model Context Protocol (MCP) server for controlling FL Studio from AI assistants. It combines a custom chunked MIDI SysEx RPC bridge inside FL Studio's sandboxed Python runtime, Win32 GUI automation for actions outside the official scripting API, Hard Techno MIDI/WAV synthesis, DSP audio analysis, and an in-memory FL Studio simulator (FL_MCP_MOCK=1) for cross-platform testing without a live DAW.


Architecture

┌──────────────────┐   stdio (MCP)   ┌──────────────────────────────────┐
│  AI / MCP Client │ ◄─────────────► │       fl_studio_mcp.server       │
└──────────────────┘  Tools (29)     │  • 29 Tools, 4 Resources, 2 Prompts
                      Resources (4)  └───────────┬────────────┬─────────┘
                      Prompts (2)                │            │
                                  Live Mode      │            │ FL_MCP_MOCK=1
                         ┌───────────────────────┘            ▼
                         │                          ┌──────────────────┐
              SysEx JSON │  Win32 SendInput         │  MockFLRuntime   │
              (FLBridge) │  (win_auto)              │ (loads real      │
                         ▼                          │  device script)  │
         ┌──────────────────────────────┐           └──────────────────┘
         │   loopMIDI Virtual Ports     │
         │  • FL_MCP_IN  (PC -> FL)     │
         │  • FL_MCP_OUT (FL -> PC)     │
         └──────────────┬───────────────┘
                        ▼
         ┌──────────────────────────────┐
         │  FL Studio MIDI Controller   │
         │  fl_script/device_FLStudioMCP│
         └──────────────────────────────┘

For protocol framing details, Win32 fallback boundaries, and design trade-offs, see docs/ARCHITECTURE.md.


Related MCP server: FL Studio MCP Server

Quick Try Without FL Studio (FL_MCP_MOCK=1)

Anyone can run and test the entire MCP server (including real SysEx chunking/reassembly against device_FLStudioMCP.py) on Windows, macOS, or Linux without FL Studio or loopMIDI:

git clone https://github.com/Arnau10a/fl-studio-mcp.git
cd fl-studio-mcp
uv sync

Run the full test suite, linter, and static type checker:

uv run ruff check .
uv run mypy src
uv run pytest -v

Or point your MCP client to the server with FL_MCP_MOCK=1:

{
  "mcpServers": {
    "fl-studio": {
      "command": "uv",
      "args": ["--directory", "/path/to/fl-studio-mcp", "run", "fl-studio-mcp"],
      "env": { "FL_MCP_MOCK": "1" }
    }
  }
}

Demo

fl-studio-mcp demo

Run the self-contained mock session from the demo yourself (no FL Studio required):

uv run python examples/demo_session.py

MCP Capabilities

Tools (32)

Category

Tools

Diagnostics & Transport

fl_doctor, fl_list_midi_ports, fl_ping, fl_transport, fl_undo

Channel Rack & Step Sequencer

fl_channels_list, fl_channel_set (with #RRGGBB color), fl_step_sequencer, fl_step_sequencer_get, fl_channel_editor, fl_midi_note

Piano Roll Scripting

fl_piano_roll_notes, fl_piano_roll_state, fl_piano_roll_clear

Patterns & Playlist

fl_patterns, fl_playlist_list, fl_playlist_set

Mixer, EQ & Plugins

fl_mixer_list, fl_mixer_set (color, stereo separation, arming), fl_mixer_eq, fl_plugin_params, fl_plugin_set

Win32 GUI & Sample Browser

fl_ui_focus, fl_add_plugin, fl_search_samples, fl_load_sample, fl_import_midi, fl_new_project, fl_delete_channel

Hard Techno DSP & Feedback

ht_generate_midi, ht_generate_kick_sample, fl_analyze_audio

Resources (4)

  • fl://session/state — Live BPM, transport state, active pattern, channel & mixer counts

  • fl://channels/rack — Full Channel Rack snapshot (names, plugins, volumes, pans, routing)

  • fl://mixer/tracks — Mixer tracks overview (volumes, peaks, mute/solo, loaded FX)

  • fl://samples/output — Inventory of generated .mid and .wav files in output/

Prompts (2)

  • hard_techno_drop — End-to-end Hard Techno drop workflow with DSP verification

  • mix_gain_staging — Gain-staging and low-end EQ audit workflow


Live FL Studio Setup (Windows)

1. Create Virtual MIDI Ports (loopMIDI)

Install and open loopMIDI, then create two virtual ports:

  • FL_MCP_IN

  • FL_MCP_OUT

(Override port names anytime via FL_MCP_IN_PORT and FL_MCP_OUT_PORT.)

2. Install Dependencies & FL Studio Scripts

One-command PowerShell installer (installs uv if needed, dependencies, Hardware + Piano Roll scripts, and runs fl-studio-mcp-doctor):

.\install.ps1

Or manually:

uv sync
uv run python scripts/install_fl_script.py

This copies fl_script/device_FLStudioMCP.py into ~/Documents/Image-Line/FL Studio/Settings/Hardware/FLStudioMCP/ and fl_script/FLStudioMCP_PianoRoll.pyscript into ~/Documents/Image-Line/FL Studio/Settings/Piano roll scripts/.

3. Configure FL Studio MIDI Settings

In FL Studio (Options -> MIDI Settings):

  1. Under Output, select FL_MCP_OUT and assign a Port number (e.g. 10).

  2. Under Input, select FL_MCP_IN:

    • Toggle Enable ON.

    • Set Controller type to FLStudioMCP.

    • Set Port to the same Port number (10).

4. Verify Connection with fl-studio-mcp-doctor

uv run fl-studio-mcp-doctor

Checks Python environment, controller script SHA-256 parity, loopMIDI ports, FL Studio window detection, and live SysEx ping latency.

5. Register the MCP Server

{
  "mcpServers": {
    "fl-studio": {
      "command": "C:\\path\\to\\fl-studio-mcp\\.venv\\Scripts\\python.exe",
      "args": [
        "C:\\path\\to\\fl-studio-mcp\\server.py"
      ]
    }
  }
}

(Both server.py at the repo root and the installed fl-studio-mcp script entrypoint are supported.)


Project Structure

fl-studio-mcp/
├── src/fl_studio_mcp/
│   ├── server.py              # MCP server (29 tools, 4 resources, 2 prompts)
│   ├── bridge.py              # Thread-safe bidirectional SysEx RPC client
│   ├── simulator.py           # In-memory FL Studio runtime (FL_MCP_MOCK=1)
│   ├── win_auto.py            # Win32 SendInput GUI automation & sample search
│   ├── hard_techno.py         # Vectorized kick/rumble WAV & MIDI synthesis
│   ├── audio_analysis.py      # WAV peak/RMS/clipping & FFT spectral analyzer
│   ├── doctor.py              # Setup & connectivity diagnostics CLI
│   └── paths.py               # Centralized path resolution
├── fl_script/
│   └── device_FLStudioMCP.py  # FL Studio MIDI Controller script (OnSysEx RPC)
├── scripts/
│   └── install_fl_script.py   # Installer for FL Studio Hardware folder
├── examples/
│   └── uptempo_190bpm.py      # Standalone 48-bar 190 BPM MIDI + WAV generator
├── docs/
│   └── ARCHITECTURE.md        # Protocol spec & engineering trade-offs
├── tests/                     # E2E protocol, MCP, DSP & doctor pytest suite
├── server.py                  # Backward-compatible root launcher shim
├── pyproject.toml
├── uv.lock
└── LICENSE

License

MIT

Available Tools

32 tools
fl_add_pluginA

Load a generator or effect plugin in FL Studio via the Plugin Picker (F8).

target='channel' adds an instrument to the Channel Rack (e.g. 'Serum 2', 'Kepler Exo').
target='mixer' adds an FX plugin to the specified mixer_track (e.g. 'Fruity Reeverb 2').

Inputs: name (required), target, mixer_track. Returns: object

fl_analyze_audioB

Analyze a WAV file for peak dBFS, RMS, crest factor, clipping, and spectral band balance.

Inputs: path (required). Returns: object

fl_channel_editorB

Show or hide a Channel's plugin/settings window in FL Studio.

Inputs: index (required), open. Returns: object

fl_channel_setC

Update a Channel Rack channel's name, volume, pan, #RRGGBB color, mute/solo, or routing.

Inputs: index (required), pan, name, solo, +5 more. Returns: object

fl_channels_listA

List Channel Rack channels with plugin, volume, pan, mute/solo, and mixer track.

Inputs: no named parameters. Returns: object

fl_delete_channelC

Delete a single Channel Rack channel by index using Alt+Delete.

Inputs: index (required). Returns: object

fl_doctorA

Run diagnostics on FL Studio controller script parity, MIDI ports, and SysEx ping.

Inputs: no named parameters. Returns: object

fl_import_midiC

Import a .mid file into a Channel's Piano Roll using Import MIDI (Ctrl+M).

Inputs: index (required), midi_path (required). Returns: object

fl_list_midi_portsA

List available Windows MIDI input and output ports (useful to verify loopMIDI setup).

Inputs: no named parameters. Returns: object

fl_load_sampleC

Find a sample in FL Studio's Packs library and load it into the Channel Rack.

Inputs: query (required), category, replace_selected. Returns: object

fl_midi_noteC

Trigger a live MIDI note on a Channel (velocity=0 sends note-off; optional duration).

Inputs: note (required), index (required), duration, velocity. Returns: object

fl_mixer_eqB

Adjust a Mixer track's 3-band EQ (band: 0=Low, 1=Mid, 2=High; gain: -1..1, freq/bw: 0..1).

Inputs: band (required), index (required), gain, bandwidth, +1 more. Returns: object

fl_mixer_listB

List Mixer tracks with peak levels, volumes, mute/solo state, and loaded FX plugins.

Inputs: end, start. Returns: object

fl_mixer_setB

Update a Mixer track's name, volume, pan, stereo separation, color, mute/solo/arm, or bus.

Inputs: index (required), pan, name, solo, +7 more. Returns: object

fl_new_projectB

Start a new project in FL Studio (Ctrl+N), optionally dismissing unsaved-changes prompts.

Inputs: discard_unsaved. Returns: object

fl_patternsC

List, select, rename, or create patterns in FL Studio.

Inputs: action (required), name, index. Returns: object

fl_piano_roll_clearC

Clear all notes from a channel's Piano Roll.

Inputs: index (required). Returns: object

fl_piano_roll_notesC

Add notes directly to a channel's Piano Roll (each note: number, time, length, velocity).

Times and lengths are in FL Studio ticks (96 PPQ default, 24 = 16th note, 96 = quarter note).

Inputs: index (required), notes (required), clear_first. Returns: object

fl_piano_roll_stateC

Read all existing notes from a channel's Piano Roll.

Inputs: index (required). Returns: object

fl_pingA

Check connection to FL Studio and get current BPM, transport state, pattern, and counts.

Inputs: no named parameters. Returns: object

fl_playlist_listB

List Playlist tracks (1-based index) with name, mute, and solo state.

Inputs: end, start. Returns: object

fl_playlist_setC

Update a Playlist track's name, mute, or solo state (1-based index).

Inputs: index (required), name, solo, muted. Returns: object

fl_plugin_paramsB

List parameters of a Channel plugin (slot=-1) or Mixer FX plugin (slot=0..9).

Inputs: index (required), slot, limit, offset. Returns: object

fl_plugin_setB

Set a plugin parameter (0.0..1.0) or switch presets on a Channel or Mixer FX plugin.

Inputs: index (required), slot, value, action, +1 more. Returns: object

fl_search_samplesB

Search FL Studio's Packs library (Drums, Loops, Risers, etc.) and output/ for samples.

Inputs: query (required), limit, category. Returns: object

fl_step_sequencerB

Program the Step Sequencer grid for a channel.

With mode='indices', pass active step numbers (e.g. [0, 4, 8, 12] for a 4x4 kick).
With mode='bits', pass a list of 0/1 values for each step.

Inputs: index (required), steps (required), mode, length, +1 more. Returns: object

fl_step_sequencer_getB

Read the current Step Sequencer grid for a channel without modifying it.

Inputs: index (required), length. Returns: object

fl_transportB

Control FL Studio transport (play, stop, pause, record, loop mode, BPM, song position).

Inputs: action (required), bpm, mode, position. Returns: object

fl_ui_focusB

Focus a window in FL Studio (and optionally select a Mixer track).

Inputs: window (required), mixer_track. Returns: object

fl_undoB

Undo ('up') or redo ('down') the last action in FL Studio.

Inputs: direction. Returns: object

ht_generate_kick_sampleB

Synthesize a 1-bar distorted Hard Techno kick (+ optional rumble) WAV synced to BPM.

Inputs: bpm, drive, filename, sub_freq, +1 more. Returns: object

ht_generate_midiC

Generate a Hard Techno MIDI file (.mid) ready to drop into FL Studio's Piano Roll.

Inputs: style (required), bpm, bars, seed, +3 more. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3/5.0

    Scored across 32 tools

    Disambiguation4/5

    Most tools target clear resource/action pairs, but a few boundaries are fuzzy: step sequencer vs. piano-roll note programming, add_plugin vs. load_sample, and search_samples vs. load_sample. Diagnostic tools like fl_doctor, fl_ping, and fl_list_midi_ports also slightly overlap in purpose but remain distinguishable.

    Naming Consistency3/5

    All names use snake_case with fl_ or ht_ prefixes, which is readable and domain-oriented, but conventions vary between entity_action (fl_channels_list, fl_mixer_set), verb_noun (fl_add_plugin, fl_delete_channel), and bare nouns (fl_patterns, fl_transport). The ht_ prefix for the Hard Techno helpers is defensible but adds a second namespace.

    Tool Count2/5

    At 32 tools, the surface is quite heavy for a single MCP server, even for a broad DAW like FL Studio. Several specialized helpers, especially the Hard Techno generation and audio-analysis tools, extend beyond the core control surface and contribute to the high count.

    Completeness4/5

    The set covers a broad lifecycle: transport, channels, mixer, plugins, patterns, playlist, piano roll, MIDI, samples, diagnostics, and project creation. Notable gaps remain around saving/exporting/rendering projects and automation or arrangement-level operations, but most core editing workflows are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables AI assistants to control FL Studio on Windows through a local MCP server without cloud dependencies. Bridges MCP clients to FL Studio's Python scripting environment via file-based IPC for project management, transport control, and UI workflow automation.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables an AI agent to drive FL Studio 2025 through the DAW's own state rather than screenshots: reading project, mixer and plugin state, measuring and diagnosing the mix, moving faders, applying effects, and writing notes into the piano roll via natural language. Changes can be previewed with dry runs, snapshotted and rolled back so edits stay verifiable and safe.
      MIT