ai newsMi., 25. Nov.
EilmeldungYale’s Sonnenfeld: Nvidia is a ‘detriment’ to U.S. industrial might — not a champion

KI-generierte Musik aus dem MCP-Server: Lofi-Tracks direkt aus Claude Code

Ein MCP-Server erlaubt es, aus Claude Code heraus kurze Lofi-Loops etwa für Produktdemos zu erzeugen. Das erspart die Suche auf Stock-Audio-Seiten und die Prüfung von Lizenzbedingungen.

dev.toMontag 09:46 · 23.11.DE3 Min. Lesezeit
Bild: dev.to

Die meisten Coding-Sessions enden mit derselben kleinen Ablenkung: Man möchte dezente instrumentale Musik im Hintergrund oder eine kurze 60-sekündige Lo-Fi-Schleife für eine Produkt-Demo, und plötzlich ist man zehn Tabs tief in Stock-Audio-Websites und prüft Lizenzbedingungen.

Wenn Sie den Großteil Ihres Tages ohnehin in Claude Code verbringen, können Sie einmalig einen MCP-Server einrichten und direkt aus dem Terminal heraus einen originellen Instrumentaltrack generieren. In dieser Anleitung verbinden wir den Auteo MCP-Server mit Claude Code, prüfen das Setup über den CLI-Fallback und führen einen konkreten Lo-Fi-Hip-Hop-Prompt durch das Open-Source-Modell YuE2.

Wenn Sie ein Demo-Video, einen Spiele-Prototyp oder ein Overlay für einen Coding-Stream erstellen, unterbricht die Suche nach Hintergrundmusik außerhalb des Editors den Arbeitsfluss. Musikgenerierung hinter dem Model Context Protocol (MCP) zu platzieren, verwandelt sie in einen wiederholbaren Tool-Aufruf:

Der Auteo MCP-Endpunkt nutzt Streamable HTTP mit Bearer-Token-Authentifizierung. Bevor Sie ihn zu Claude Code hinzufügen, erzeugen Sie einen API-Schlüssel in den Einstellungen Ihres Auteo-Kontos und exportieren ihn in Ihrer Shell:

export AUTEO_API_KEY = "your_api_key_here" Vollbildmodus öffnen Vollbildmodus verlassen Wenn Sie das Token in einer Umgebungsvariable halten, verhindern Sie, dass es in projektweite Konfigurationsdateien gelangt, falls Sie.mcp.json in Git committen.

Führen Sie den integrierten Befehl claude mcp add aus, um den entfernten Endpunkt über HTTP anzubinden:

claude mcp add --transport http auteo https://auteo.ai/api/mcp \ --header "Authorization: Bearer ${AUTEO_API_KEY}" Vollbildmodus öffnen Vollbildmodus verlassen Prüfen Sie, ob Claude Code den Server erkennt:

claude mcp list Vollbildmodus öffnen Vollbildmodus verlassen Sie sollten auteo mit dem Transport http und der URL https://auteo.ai/api/mcp in der Liste sehen. Wenn Sie die Konfiguration lieber in ~/.claude.json oder in einer projektbezogenen.mcp.json vornehmen, sieht der entsprechende Eintrag so aus:

{ "mcpServers": { "auteo": { "type": "http", "url": "https://auteo.ai/api/mcp", "headers": { "Authorization": "Bearer ${AUTEO_API_KEY}" } } } } Vollbildmodus öffnen Vollbildmodus verlassen Optional: CLI-Fallback mit @auteo/cli Wenn Sie Batch-Generierungen in einem Makefile oder CI-Job außerhalb einer interaktiven Claude-Code-Session skripten möchten, können Sie stattdessen das offizielle CLI-Paket installieren:

npm i -g @auteo/cli auteo auth login auteo account Vollbildmodus öffnen Vollbildmodus verlassen Sie können das Tool auch einmalig ohne globale Installation über npx @auteo/cli ausführen und die begleitenden Agent-Skills mit npx skills add AuteoAI/skills installieren, damit Claude Code die genauen Parameterkonventionen kennt.

Open-Source-Musikmodelle liefern die besten Ergebnisse, wenn man Instrumentierung, Groove, Textur und Tempo getrennt beschreibt, statt vage Adjektive wie „chill vibes“ zu schreiben.

In unserem 10-Genre-Praxis-Benchmark von YuE2 (Sie können die Audiodateien und Logs auf der YuE2-Modellseite erkunden oder die Rohdaten als CSV und MP3s aus dem offenen YuE2-Beispieldatensatz auf Hugging Face herunterladen) verwendeten wir den folgenden Instrumental-Prompt mit dem Titel „Desk Lamp“:

Instrumental lo-fi hip hop, soft electric piano chords, dusty muted drums, mellow bass, light vinyl crackle, around 78 BPM. Vollbildmodus öffnen Vollbildmodus verlassen Beachten Sie drei bewusste Entscheidungen in diesem Prompt:

Starten Sie Claude Code in Ihrem Workspace und übergeben Sie den Prompt direkt in normalem Englisch:

Use the Auteo MCP server to generate an instrumental music track with the YuE2 model. Title: Desk Lamp Style: Instrumental lo-fi hip hop, soft electric piano chords, dusty muted drums, mellow bass, light vinyl crackle, around 78 BPM. Instrumental: true Save the resulting MP3 to./assets/audio/desk-lamp-lofi.mp3. Vollbildmodus öffnen Vollbildmodus verlassen Claude Code erkennt das vom MCP-Server bereitgestellte Werkzeug zur Musikgenerierung, übermittelt die Anfrage an YuE2 (m-a-p/yue2), fragt den Status ab, bis das Rendering abgeschlossen ist, und lädt die MP3-Datei lokal herunter.

Hier ist das echte Laufzeit-Log aus unserer Benchmark-Ausführung genau dieses „Desk Lamp“-Prompts auf YuE2:

Als wir das gerenderte Audio anhand einer dreipunktigen Checkliste prüften:

Ein praktischer Hinweis zur Latenz: Wenn die Warteschlange leer ist, ist ein rund 69-sekündiger YuE2-Track in etwa 36 Sekunden Ende-zu-Ende fertig. Bei stärkerer Auslastung der Warteschlange auf einer einzelnen selbst gehosteten GPU können längere Tracks (etwa ein zweiminütiges cinematic-orchestrales Stück oder ein fast vierminütiger Rocksong) mehrere Minuten dauern. Instrumentale Hintergrund-Loops im Bereich von 60 bis 90 Sekunden sorgen für die schnellste Durchlaufzeit bei rascher Iteration.

Sobald der MCP-Server verbunden ist, machen einige kleine Gewohnheiten die Audiogenerierung deutlich reibungsloser:

Die Anbindung eines MCP-Servers an Claude Code verwandelt Hintergrundmusik von einer manuellen Sucharbeit in einen einzigen reproduzierbaren Befehl. Da YuE2 über denselben Endpunkt verfügbar ist, den Sie ohnehin aus Ihrem Terminal nutzen, können Sie in unter einer Minute eigene Lo-Fi-Tracks entwerfen, anhören und speichern, ohne den Editor jemals zu verlassen.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

Most coding sessions end up with the same small distraction: you want low-key instrumental music in the background, or a quick 60-second lo-fi loop for a product demo, and suddenly you are ten tabs deep into stock audio sites checking license restrictions.

If you already spend most of your day in Claude Code, you can wire up an MCP server once and generate an original instrumental track straight from your terminal. In this walkthrough, we will connect the Auteo MCP server to Claude Code, inspect the setup with the CLI fallback, and run a concrete lo-fi hip hop prompt through the open-source YuE2 model.

When you are building a demo video, a game prototype, or a coding stream overlay, leaving your editor to hunt for background music breaks flow. Putting music generation behind Model Context Protocol (MCP) turns it into a repeatable tool call:

The Auteo MCP endpoint uses Streamable HTTP with Bearer token authentication. Before adding it to Claude Code, generate an API key from your Auteo account settings ( https://auteo.ai/me/settings#api-keys ) and export it in your shell:

export AUTEO_API_KEY = "your_api_key_here" Enter fullscreen mode Exit fullscreen mode Keeping the token in an environment variable prevents it from leaking into project-level config files if you commit.mcp.json to Git.

Run the built-in claude mcp add command to attach the remote endpoint over HTTP:

claude mcp add --transport http auteo https://auteo.ai/api/mcp \ --header "Authorization: Bearer ${AUTEO_API_KEY}" Enter fullscreen mode Exit fullscreen mode Verify that Claude Code sees the server:

claude mcp list Enter fullscreen mode Exit fullscreen mode You should see auteo listed with transport http and URL https://auteo.ai/api/mcp. If you prefer configuring it in ~/.claude.json or a project-scoped.mcp.json, the equivalent entry looks like this:

{ "mcpServers": { "auteo": { "type": "http", "url": "https://auteo.ai/api/mcp", "headers": { "Authorization": "Bearer ${AUTEO_API_KEY}" } } } } Enter fullscreen mode Exit fullscreen mode Optional: CLI fallback with @auteo/cli If you want to script batch generations in a Makefile or CI job outside of an interactive Claude Code session, you can install the official CLI package instead:

npm i -g @auteo/cli auteo auth login auteo account Enter fullscreen mode Exit fullscreen mode You can also run it one-off without a global install via npx @auteo/cli, and install the companion agent skills with npx skills add AuteoAI/skills so Claude Code knows the exact parameter conventions.

Open-source music models respond best when you separate instrumentation, groove, texture, and tempo rather than writing vague adjectives like "chill vibes."

In our 10-genre practitioner benchmark of YuE2 (you can explore the audio files and logs on the YuE2 model page or download the raw CSV and MP3s from the open YuE2 sample dataset on Hugging Face ), we used the following instrumental prompt titled "Desk Lamp":

Instrumental lo-fi hip hop, soft electric piano chords, dusty muted drums, mellow bass, light vinyl crackle, around 78 BPM. Enter fullscreen mode Exit fullscreen mode Notice three deliberate choices in that prompt:

Start Claude Code in your workspace and pass the prompt directly in plain English:

Use the Auteo MCP server to generate an instrumental music track with the YuE2 model. Title: Desk Lamp Style: Instrumental lo-fi hip hop, soft electric piano chords, dusty muted drums, mellow bass, light vinyl crackle, around 78 BPM. Instrumental: true Save the resulting MP3 to./assets/audio/desk-lamp-lofi.mp3. Enter fullscreen mode Exit fullscreen mode Claude Code will discover the music generation tool exposed by the MCP server, submit the request to YuE2 ( m-a-p/yue2 ), poll until rendering completes, and download the MP3 locally.

Here is the real run log from our benchmark execution of this exact "Desk Lamp" prompt on YuE2:

When we reviewed the rendered audio against a three-point checklist:

One practical note on latency: when the queue is clear, a ~69-second YuE2 track completes in roughly 36 seconds end-to-end. Under heavier queue load on a single self-hosted GPU, longer tracks (such as a 2-minute cinematic orchestral piece or a nearly 4-minute rock song) can take several minutes. Keeping instrumental background loops around 60–90 seconds gives the fastest turnaround for rapid iteration.

Once the MCP server is connected, a few small habits make audio generation much smoother:

Wiring an MCP server into Claude Code turns background music from a manual browsing chore into a single reproducible command. With YuE2 available through the same endpoint you already use from your terminal, you can draft, audition, and save custom lo-fi tracks in under a minute without ever leaving your editor.

Originaltitel: Generate a lofi track from Claude Code with an MCP serverQuelle: dev.to (dev.to). Original öffnen