This project implements an MCP (Model Context Protocol) server that connects to Audacity via its mod‑script‑pipe interface. Using named pipes, the server sends commands to Audacity and receives responses, allowing you to control Audacity (for example, starting/stopping recording or playback) through MCP endpoints. The server can be launched using the uv
tool and integrated with the Claude Desktop client.
uv
tool to run the MCP server.httpx
mcp[cli]
Clone or Download the Project:
git clone <repository-url>
cd mcp-audacity
Set Up a Virtual Environment:
Use the uv tool to create and activate the virtual environment:
uv venv --python=python3.13
source .venv/bin/activate
uv add "mcp[cli]" httpx
audacity_mcp_pipe.py
(the main MCP server script)pyproject.toml
(project configuration)claude_desktop_config.json
(for integration with the Claude Desktop client)Step 1: Enable mod‑script‑pipe in Audacity
Step 2: Verify Named Pipes
Audacity should create two named pipes (by default on macOS/Linux):
Command pipe: /tmp/audacity_script_pipe.to.%number%
Response pipe: /tmp/audacity_script_pipe.from.%number%
Run the following command in a terminal to verify:
ls -l /tmp | grep audacity_script_pipe
If you see extra numbers or characters (e.g.
/tmp/audacity_script_pipe.to.1234
), update the pipe paths in youraudacity_mcp_pipe.py
accordingly.
Running the MCP Server from the Command Line 1. Navigate to Your Project Directory:
cd /%path_to_project%/mcp-audacity
2. Activate the Virtual Environment (if not already activated):
source .venv/bin/activate
3. Launch the Server with the uv Tool:
uv run audacity_mcp_pipe.py
You should see log messages such as:
2025-04-13 19:36:32,759 - AudacityMCPServer - INFO - Audacity MCP server starting up
2025-04-13 19:36:32,760 - AudacityMCPServer - INFO - Opened Audacity mod-script-pipe
2025-04-13 19:36:32,762 - AudacityMCPServer - INFO - Connected to Audacity mod-script-pipe
Your MCP server exposes several endpoints that can be invoked by an MCP client. For example:
get_status: Retrieves Audacity status.
start_recording: Starts recording.
stop_recording: Stops recording.
play: Starts playback.
pause: Pauses playback.
These endpoints are defined in audacity_mcp_pipe.py
and can be triggered using an MCP client.
If you want to run your server via the Claude Desktop client, update your claude_desktop_config.json
to point to this project. For example:
{
"mcpServers": {
"audacity": {
"command": "/%absolute_path_to_ev%/.local/bin/uv",
"args": [
"--directory",
"/Users/andriiboboshko/mcp-audacity",
"run",
"audacity_mcp_pipe.py"
]
}
}
}
Ensure the paths match your project location and that your virtual environment is set up correctly.
This project is provided under MIT License. Feel free to modify and distribute as needed.
Error: spawn uv ENOENT
claude_desktop_config.json
.ERROR - Failed to connect to Audacity: [Errno 61] Connection refused
I've got this error because Audacity created command and response pipes files in the /tmp folder with some numbers:
/tmp/audacity_script_pipe.to.501
/tmp/audacity_script_pipe.from.501
After updating the code with the particular number it worked.
{
"mcpServers": {
"audacity": {
"env": {},
"args": [
"--directory",
"/Users/andriiboboshko/mcp-audacity",
"run",
"audacity_mcp_pipe.py"
],
"command": "uv"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.