Skip to main content
Glama
TyrelCB

Audio Separation MCP Server

by TyrelCB
README.md
# Audio Separation MCP Server

Streamable MCP server for ComfyUI MelBandRoFormer audio source separation.

## Tools

| Tool | Description |
|------|-------------|
| `audiosep_health` | Check ComfyUI backend status |
| `audiosep_list_models` | List available MelBandRoFormer models |
| `audiosep_start_job` | Submit audio file for separation |
| `audiosep_get_job` | Get job status/results |
| `audiosep_cancel_job` | Cancel a running job |
| `audiosep_list_artifacts` | List all stored artifacts |
| `audiosep_get_artifact` | Download artifact by name |

## Running

### MCP Server (streamable-http)
```bash
cd /home/tyrel/projects/audio-sep-mcp
AUDIOSEP_MCP_PORT=8769 python mcp_server.py  # serves on http://localhost:8769/mcp
```
Note: default port 8765 collides with other local MCP servers — the systemd service below overrides it to `8769`.

### With Gradio UI
```bash
python app.py  # serves on :8767
```

### systemd (user services)
Both services are managed as systemd user units and start automatically (linger enabled):
```bash
systemctl --user status audio-sep-mcp.service audio-sep-gradio.service
systemctl --user restart audio-sep-mcp.service audio-sep-gradio.service
journalctl --user -u audio-sep-mcp.service -f
```
Unit files: `~/.config/systemd/user/audio-sep-mcp.service`, `~/.config/systemd/user/audio-sep-gradio.service`.

### Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| `COMFYUI_URL` | `http://localhost:8188` | ComfyUI backend URL |
| `AUDIOSEP_MCP_PORT` | `8765` | MCP server port (systemd service overrides to `8769`) |
| `AUDIOSEP_WORKSPACE` | `~/Documents/audio-sep-output` | Working directory |
| `AUDIOSEP_WORKFLOW_PATH` | `~/ComfyUI/user/default/workflows/hermes_known_good/melband_roformer_vocals_instruments_preview.json` | Workflow file |
| `AUDIOSEP_OUTPUT_RETENTION_DAYS` | `30` | Artifact cleanup age |

## Supported Input Formats
wav, mp3, flac, ogg, aac, m4a, mp4, webm

## Output
Splits audio into `vocals.wav` and `instruments.wav` in `~/Documents/audio-sep-output/artifacts/<job_id>/`.