FL Studio MCP Server
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-bridge-mcp
重要限制
无法加载插件
FL Studio 脚本 API 不支持加载新的 VST/AU 插件。你只能控制项目中已经加载的插件的参数。
无法创建片段
没有 API 可以通过编程方式创建新片段。你只能处理现有的片段。
要求
FL Studio 20.7+ (MIDI 控制器脚本 API)
Python 3.10+
macOS 或 Windows
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这将:
安装 uv(如果尚未安装)
安装 Python 依赖项
指导你启用虚拟 MIDI 端口(Mac 上的 IAC 驱动程序)
安装 FL Studio MIDI 控制器脚本
安装钢琴卷帘窗脚本 (ComposeWithLLM)
自动配置 Claude Desktop 或 Claude Code
手动安装
1. 安装 Python 依赖项
# Using uv (recommended)
uv sync
# Or using pip
pip install -e .2. 启用虚拟 MIDI 端口
macOS (IAC 驱动程序)
打开 音频 MIDI 设置 (在 Spotlight 中搜索)
按 Cmd+2 或前往 窗口 > 显示 MIDI 工作室
双击 IAC 驱动程序
勾选 “设备在线”
点击 应用
Windows (loopMIDI)
下载并安装 loopMIDI
创建一个虚拟端口(任何名称均可)
在使用 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
重启 FL Studio (如果正在运行)
前往 选项 > MIDI 设置
在 输入 下,找到你的虚拟 MIDI 端口(例如,“IAC Driver Bus 1”)
将 控制器类型 设置为 FLStudioMCP
启用该端口(点击以高亮显示)
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钢琴卷帘窗工作流
打开 FL Studio 并选择一个通道
打开钢琴卷帘窗 (F7 或双击通道)
第一次使用时,手动运行脚本:工具 > 脚本 > ComposeWithLLM
之后,MCP 工具将自动触发该脚本
可用工具
连接
工具 | 描述 |
| 连接/重新连接到 FL Studio |
| 获取连接状态 |
走带
工具 | 描述 |
| 开始/暂停播放 |
| 停止播放 |
| 切换录音 |
| 获取播放/录音状态 |
| 设置播放位置 |
| 获取歌曲时长 |
| 在片段/歌曲模式间切换 |
| 调整播放速度 (0.25x-4x) |
混音器
工具 | 描述 |
| 获取混音器轨道数量 |
| 获取轨道详情 |
| 列出所有轨道 |
| 设置轨道音量 |
| 设置轨道声像 |
| 轨道静音/取消静音 |
| 轨道独奏/取消独奏 |
| 启用轨道录音 |
| 重命名轨道 |
| 设置轨道颜色 |
| 调整立体声宽度 |
通道
工具 | 描述 |
| 获取通道数量 |
| 获取通道详情 |
| 列出所有通道 |
| 获取选定通道 |
| 选择/取消选择通道 |
| 独占选择通道 |
| 触发 MIDI 音符(实时) |
| 设置通道音量 |
| 设置通道声像 |
| 通道静音/取消静音 |
| 通道独奏/取消独奏 |
| 重命名通道 |
| 设置通道颜色 |
| 路由至混音器轨道 |
| 获取步进音序器步骤 |
| 设置步进音序器步骤 |
| 获取完整片段 |
| 设置完整片段 |
插件
工具 | 描述 |
| 检查插件是否存在 |
| 获取插件名称 |
| 获取参数数量 |
| 列出所有参数 |
| 获取参数值 |
| 设置参数值 |
| 获取预设数量 |
| 下一个预设 |
| 上一个预设 |
| 获取插件颜色 |
钢琴卷帘窗
工具 | 描述 |
| 添加音符到钢琴卷帘窗 |
| 添加和弦(同时添加多个音符) |
| 删除特定音符 |
| 清除所有音符 |
| 读取当前钢琴卷帘窗音符 |
| 手动触发 FL Studio 脚本 |
| 获取钢琴卷帘窗系统信息 |
| 取消待处理的队列更改 |
示例工作流
调整混音
"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”
确保 FL Studio 正在运行
检查 MIDI 设置中是否启用了 FLStudioMCP 控制器
在 Mac 上,验证音频 MIDI 设置中是否启用了 IAC 驱动程序
在 Windows 上,验证 loopMIDI 是否正在运行
启用控制器后重启 FL Studio
“等待 FL Studio 响应超时”
确保 FL Studio 处于焦点状态
检查 FL Studio 中的脚本输出窗口 (视图 > 脚本输出)
验证控制器是否正在接收 MIDI(查看 MIDI 设置中的活动)
钢琴卷帘窗脚本未触发
第一次:在 FL Studio 中手动运行 工具 > 脚本 > ComposeWithLLM
在 macOS 上:在提示时授予辅助功能权限
触发时确保 FL Studio 处于焦点状态
尝试手动按 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) │ │
│ └──────────────┘ └──────────────────┘ │
└─────────────────────────────────────────┘工作原理
走带/混音器/通道/插件:
MCP 服务器将命令写入 JSON 文件
向 FL Studio 发送 MIDI 触发音符
FL Studio 控制器脚本读取 JSON,执行 API,写入响应
MCP 服务器读取响应
钢琴卷帘窗:
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]"可用命令
命令 | 描述 |
| 运行 MCP 服务器 |
| 代码库 Lint 检查 |
| Lint 检查并自动修复 |
| 运行测试 |
项目结构
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鸣谢
FL Studio API Stubs - API 文档
FastMCP - MCP 服务器框架
mido - Python 的 MIDI 库
calvinw/fl-studio-mcp - 钢琴卷帘窗集成方法
Image-Line - FL Studio
许可证
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Compose, mix, master and export in Logic Pro, REAPER or Ableton Live by talking to an AI engineer.
Read and edit DAW projects as an agent, save native Logic projects, convert projects between DAWs
Browser DAW for AI assistants: build multitrack songs with MIDI, effects, stems and generation.
Veena is an AI DAW with a personal music producer built in. Make songs in your studio from chat.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI assistants to read and control FL Studio 2025 projects via file-based RPC and MIDI wake, overcoming sandbox restrictions for tempo, mixer, and note recording.1004MIT
- AlicenseCqualityCmaintenanceGives AI assistants full control of FL Studio through its scripting API, enabling project editing, mixing, piano roll composition, MIDI export, and plugin automation without touching the mouse or keyboard.572MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to control a running FL Studio project — transport, mixer routing and levels, channel rack, plugins, patterns, step sequencer, and piano roll — through a virtual MIDI trigger plus JSON command channel, with optional Windows UI automation and offline audio analysis of bounces. Also exposes raw access to the FL scripting API for undo history, markers, and device and project info.MIT
- AlicenseNot gradedqualityCmaintenanceEnables an AI assistant to inspect and control FL Studio transport, tempo, mixer, Channel Rack, patterns, playlist tracks, and plugin/VST parameters, plus stage or export piano-roll notes.MIT