Audacity MCP服务器
MCP(模型上下文协议)服务器,用于通过以下方式控制Audacity mod-script-pipe.
此服务器通过命名管道与Audacity通信,并将许多Audacity脚本命令作为MCP工具公开。
特性
- 通过以下方式连接到Audacity
mod-script-pipe - 将一组广泛的Audacity命令作为MCP工具公开
- 用途
stdio传输(与Codex/Claude/Desktop客户端配合使用) - 自动检测管道后缀
/tmp(例如.501)
需求
- 大胆3.x+
- Python 3.10+
mod-script-pipe在Audacity中启用
安装
git clone https://github.com/An-3/mcp-audacity.git
cd mcp-audacity
./scripts/setup.sh快速本地测试(无需MCP主机)
# 1) Start Audacity and enable mod-script-pipe (see section below)
# 2) Verify local connectivity:
./scripts/smoke_test.sh
# 3) Start MCP server:
./scripts/run.sh如果您更喜欢手动设置而不是脚本:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install "mcp[cli]>=1.6.0" "httpx>=0.28.1"可选(作为包+CLI入口点安装):
pip install .
audacity_mcp_server在Audacity中启用mod脚本管道
- 打开Audacity。
- 打开 模块 首选项页面:
- Windows/Linux: Edit -> Preferences -> Modules - macOS: Audacity -> Settings... -> Modules (或 Audacity -> Preferences -> Modules 取决于构建)
- 集
mod-script-pipe从New(或Disabled)toEnabled. - 重新启动Audacity。
注意:在当前的Audacity版本中,这是在 模块,而不是单独的“脚本/远程控制”部分。
验证管道是否存在:
ls -l /tmp/audacity_script_pipe.to.* /tmp/audacity_script_pipe.from.*如果文件存在,则Audacity已准备就绪。
手动运行服务器
./scripts/run.sh预期的启动日志包括:
Audacity MCP server starting upOpened Audacity mod-script-pipeConnected to Audacity mod-script-pipe
从Codex连接
将服务器添加到Codex MCP配置中:
codex mcp add AudacityMCP -- /absolute/path/to/mcp-audacity/.venv/bin/python /absolute/path/to/mcp-audacity/audacity_mcp_server.py列出已配置的MCP服务器:
codex mcp list从克劳德桌面连接
示例 claude_desktop_config.json:
{
"mcpServers": {
"audacity": {
"command": "/absolute/path/to/mcp-audacity/.venv/bin/python",
"args": [
"/absolute/path/to/mcp-audacity/audacity_mcp_server.py"
]
}
}
}故障排除
Failed to open Audacity pipes:
- 确认Audacity正在运行。 - 确认 mod-script-pipe 是 Enabled. - 确认管道文件存在于 /tmp.
spawn uv ENOENT:
- 在客户端配置中使用绝对路径,或使用上面显示的Python命令代替 uv.
- 服务器启动,但工具行为不一致:
- 确保您使用的是此最新版本,它会在中发送命令 Command: 填写并阅读完整的回复,直到 BatchCommand finished.
许可证
麻省理工学院

