Repository navigation
Move the MCP protocol into a demucs-mcp library crate - #7
Merged
Merged
Conversation
The NDJSON JSON-RPC server in demucs-cli/src/mcp.rs mixed the protocol with the CLI's separation engine. The protocol now lives in demucs-mcp behind a StemEngine trait (list_models, separate), and `demucs --mcp` calls demucs_mcp::serve with the CLI's engine. Wire behavior is the same: tool schemas, progress, cancel, the busy rule and the 8 MB worker. One difference: list_models is answered by the worker thread, because the engine lives there. During a running separation the answer now waits for the job instead of coming back immediately. Cancels are still handled right away. The model cache moved to a thread_local on the worker, since the wgpu model types overflow the Send check StemEngine requires. demucs-mcp depends only on anyhow, serde and serde_json and has protocol tests against a fake engine. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
siGit Code Review is paused because the linked siGit account has reached its monthly cloud allowance. On siGit Code Unlimited, reviews don't count toward it: https://sigit.si/billing |
paydii
approved these changes
Oct 11, 2026
keypair34
approved these changes
Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The NDJSON JSON-RPC server in demucs-cli/src/mcp.rs mixed the protocol with the CLI's separation engine. The SplitFire AI Audio Separator needs the same protocol over its own engine, so the protocol moves into a new
demucs-mcpcrate behind aStemEnginetrait (list_models,separate).demucs --mcpnow callsdemucs_mcp::servewith the CLI's engine.Wire behavior is unchanged: tool schemas,
notifications/progress,notifications/cancelled, the busy rule, the 8 MB worker thread andserverInfo.name = "demucs".Two small differences:
list_modelsis answered by the worker thread, because the engine lives there. During a running separation the answer now waits for the job. Cancels are still handled right away.thread_localon the worker. The wgpu model types overflow theSendcheck thatStemEngineasks for, so the cache can't be a field of the engine.demucs-mcpdepends only on anyhow, serde and serde_json. Its tests run against a fake engine (initialize, tools/list, progress, cancel, busy, malformed line). The 8 existingdemucs --mcpintegration tests in demucs-cli still pass.