Ableton Live MCP
   
MCP服务器Ableton Live,让AI代理控制或检查Ableton。
快速开始
1.安装远程脚本
下载 ableton/__init__.py 并将其放置在名为的新文件夹中 AbletonLiveMCP 在Ableton的MIDI远程脚本目录中:
- 窗户:
C:\ProgramData\Ableton\Live XX\Resources\MIDI Remote Scripts\AbletonLiveMCP\ - macOS: 右键单击Ableton Live→ 显示包装内容→
Contents/App-Resources/MIDI Remote Scripts/AbletonLiveMCP/
然后在Ableton中启用它: 设置→ 链接、节奏和MIDI→ 控制面→ AbletonLiveMCP (输入/输出:无)。
2.连接克劳德
首先,安装 紫外线 (包括 uvx)如果你还没有:
| 平台 | 命令 |
|---|---|
| macOS | brew install uv |
| 视窗 | winget install astral-sh.uv |
Alternative install methods
# macOS/Linux — standalone installer
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows — PowerShell standalone installer
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"然后连接克劳德:
克劳德代码:
claude mcp add --scope user AbletonLiveMCP -- uvx ableton-live-mcp克劳德桌面版 --编辑配置文件(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上, %APPDATA%\Claude\claude_desktop_config.json 在Windows上):
{
"mcpServers": {
"AbletonLiveMCP": {
"command": "uvx",
"args": ["ableton-live-mcp"]
}
}
}3.去吧
确保Ableton在AbletonLiveMCP控制界面处于活动状态的情况下运行,然后启动(或重新启动)Claude并要求它在Ableton中执行某些操作。
运作原理
Claude → MCP Server → TCP :16619 → Remote Script (inside Ableton)
↓
exec(python_code)
↓
Live Object Model
(song, tracks, clips, devices, browser...)MCP服务器和远程脚本通过TCP端口16619通信。远程脚本在Ableton的嵌入式Python解释器中运行——Claude将Python代码作为字符串发送,即远程脚本 exec()将其与作用域中的完整Live API一起使用,并返回序列化的结果。没有预定义的命令-Live API支持的任何内容都可以立即使用。
克劳德能做什么
# Read session state
song.tempo # → 120.0
[(i, t.name) for i, t in enumerate(song.tracks)] # → [(0, "Bass"), (1, "Drums"), ...]
# Modify session
song.tempo = 140
song.tracks[0].name = "Lead Synth"
# Create tracks and clips
song.create_midi_track(-1)
song.tracks[-1].clip_slots[0].create_clip(4.0)
# Write MIDI notes (MidiNoteSpecification is in scope, no import needed)
clip = song.tracks[0].clip_slots[0].clip
clip.add_new_notes(tuple([
MidiNoteSpecification(pitch=60, start_time=0.0, duration=0.5, velocity=100),
MidiNoteSpecification(pitch=64, start_time=1.0, duration=0.5, velocity=90),
]))
# Find and load instruments (find_item, find_items, find_track, load_to are in scope)
load_to(song.tracks[0], browser.instruments, "Grand Piano")
load_to(find_track("Drums"), browser.drums, "808")
# Control transport
song.start_playing()
song.stop_playing()
song.tracks[0].clip_slots[0].fire()
# Mix
find_track("Bass").mixer_device.volume.value = 0.7
song.tracks[0].mixer_device.panning.value = -0.3MCP工具
服务器公开了三个工具:
| 工具 | 目的 |
|---|---|
execute(code) | 将Python代码发送到Ableton内部运行。主要工具。 |
api(class_name?) | 按类别浏览Live API参考(歌曲、音轨、剪辑、设备等)。 |
search_api(query) | 在所有类中按关键字搜索API引用。 |
api 和 search_api 从结构化API引用中读取。Claude可以执行Live API支持的任何内容,而不仅仅是引用中的内容。
执行范围
每 execute call获取一个新的命名空间,其中包含:
| 变量 | 它是什么 |
|---|---|
song | 现场布景——节奏、曲目、场景、交通 |
app | 实时应用程序——浏览器、版本信息 |
tracks | 快捷方式 song.tracks (创建/删除后过时--使用 song.tracks 或 find_track) |
returns | song.return_tracks |
master | song.master_track |
browser | app.browser --乐器、效果、鼓、声音 |
Live | The Live 模块-- Live.Clip, Live.Device等等。 |
MidiNoteSpecification | Live.Clip.MidiNoteSpecification --无需导入 |
find_item(parent, query) | 在浏览器树中搜索最佳匹配。返回BrowserItem或无 |
find_items(parent, query) | 搜索浏览器树,返回排名的匹配列表 |
find_track(name) | 按名称查找曲目。退货跟踪或无 |
load_to(track, parent, query) | 查找浏览器项目并将其加载到轨道上 |
log | 写入Ableton的日志.txt |
json | The json 模块 |
time | The time 模块 |
发展
克隆和符号链接 实时开发的远程脚本(更改在Ableton重启时生效):
git clone https://github.com/opendining/ableton-mcp-server.git# Windows (PowerShell, run once)
New-Item -ItemType Junction `
-Path "C:\ProgramData\Ableton\Live 12 Intro\Resources\MIDI Remote Scripts\AbletonLiveMCP" `
-Target "C:\path\to\ableton-mcp-server\ableton"从源代码运行 代替PyPI:
# Claude Code
claude mcp add --scope user AbletonLiveMCP -- uv run --directory /path/to/ableton-mcp-server ableton-live-mcp// Claude Desktop
{
"mcpServers": {
"AbletonLiveMCP": {
"command": "uv",
"args": ["run", "--directory", "/path/to/ableton-mcp-server", "ableton-live-mcp"]
}
}
}Claude代码插件 --自动启动MCP服务器并加载代理指南技能:
claude --plugin-dir /path/to/ableton-mcp-server看 Developpent.md 查看完整的架构指南。
故障排除
如果MCP服务器无法连接Ableton,请检查:
- Ableton运行时启用了AbletonLiveMCP控制界面
- 没有其他MCP服务器实例已连接(一次只有一个客户端)
检查Ableton的Log.txt是否存在远程脚本错误:
- 窗户:
%APPDATA%\Ableton\Live x.x.x\Preferences\Log.txt - macOS:
~/Library/Preferences/Ableton/Live x.x.x/Log.txt
致谢
这个项目的灵感来自 阿胡希德/艾博顿mcp,开创了通过MCP将Ableton Live连接到AI代理的想法。该项目为每个动作使用一组固定的工具命令(创建轨迹、添加音符、设置节奏等)。
这个分叉采用了一种不同的方法,灵感来自Cloudflare的 代码模式:代理直接在Ableton的运行时编写和执行Python,而不是预定义的命令。具有内置助手的简化执行范围(find_item, find_track, load_to等等)和可搜索的API参考为模型提供了使用完整的Live API所需的一切,而不限于精心策划的命令集。
免责声明
该项目是非官方的,与Ableton无关或不受其支持。对于问题,请使用 问题跟踪系统 --不是Ableton的支持渠道。
许可证
麻省理工学院
