Skip to main content
Glama

Stem Splitter

An MCP server that separates a finished song into vocals, drums, bass and other — locally with Demucs, or through a command you point at a GPU box — for any MCP-compatible agent.

把一首成品歌拆成人声、鼓、贝斯和其它四条分轨的 MCP 服务:本地跑 Demucs,或用一条命令指向你的 GPU 机器;任何支持 MCP 的 agent 都能调用。

Platform support: macOS — supported (developed & verified on this machine) · Windows — unverified (paths are cross-platform in the codebase, but no real-machine testing yet).

中文说明 · License: AGPL-3.0

Why it is shaped like this

Separation takes minutes, and an MCP call that blocks for minutes gets killed by its client. So the work runs as a job: separate_stems writes a job file and starts a detached process, then returns a job id immediately. The client polls stem_job_status, and can stop the work with stem_job_cancel. A bridge restart, a plugin restart or a closed laptop lid does not lose the job — the record on disk is the truth.

The model is not a dependency of the server: the plugin itself is stdlib + numpy, and it runs Demucs through whichever interpreter has it (by default a virtualenv at <ShadowRoom>/_venvs/stem-splitter).

Related MCP server: Claud-Ear

Features

  • Four stems, the split DJs and producers actually ask for: vocals, drums, bass, other.

  • Two backends. Local Demucs (htdemucs, or htdemucs_ft for the slow fine-tuned bag), or a command template (STEM_SPLIT_COMMAND) for a remote GPU box, a container, or a wrapper script.

  • Any input. WAV is read directly; mp3 / m4a / flac / aiff / ogg go through ffmpeg, or through macOS's own afconvert when ffmpeg is not installed.

  • Plain output. Every stem is written as 16-bit PCM WAV next to the others, whatever the backend produced, so every player and DAW opens them.

  • Honest errors. No backend → the message says how to install one; a separator that writes three stems → the missing one is named.

Requirements

OS

macOS, Linux or Windows

Python

3.9 or newer (for the MCP server itself: stdlib + numpy)

Model

none of its own — Demucs runs from its own virtualenv, or a remote command

Decoder

ffmpeg, or macOS afconvert, for anything that is not WAV

Install

As an MCP server (any client)

{
  "mcpServers": {
    "stem-splitter": {
      "command": "python3",
      "args": ["mcp_server.py"],
      "cwd": "/path/to/stem-splitter"
    }
  }
}

The separator itself (local Demucs)

python3 -m venv ~/Documents/ShadowRoom/_venvs/stem-splitter
~/Documents/ShadowRoom/_venvs/stem-splitter/bin/pip install -r requirements-local.txt

That installs torch 2.2.2, torchaudio, Demucs 4.0.1 and soundfile (about 300 MB). The first separation downloads the htdemucs weights (~80 MB). Measured on an M4 Mac: a 20-second excerpt separated in 11.7 seconds, and the four stems summed back to the mix at 0.999 correlation.

The versions matter: torch 2.2.2 was built against numpy 1.x, so numpy<2 is pinned; and without soundfile (or ffmpeg) torchaudio cannot open even a plain WAV — Demucs then fails with "FFmpeg is not installed".

Configuration

Option

Default

Used for

STEM_SPLIT_PYTHON

<ShadowRoom>/_venvs/stem-splitter/bin/python

the interpreter that has Demucs

STEM_SPLIT_COMMAND

remote command: ssh gpu 'split {input} {output_dir}' with {input}, {output_dir}, {model}

STEM_SPLIT_OUT_DIR

<ShadowRoom>/stems

where the stems are written

STEM_SPLIT_JOB_DIR

<ShadowRoom>/stem-splitter-jobs

job records

SHADOWROOM_HOME

~/Documents/ShadowRoom

where the venv and output directories live

Tools

Tool

What it does

separate_stems

Start a separation (path, out_dir?, model?, quality?, backend?) → {job_id, status, out_dir}

stem_job_status

One job's status, stage, stems and errors (or the recent jobs)

stem_job_cancel

Stop a job and delete its half-written stems

stem_backends

Which backends this machine has, and how to enable the missing one

Usage

shadow-stem-splitter backends
shadow-stem-splitter separate ~/Music/artist - track.mp3
shadow-stem-splitter status            # the recent jobs
shadow-stem-splitter status 20260915-011407-song-20s
shadow-stem-splitter cancel 20260915-011407-song-20s

The stages a job moves through are decodeseparatecollect; collect is where the four files are rewritten as plain WAVs and named vocals.wav, drums.wav, bass.wav, other.wav.

Safety

Nothing is deleted except the job's own half-written stems when you cancel it, inside the output directory that job was given. The source file is only ever read.

Troubleshooting

Symptom

Fix

no separation backend

Install Demucs into the plugin's venv, or set STEM_SPLIT_COMMAND

FFmpeg is not installed from Demucs

pip install soundfile into the same venv

numpy import error

Pin numpy<2 (torch 2.2.2 was built against numpy 1.x)

A job stays running

Its process died: stem_job_status reports that as failed, and the log tail is in error

License

AGPL-3.0. The separation model (Demucs, MIT) is installed separately and is not bundled.

Available Tools

4 tools
separate_stemsA

Start separating one audio file into vocals / drums / bass / other. Returns a job id immediately.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute path to the song (WAV, or mp3/m4a/flac through a decoder).
modelNohtdemucs
backendNoauto
job_dirNoWhere job records live (default /root/Documents/ShadowRoom/stem-splitter-jobs).
out_dirNoWhere the stems go (default /root/Documents/ShadowRoom/stems/<name>-<stamp>).
qualityNofast = htdemucs once; best = the fine-tuned bag with 2 shifts (roughly 4× slower).fast

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the behavioral burden, and it does disclose the key trait: the operation returns immediately with a job id rather than blocking for results. It stops short of mentioning side effects like stem files being written to disk, but the immediate-return behavior is the most important thing an agent needs to know.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short sentences with no filler. It front-loads the action and immediately gives the crucial return behavior, so every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a moderately complex async tool with no output schema, the description is largely complete: it names the input, the expected stem outputs, and the immediate job-id return. It would be slightly richer if it pointed to stem_job_status for tracking, but the sibling names and schema defaults cover most remaining needs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 67%, so the schema already documents path, out_dir, and quality. The description adds no parameter-level meaning beyond the idea that the audio file is split into stems; model and backend remain explained only through enums/defaults. This is adequate but not compensatory.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Start separating'), identifies the resource ('one audio file'), and states the concrete outputs ('vocals / drums / bass / other'). It also distinguishes this launcher tool from sibling status/cancel/backends tools by noting it returns a job id immediately.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrasing 'Start separating' and 'Returns a job id immediately' clearly frame this as the async job-launching tool, implying that stem_job_status should be used afterward. It gives clear context but does not explicitly say 'use stem_job_status to monitor' or state when not to use this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

stem_backendsA

Which separation backends this machine has (local demucs, or STEM_SPLIT_COMMAND) and how to enable them.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of conveying behavior. 'Which ... this machine has' suggests a read-only informational query, and 'how to enable them' suggests the tool reports enablement guidance rather than mutating configuration. However, it is not explicit about whether the tool modifies anything or only returns information.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no filler, and the core subject ('separation backends on this machine') is front-loaded. Every clause adds useful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description provides enough context for an agent to select the tool: it reports available backend types and enablement guidance, and there are no input parameters to prepare. It could be slightly clearer about whether the response contains instructions or the tool itself performs enablement, but this is a minor gap for a zero-parameter informational tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero parameters, so there are no parameter semantics for the description to clarify. This matches the baseline for parameterless tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the resource (separation backends on this machine) and the topic (which backends are available and how to enable them), even naming the two backend types. It is distinguishable from siblings like separate_stems or stem_job_status, though it lacks an explicit verb like 'list' or 'check.'

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose implies this should be checked before or alongside running stem separation, but the description never explicitly says when to use it versus the sibling tools. There is no when/when-not guidance or mention of alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

stem_job_cancelA

Stop a running separation and remove its half-written stems.

ParametersJSON Schema
NameRequiredDescriptionDefault
job_idYes
job_dirNo

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does disclose the key destructive trait beyond the name: it removes half-written stems, not just stops the process. However, it omits other behavioral context such as whether the action is reversible, what state the job record ends in, and what happens if the job is already finished or failed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with zero filler. 'Stop a running separation and remove its half-written stems' delivers the action and the cleanup side effect in under ten words, and every element earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive mutation tool with no annotations, no output schema, and 0% parameter coverage, the description is too thin. It captures the core action but lacks prerequisites (job must be running), post-conditions, the role of job_dir, and any sense of the return value or error behavior.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for the undocumented parameters. It does not clarify what job_id refers to beyond context, and job_dir (an optional parameter) is entirely unexplained, leaving an agent to guess its purpose and whether it must match a value from a status call.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses specific verbs ('Stop', 'remove') with concrete resources ('a running separation', 'its half-written stems'), clearly identifying this as a job-cancellation and cleanup operation. It is readily distinguished from the siblings: separate_stems (creation), stem_job_status (monitoring), and stem_backends (listing), even though no sibling is named.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied: use this when a separation is running and you want to stop it. However, there is no explicit guidance about when NOT to use it (e.g., if the job already completed), no prerequisites (e.g., verifying the job is running via stem_job_status first), and no mention of alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

stem_job_statusA

Read one separation job (or the recent ones): status, stage, stems, errors.

ParametersJSON Schema
NameRequiredDescriptionDefault
job_idNoOmit to list the recent jobs.
job_dirNo

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden of behavior disclosure. It explicitly states this is a read operation and lists the returned aspects (status, stage, stems, errors), making the non-mutating nature and primary output clear. It does not describe edge cases like ordering or failure behavior, but it is reasonably transparent for a status-read tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single compact sentence that front-loads the verb and resource, then lists the returned fields. Every word earns its place, and it is not padded with schema-redundant material.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read tool with no output schema or annotations, the description gives the essential purpose, output areas, and parameter omission behavior. However, it leaves job_dir undefined and does not cover return formatting or behavior for missing/invalid jobs, leaving a moderate gap in complete guidance.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema documents job_id ('Omit to list the recent jobs') but leaves job_dir entirely undocumented, and schema description coverage is only 50%. The description does not explain job_dir or how it relates to job_id, so an agent would not know how to use that parameter correctly.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Read' and names the resource ('one separation job' or recent ones), plus the data returned: status, stage, stems, errors. This clearly distinguishes it from sibling tools like stem_job_cancel (cancel) and separate_stems (create), which have different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description conveys when to use the tool: to inspect a separation job's status or list recent jobs. The schema's job_id description adds the key usage distinction ('Omit to list the recent jobs'), providing clear context. However, it does not explicitly mention exclusions or alternatives such as stem_backends or stem_job_cancel.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.0
    • First observedseparate_stems
    • First observedstem_backends
    • First observedstem_job_cancel
    • First observedstem_job_status

TDQS

A3.8/5.0

Scored across 4 tools

Disambiguation5/5

The four tools map to distinct actions: starting a job, checking status, cancelling, and listing backends. There is no overlap in purpose, so an agent should be able to select the correct one without ambiguity.

Naming Consistency2/5

Naming is mixed: separate_stems follows verb_noun, while stem_job_status and stem_backends are noun phrases and stem_job_cancel reverses the object/verb order. A consistent pattern such as get_stem_job_status, cancel_stem_job, and list_stem_backends would make the set more predictable.

Tool Count5/5

Four tools is well-scoped for a job-based audio stem separation server. Every tool covers a necessary lifecycle action without redundancy.

Completeness4/5

The core job lifecycle is covered: start, inspect status, and cancel, plus backend discovery. A minor gap is the lack of an explicit result-retrieval or cleanup tool, though status may expose stem outputs indirectly.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers