Skip to main content
Glama

FL Studio MCP 服务器

一个 MCP (Model Context Protocol) 服务器,使 AI 助手能够通过 MIDI 通信和钢琴卷帘窗脚本控制 FL Studio。

快速演示

别介意音频质量,因为苹果不允许我录制桌面音频,我不得不通过麦克风进行录制 lol

https://github.com/user-attachments/assets/d4fc668f-9fe5-4ab4-9f18-76cd661029c6

原始音频

如果你想听听更好的音频

https://github.com/user-attachments/assets/c2b1a5e7-1640-41fa-82bc-18ca7cbae9e8

功能

走带控制

  • 播放、暂停、停止播放

  • 切换录音

  • 设置播放位置

  • 获取歌曲长度和位置

  • 控制循环模式(片段/歌曲)

  • 调整播放速度

混音器控制

  • 获取/设置轨道音量和声像

  • 轨道静音/独奏

  • 启用轨道录音

  • 设置轨道名称和颜色

  • 立体声分离度控制

通道机架控制

  • 列出所有通道

  • 获取/设置通道属性(音量、声像、名称、颜色)

  • 通道静音/独奏

  • 将通道路由至混音器轨道

  • 实时触发 MIDI 音符

  • 步进音序器控制(获取/设置网格位)

插件控制

  • 列出插件参数

  • 获取/设置参数值

  • 导航预设(下一个/上一个)

  • 查询插件信息

钢琴卷帘窗控制

  • 添加音符到钢琴卷帘窗,并具有精确的时序

  • 添加和弦,只需一个命令

  • 删除特定音符(按 MIDI 编号和时间)

  • 清除所有音符(从钢琴卷帘窗)

  • 读取钢琴卷帘窗状态以查看所有现有音符

  • 通过按键自动触发(macOS 上为 Cmd+Opt+Y,Windows 上为 Ctrl+Alt+Y)

Related MCP server: FL Studio MCP Server

重要限制

无法加载插件

FL Studio 脚本 API 不支持加载新的 VST/AU 插件。你只能控制项目中已经加载的插件的参数。

无法创建片段

没有 API 可以通过编程方式创建新片段。你只能处理现有的片段。

要求

  • FL Studio 20.7+ (MIDI 控制器脚本 API)

  • Python 3.10+

  • macOSWindows

    • macOS: IAC 驱动程序(内置,需要启用)

    • Windows: loopMIDI

快速安装

最简单的安装方法是使用提供的安装脚本:

# Clone the repository
git clone https://github.com/karl-andres/fl-studio-mcp.git
cd fl-studio-mcp

# Run the one-command installer
./install.sh

这将:

  1. 安装 uv(如果尚未安装)

  2. 安装 Python 依赖项

  3. 指导你启用虚拟 MIDI 端口(Mac 上的 IAC 驱动程序)

  4. 安装 FL Studio MIDI 控制器脚本

  5. 安装钢琴卷帘窗脚本 (ComposeWithLLM)

  6. 自动配置 Claude Desktop 或 Claude Code

手动安装

1. 安装 Python 依赖项

# Using uv (recommended)
uv sync

# Or using pip
pip install -e .

2. 启用虚拟 MIDI 端口

macOS (IAC 驱动程序)

  1. 打开 音频 MIDI 设置 (在 Spotlight 中搜索)

  2. Cmd+2 或前往 窗口 > 显示 MIDI 工作室

  3. 双击 IAC 驱动程序

  4. 勾选 “设备在线”

  5. 点击 应用

Windows (loopMIDI)

  1. 下载并安装 loopMIDI

  2. 创建一个虚拟端口(任何名称均可)

  3. 在使用 FL Studio 时保持 loopMIDI 运行

3. 安装 FL Studio 脚本

将控制器脚本复制到 FL Studio 的 Hardware 文件夹:

# macOS
mkdir -p ~/Documents/Image-Line/FL\ Studio/Settings/Hardware/FLStudioMCP
cp fl_controller/device_FLStudioMCP.py ~/Documents/Image-Line/FL\ Studio/Settings/Hardware/FLStudioMCP/

# Windows
mkdir "%USERPROFILE%\Documents\Image-Line\FL Studio\Settings\Hardware\FLStudioMCP"
copy fl_controller\device_FLStudioMCP.py "%USERPROFILE%\Documents\Image-Line\FL Studio\Settings\Hardware\FLStudioMCP\"

复制钢琴卷帘窗脚本:

# macOS
cp scripts/ComposeWithLLM.pyscript ~/Documents/Image-Line/FL\ Studio/Settings/Piano\ roll\ scripts/

# Windows
copy scripts\ComposeWithLLM.pyscript "%USERPROFILE%\Documents\Image-Line\FL Studio\Settings\Piano roll scripts\"

4. 配置 FL Studio

  1. 重启 FL Studio (如果正在运行)

  2. 前往 选项 > MIDI 设置

  3. 输入 下,找到你的虚拟 MIDI 端口(例如,“IAC Driver Bus 1”)

  4. 控制器类型 设置为 FLStudioMCP

  5. 启用该端口(点击以高亮显示)

5. 配置 Claude

添加到你的 Claude Desktop 配置中(macOS 上为 ~/Library/Application Support/Claude/claude_desktop_config.json):

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

或者对于 Claude Code,添加到你的 MCP 设置中。

使用方法

手动运行服务器

# Using uv
uv run fl-studio-mcp

# Or after installation
fl-studio-mcp

钢琴卷帘窗工作流

  1. 打开 FL Studio 并选择一个通道

  2. 打开钢琴卷帘窗 (F7 或双击通道)

  3. 第一次使用时,手动运行脚本:工具 > 脚本 > ComposeWithLLM

  4. 之后,MCP 工具将自动触发该脚本

可用工具

连接

工具

描述

fl_connect

连接/重新连接到 FL Studio

fl_connection_status

获取连接状态

走带

工具

描述

fl_play

开始/暂停播放

fl_stop

停止播放

fl_record

切换录音

fl_get_transport_status

获取播放/录音状态

fl_set_song_position

设置播放位置

fl_get_song_length

获取歌曲时长

fl_set_loop_mode

在片段/歌曲模式间切换

fl_set_playback_speed

调整播放速度 (0.25x-4x)

混音器

工具

描述

fl_get_mixer_track_count

获取混音器轨道数量

fl_get_mixer_track_info

获取轨道详情

fl_get_all_mixer_tracks

列出所有轨道

fl_set_track_volume

设置轨道音量

fl_set_track_pan

设置轨道声像

fl_mute_track

轨道静音/取消静音

fl_solo_track

轨道独奏/取消独奏

fl_arm_track

启用轨道录音

fl_set_track_name

重命名轨道

fl_set_track_color

设置轨道颜色

fl_set_stereo_separation

调整立体声宽度

通道

工具

描述

fl_get_channel_count

获取通道数量

fl_get_channel_info

获取通道详情

fl_get_all_channels

列出所有通道

fl_get_selected_channel

获取选定通道

fl_select_channel

选择/取消选择通道

fl_select_one_channel

独占选择通道

fl_trigger_note

触发 MIDI 音符(实时)

fl_set_channel_volume

设置通道音量

fl_set_channel_pan

设置通道声像

fl_mute_channel

通道静音/取消静音

fl_solo_channel

通道独奏/取消独奏

fl_set_channel_name

重命名通道

fl_set_channel_color

设置通道颜色

fl_route_channel_to_mixer

路由至混音器轨道

fl_get_grid_bit

获取步进音序器步骤

fl_set_grid_bit

设置步进音序器步骤

fl_get_step_sequence

获取完整片段

fl_set_step_sequence

设置完整片段

插件

工具

描述

fl_is_plugin_valid

检查插件是否存在

fl_get_plugin_name

获取插件名称

fl_get_plugin_param_count

获取参数数量

fl_get_plugin_params

列出所有参数

fl_get_plugin_param_value

获取参数值

fl_set_plugin_param_value

设置参数值

fl_get_preset_count

获取预设数量

fl_next_preset

下一个预设

fl_prev_preset

上一个预设

fl_get_plugin_color

获取插件颜色

钢琴卷帘窗

工具

描述

fl_send_notes

添加音符到钢琴卷帘窗

fl_send_chord

添加和弦(同时添加多个音符)

fl_delete_notes

删除特定音符

fl_clear_piano_roll

清除所有音符

fl_get_piano_roll_state

读取当前钢琴卷帘窗音符

fl_trigger_script

手动触发 FL Studio 脚本

fl_get_piano_roll_info

获取钢琴卷帘窗系统信息

fl_clear_request_queue

取消待处理的队列更改

示例工作流

调整混音

"Set the volume of mixer track 1 to 80% and pan it slightly left"

创建鼓点片段

"Create a basic kick pattern on channel 0 with kicks on steps 0, 4, 8, and 12"

向钢琴卷帘窗添加旋律

"Add a C major arpeggio starting at beat 0: C4, E4, G4, C5 - each note quarter duration"

添加和弦

"Add a C major chord at beat 0, then F major at beat 2, then G major at beat 4"

自动化插件参数

"List the parameters of the plugin on channel 0 and set the filter cutoff to 50%"

故障排除

“未连接到 FL Studio”

  1. 确保 FL Studio 正在运行

  2. 检查 MIDI 设置中是否启用了 FLStudioMCP 控制器

  3. 在 Mac 上,验证音频 MIDI 设置中是否启用了 IAC 驱动程序

  4. 在 Windows 上,验证 loopMIDI 是否正在运行

  5. 启用控制器后重启 FL Studio

“等待 FL Studio 响应超时”

  1. 确保 FL Studio 处于焦点状态

  2. 检查 FL Studio 中的脚本输出窗口 (视图 > 脚本输出)

  3. 验证控制器是否正在接收 MIDI(查看 MIDI 设置中的活动)

钢琴卷帘窗脚本未触发

  1. 第一次:在 FL Studio 中手动运行 工具 > 脚本 > ComposeWithLLM

  2. 在 macOS 上:在提示时授予辅助功能权限

  3. 触发时确保 FL Studio 处于焦点状态

  4. 尝试手动按 Cmd+Opt+Y (macOS) 或 Ctrl+Alt+Y (Windows)

没有可用的 MIDI 端口

  • macOS: 在音频 MIDI 设置中启用 IAC 驱动程序

  • Windows: 安装并运行 loopMIDI

架构

此 MCP 服务器使用混合方法:

┌─────────────────┐     ┌─────────────────────────────────────────┐
│   MCP Client    │────▶│           FastMCP Server                │
│  (Claude, etc)  │     │                                         │
└─────────────────┘     │  ┌─────────────────┐  ┌──────────────┐  │
                        │  │ MIDI + JSON     │  │ Piano Roll   │  │
                        │  │ Tools           │  │ Tools (JSON) │  │
                        │  └────────┬────────┘  └──────┬───────┘  │
                        └───────────┼──────────────────┼──────────┘
                                    │                  │
                               MIDI + JSON        JSON Files +
                                    │              Keystroke
                                    ▼                  ▼
                        ┌─────────────────────────────────────────┐
                        │              FL Studio                   │
                        │  ┌──────────────┐  ┌──────────────────┐ │
                        │  │FLStudioMCP   │  │ Piano Roll Script│ │
                        │  │(MIDI Ctrl)   │  │ (ComposeWithLLM) │ │
                        │  └──────────────┘  └──────────────────┘ │
                        └─────────────────────────────────────────┘

工作原理

  1. 走带/混音器/通道/插件

    • MCP 服务器将命令写入 JSON 文件

    • 向 FL Studio 发送 MIDI 触发音符

    • FL Studio 控制器脚本读取 JSON,执行 API,写入响应

    • MCP 服务器读取响应

  2. 钢琴卷帘窗

    • MCP 服务器将音符请求写入 JSON 文件

    • 发送按键 (Cmd+Opt+Y) 以触发 FL Studio 脚本

    • 钢琴卷帘窗脚本读取 JSON 并修改音符

开发

先决条件

  • Python 3.10+

  • uv (推荐)

设置

# Install all dependencies including dev extras
uv sync --dev

# Or with pip
pip install -e ".[dev]"

可用命令

命令

描述

uv run fl-studio-mcp

运行 MCP 服务器

uv run ruff check .

代码库 Lint 检查

uv run ruff check --fix .

Lint 检查并自动修复

uv run pytest

运行测试

项目结构

fl-studio-mcp/
├── fl_controller/
│   └── device_FLStudioMCP.py   # FL Studio MIDI controller script (runs inside FL Studio)
├── scripts/
│   ├── setup.sh                 # FL Studio script installer
│   ├── install_mcp_for_claude.sh # Claude config installer
│   └── ComposeWithLLM.pyscript  # Piano Roll script (runs inside FL Studio)
├── src/fl_studio_mcp/
│   ├── server.py                # FastMCP server entry point
│   ├── tools/                   # MCP tool implementations
│   │   ├── channels.py
│   │   ├── mixer.py
│   │   ├── piano_roll.py
│   │   ├── plugins.py
│   │   └── transport.py
│   └── utils/
│       ├── connection.py        # FL Studio connection wrapper
│       ├── fl_trigger.py        # Piano roll keystroke trigger
│       └── midi_connection.py   # MIDI + JSON communication layer
└── install.sh                   # One-command installer

鸣谢

许可证

MIT

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

No tool schema history has been recorded yet.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that connects AI assistants to FL Studio for music production via Virtual MIDI. It enables users to control transport, manage the mixer, write notes, and manipulate plugin parameters through natural language.
    1
    MIT
  • 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
    A
    quality
    C
    maintenance
    AI control for FL Studio via the Model Context Protocol — full in-DAW mixing (Mix Doctor diagnosis, gain staging, EQ/compression/reverb, reference matching), routing, and composition through Claude and any MCP client. 67 tools. Windows.
    67
    34
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/karl-andres/fl-studio-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server