卡拉MCP服务器
一个全面的模型上下文协议(MCP)服务器,用于完全控制Carla音频插件主机。此服务器支持通过大型语言模型对专业音频制作工作流程进行自然语言控制。
🎯 项目概述
Carla MCP服务器提供 45工具 横跨 7个功能类别 用于完整的音频制作控制。它采用Python 3.12+构建,在人工智能助手和专业音频软件之间提供了一个生产就绪的接口。
主要特点:
- 🤖 人工智能原生:专为通过LLM进行自然语言控制而设计
- 🎛️ 完全控制:45个工具,涵盖音频制作的各个方面
- ⚡ 实时:低延迟监控和分析功能
- 🔧 专业的:生产准备就绪,具有全面的错误处理和类型安全
- 📈 可扩展的:支持复杂工作流程的模块化架构
🌟 你能做什么
请人工智能助手帮助完成专业音频任务:
- _“加载我的混合项目并设置一个带有压缩功能的滚筒总线”_
- _在主合成器上创建滤镜扫频效果,并将其与节奏同步_
- _“分析我的混音,并提出改进建议,以实现更好的频率平衡”_
- _“为具有不同诗句/合唱设置的人声设置并行压缩”_
- _“为低延迟的现场表演准备此会话”_
🎛️ 完整功能集
🗂️ 会话管理(8个工具)
- 使用自动连接加载/保存项目
- 创建A/B快照以进行比较
- 在交叉火力下的会话之间进行热交换
- 导出/导入多种格式
- 会话清理和优化
🔌 插件控制(8个工具)
- 加载VST2/3、LV2、LADSPA、DSSI、AU、SF2/SFZ插件
- 扫描目录以查找可用插件
- 使用参数映射克隆和替换插件
- 使用插件链进行批处理
- 实时插件状态控制
🔗 音频路由(7个工具)
- 复杂的音频/MDI路由矩阵
- 分组式公交创建与管理
- 压缩侧链配置
- 实时路由矩阵检查
🎚️ 参数自动化(8个工具)
- 具有多种曲线类型的高级自动化
- 具有自定义范围的MIDI CC映射
- 多参数的宏控制
- 直接参数获取/设置操作
- 实时参数控制和监测
📊 实时分析(5个工具)
- 可定制FFT的频谱分析
- 音频电平测量(峰值、RMS、LUFS)
- 延迟测量和优化
- 反馈回路检测和预防
- 随时间变化的参数捕获
🔊 JACK集成(6个工具)
- JACK端口管理和连接
- 系统音频路由
- 港口监控和状态
- 插件自动连接
- 连接稳定性验证
🖥️ 硬件控制(3个工具)
- 音频接口配置
- 设备发现和管理
- 控制曲面映射
- 监视器校准支持
🎓 MixAssist集成
- 直接访问 MixAssist研究数据集
- 专业音频工程对话数据库
- 来自专家的现实世界混合建议和技术
- 上下文混合指导和故障排除资源
🚀 安装
先决条件
- 卡拉音频插件主机
# Ubuntu/Debian
sudo apt install carla carla-dev
# Or build from source for latest features
git clone https://github.com/falkTX/Carla.git
cd Carla
make
sudo make install- Python环境
# Requires Python 3.12+
python3 --version # Should be 3.12 or higher- 组合音响
# JACK Audio Connection Kit (recommended)
sudo apt install jackd2 jack-tools
# For Windows VST support on Linux
sudo apt install wine wine32 wine64设置
- 克隆并安装
git clone https://github.com/your-org/carla-mcp-server.git
cd carla-mcp-server
# Install dependencies
pip install -r requirements.txt
# Or install with development tools
pip install -e ".[dev]"- 配置环境
# Set Carla path (adjust to your installation)
export CARLA_PATH=/usr/share/carla
export PYTHONPATH=$CARLA_PATH/source/frontend:$PYTHONPATH
export LD_LIBRARY_PATH=/usr/lib/carla:$LD_LIBRARY_PATH- 试验装置
# Run test suite
pytest tests/
# Test Carla integration
python -c "import carla_backend; print('Carla integration working!')"🎮 用法
快速开始
# Start the MCP server
python server.py
# Or with debugging
python server.py --debug --log-level INFOMCP客户端集成
添加到您的MCP客户端配置中(例如,Claude Desktop):
{
"mcpServers": {
"carla-mcp": {
"type": "stdio",
"command": "python",
"args": ["/path/to/carla-mcp-server/server.py"],
"env": {
"CARLA_PATH": "/usr/share/carla",
"PYTHONPATH": "/usr/share/carla/source/frontend"
}
}
}
}快速设置:复制提供的 .mcp.json.example 文件并调整系统的路径。
自然语言示例
一旦连接到LLM,您就可以使用自然语言完成复杂的音频任务:
基础混音课程
User: "Load my rock song project and add an EQ to remove vocal rumble and
improve my vocal clarity."
AI: Perfect! I've loaded your project, and optimized your microphone EQ
for professional vocal quality:
🎯 Vocal Optimization Applied:
✅ Rumble Removal:
- 50Hz: -12dB (removes sub-bass rumble)
- 100Hz: -8dB (reduces low-frequency noise)
- 156Hz: -6dB (cleans up muddy low-mids)
✅ Clarity Enhancement:
- 2500Hz: +4dB (vocal presence)
- 3500Hz: +6dB (speech intelligibility)
- 5000Hz: +3dB (clarity and definition)
✅ Sibilance Reduction:
- 10000Hz: -4dB (tames harsh 's' and 't' sounds)
Your microphone signal is now routed through the optimized EQ, providing cleaner, more
professional vocal sound with reduced rumble, enhanced clarity, and controlled sibilance. The settings follow standard pop/rock vocal processing techniques.创意音效设计
User: "Create an evolving filter sweep on the synth pad that builds tension"
AI: I'll create a dynamic filter automation that builds tension:
1. Finding your synth pad plugin
2. Setting up exponential filter frequency automation
3. Adding resonance automation for more character
4. Syncing the sweep to your project tempo
Created a 16-bar filter sweep that starts subtle and builds to an
intense peak, perfect for creating tension in your arrangement.问题解决
User: "Something sounds muddy in my mix and there's a slight feedback"
AI: Let me analyze and fix those issues:
1. Running spectrum analysis to identify muddy frequencies
2. Scanning for feedback loops in your routing
3. Applying corrective EQ to clear up the muddiness
4. Fixing the feedback path I found
Analysis complete! Found buildup around 200-300Hz (applied corrective EQ)
and fixed a feedback loop between your reverb send and input.
Your mix should sound much cleaner now.分析混音的歌曲结构
User: "Analyze my VU meter's levels for the duration of my song and using
the historic measurement data, identify where in the timecode each verse,
chorus, and solo section begins."
AI: Let me begin analyzing your VU meter plugin for 05:32 minutes (the exact
length of your mix, plus two seconds to accommodate for a slight delay in playback.)
...
Completed my analysis of your VU meter levels! Here is a breakdown of your song's
musical structure based on the historical measurements data I procssed:
1. 00:02 - Intro
2. 00:28 - First verse
3. 01:20 - First chorus
4. 01:50 - Second verse
5. 2:45 - Second chorus
6. 3:32 - Solo
7. 4:02 - Breakdown
8. 4:20 - Last chorus
9. 5:12 - Outro🛠️ 发展
项目结构
carla-mcp-server/
├── server.py # Main MCP server
├── carla_controller.py # Carla backend wrapper
├── tool_registry.py # Tool registration system
├── carla_types.py # Type definitions and schemas
├── base_tools.py # Base tool framework
├── mixassist_resources.py # MixAssist dataset integration
├── mixassist_schema.py # MixAssist data schemas
├── tools/ # MCP tool implementations
│ ├── session_tools.py # Session management
│ ├── plugin_tools.py # Plugin control
│ ├── routing_tools.py # Audio routing
│ ├── parameter_tools.py # Parameter automation
│ ├── analysis_tools.py # Real-time analysis
│ ├── jack_tools.py # JACK integration
│ └── hardware_tools.py # Hardware control
├── monitors/ # Real-time monitoring
│ ├── audio_monitor.py # Audio level monitoring
│ ├── cpu_monitor.py # Performance monitoring
│ └── event_monitor.py # Event streaming
├── tests/ # Comprehensive test suite
├── .mcp.json.example # Example MCP configuration
└── LICENSE # GPL-2.0-or-later license运行测试
# Run all tests
pytest
# Run with coverage
pytest --cov=carla_mcp_server --cov-report=html
# Run specific test category
pytest tests/test_server.py::TestSessionManagement
# Run integration tests (requires Carla)
pytest tests/test_complete_suite.py代码质量
# Format code
black carla_mcp_server/
# Sort imports
isort carla_mcp_server/
# Type checking
mypy carla_mcp_server/
# Linting
flake8 carla_mcp_server/
# Run all quality checks
pre-commit run --all-files添加新工具
- 创建工具方法 在适当
tools/模块:
async def my_new_tool(self, param1: str, param2: int = 10) -> dict:
"""Tool description for documentation."""
try:
# Implementation
return {"success": True, "result": data}
except Exception as e:
return {"success": False, "error": str(e)}- 注册工具 在
tool_registry.py:
ToolDefinition(
name="my_new_tool",
description="Description for MCP clients",
handler="tool_class_name",
input_schema={/* JSON schema */}
)- 添加测试 在
tests/:
async def test_my_new_tool():
# Test implementation🧩 完整的工具参考
会话管理
load_session-加载Carla项目文件save_session-保存当前会话状态create_snapshot-创建A/B比较快照switch_session-会话之间的热交换list_sessions-显示可用会话delete_session-删除会话export_session-导出为音频格式import_session-从外部格式导入
插件控制
load_plugin-加载任何插件格式scan_plugins-发现可用插件control_plugin-激活/绕过/单独/删除batch_process-将插件链应用于音频list_plugins-显示加载的插件get_plugin_info-插件详细信息clone_plugin-具有设置的重复插件replace_plugin-用参数映射交换插件
音频路由
connect_audio-创建音频连接create_bus-构建用于分组的音频总线setup_sidechain-配置侧链路由get_routing_matrix-查看完整路线disconnect_audio-删除连接create_send-设置发送/返回效果set_connection_gain-调整连接级别
参数自动化
automate_parameter-创建自动化曲线map_midi_cc-MIDI控制器映射set_parameter-直接设置插件参数值get_parameter-获取插件参数值和信息create_macro-多参数宏record_automation-捕获参数更改randomize_parameters-创造性随机化morph_parameters-平滑的参数转换
实时分析
analyze_spectrum-FFT频谱分析measure_levels-峰值/RMS/LUFS计量capture_plugin_parameters-随时间变化的参数监测detect_feedback-反馈回路检测analyze_latency-系统延迟测量
JACK集成
list_jack_ports-显示可用的JACK端口connect_jack_ports-连接JACK端口disconnect_jack_ports-断开JACK端口get_jack_connections-查看端口连接connect_system_to_plugin-将系统音频路由到插件connect_plugin_to_system-将插件路由到系统输出
硬件控制
configure_audio_interface-设置音频硬件list_audio_devices-发现音频设备map_control_surface-配置MIDI控制器
📖 文档
🔧 配置
服务器配置(config/config.yaml)
server:
host: localhost
port: 8765
log_level: INFO
carla:
path: /usr/share/carla
wine_prefix: ~/.wine
auto_start_engine: true
audio:
driver: JACK
sample_rate: 48000
buffer_size: 512
auto_connect: true
plugins:
scan_paths:
- /usr/lib/lv2
- /usr/lib/vst
- ~/.wine/drive_c/Program Files/Common Files/VST3
cache_enabled: true
monitoring:
audio_enabled: true
cpu_enabled: true
update_interval_ms: 100环境变量
# Essential paths
export CARLA_PATH=/usr/share/carla
export PYTHONPATH=$CARLA_PATH/source/frontend:$PYTHONPATH
export LD_LIBRARY_PATH=/usr/lib/carla:$LD_LIBRARY_PATH
# Optional configuration
export CARLA_MCP_LOG_LEVEL=INFO
export CARLA_MCP_HOST=localhost
export CARLA_MCP_PORT=8765🤝 贡献
我们欢迎捐款!请看 贡献.md 作为指导方针。
快速贡献步骤:
- 复刻仓库
- 创建要素分支
- 添加新功能的测试
- 确保所有测试通过
- 提交拉取请求
📄 许可证
此项目根据GPL-2.0或更高版本的许可证获得许可-请参阅 许可证 文件以获取详细信息。
🙏 鸣谢
📞 支持
- 问题:
- 讨论:
- 文档:参见
docs/目录 - 社区:加入Carla Discord社区
______________________________________________________________________
准备好在人工智能的帮助下彻底改变您的音频制作工作流程了吗?今天就开始吧! 🎵✨
