A3

an-3/an3-audacity-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

29 stars 7 forks 质量 68 趋势 11MIT

Audacity 的 MCP 服务器

概览

MCP(模型上下文协议)服务器,通过mod-script-pipe控制Audacity。 该服务器通过命名管道与 Audacity 通信,并将许多 Audacity 脚本命令作为 MCP 工具暴露。 - 通过mod-script-pipe连接到Audacity——作为MCP工具暴露广泛的Audacity命令——使用stdio传输(支持Codex/Claude/Desktop客户端)——自动检测/tmp中的管道后缀(例如.501) - Audacity 3.x+ - Python 3.10+ - 在 Audacity 中启用 mod-script-pipe 如果你更喜欢手动设置而不是脚本: 可选(安装为包 + CLI 入口): 1. 打开 Audacity。2. 打开偏好设置页面: - : 编辑 -> 偏好设置 -> 模块 - : Audacity -> 设置... -> 模块(或 Audacity ->偏好设置 ->模块,具体取决于构建) 3.将 mod-script-pipe 从新建(或禁用)设置为启用。4. 重启 Audacity。 注意:在当前的 Audacity 版本中,这个配置是在 中,而不是在单独的“脚本/远程控制”部分。

概述(AI 翻译)

MCP(模型上下文协议)服务器,用于通过mod-script-pipe控制Audacity。

该服务器通过命名管道与 Audacity 通信,并将许多 Audacity 脚本命令作为 MCP 工具暴露。

特色

  • 通过[[T1]连接Audacity]
  • 以MCP工具形式公开了广泛的Audacity命令
  • 使用 stdio 传输(支持 Codex/Claude/Desktop 客户端)
  • 自动检测/tmp中的管道后缀(例如.501)

要求

  • Audacity 3.x+
  • Python 3.10+
  • 在Audacity中启用了mod-script-pipe

安装

快速本地测试(无需MCP主机)

如果你更喜欢手动设置而不是脚本:

可选(安装为包 + CLI 入口):

在Audacity中启用mod-script-pipe

  1. 打开大胆。
  2. 打开模块偏好设置页面:
  • Windows/Linux:Edit -> Preferences -> Modules
  • macOS: Audacity -> Settings... -> Modules(或根据构建不同,或Audacity -> Preferences -> Modules)
  1. 将mod-script-pipe从New(或Disabled)设置为Enabled。
  2. 重启Audacity。

注意:在当前的Audacity版本中,这在模块中配置,而不是在单独的“脚本/远程控制”部分。

确认管道存在:

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Audacity MCP Server

MCP (Model Context Protocol) server for controlling Audacity through mod-script-pipe.

This server communicates with Audacity over named pipes and exposes many Audacity scripting commands as MCP tools.

Features

  • Connects to Audacity via mod-script-pipe
  • Exposes a broad set of Audacity commands as MCP tools
  • Uses stdio transport (works with Codex/Claude/Desktop clients)
  • Auto-detects pipe suffixes in /tmp (for example .501)

Requirements

  • Audacity 3.x+
  • Python 3.10+
  • mod-script-pipe enabled in Audacity

Install

git clone https://github.com/An-3/mcp-audacity.git
cd mcp-audacity
./scripts/setup.sh

Quick local test (no MCP host needed)

# 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

If you prefer manual setup instead of scripts:

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"

Optional (install as package + CLI entrypoint):

pip install .
audacity_mcp_server

Enable mod-script-pipe in Audacity

  1. Open Audacity.
  2. Open the Modules preferences page:
    • Windows/Linux: Edit -> Preferences -> Modules
    • macOS: Audacity -> Settings... -> Modules (or Audacity -> Preferences -> Modules depending on build)
  3. Set mod-script-pipe from New (or Disabled) to Enabled.
  4. Restart Audacity.

Note: In current Audacity versions, this is configured in Modules, not in a separate “Scripting/Remote Control” section.

Verify pipes exist:

ls -l /tmp/audacity_script_pipe.to.* /tmp/audacity_script_pipe.from.*

If the files are present, Audacity is ready.

Run the server manually

./scripts/run.sh

Expected startup logs include:

  • Audacity MCP server starting up
  • Opened Audacity mod-script-pipe
  • Connected to Audacity mod-script-pipe

Connect from Codex

Add server to Codex MCP config:

codex mcp add AudacityMCP -- /absolute/path/to/mcp-audacity/.venv/bin/python /absolute/path/to/mcp-audacity/audacity_mcp_server.py

List configured MCP servers:

codex mcp list

Connect from Claude Desktop

Example 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"
      ]
    }
  }
}

Troubleshooting

  • Failed to open Audacity pipes:
    • Confirm Audacity is running.
    • Confirm mod-script-pipe is Enabled.
    • Confirm pipe files exist in /tmp.
  • spawn uv ENOENT:
    • Use absolute paths in client config, or use the Python command shown above instead of uv.
  • Server starts but tools behave inconsistently:
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "audacity": { "command": "/absolute/path/to/mcp-audacity/.venv/bin/python", "args": [ "/absolute/path/to/mcp-audacity/audacity_mcp_server.py" ] } } }