yt-audio-mcp
Downloads audio from YouTube videos and searches YouTube for tracks, converting results into tagged MP3 files with embedded cover art.
Downloads tracks from YouTube Music links as tagged MP3 files, with optional bitrate selection (up to 320 kbps) and search support.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@yt-audio-mcpdownload Daft Punk - One More Time as an MP3"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🎧 yt-audio-mcp
Turn any YouTube or YouTube Music link into an MP3, right from your AI agent.
Ask "download Daft Punk – One More Time as an MP3" and get a tagged file with cover art in your Music folder.
Quick start · Tools · Clients · The "respect" shortcut · FAQ · Contributing
yt-audio-mcp is a small Model Context Protocol server that gives Claude Code, Claude Desktop, Cursor or any other MCP client three tools: search YouTube, download a track as MP3, and list what you already have.
Under the hood it runs yt-dlp and ffmpeg, which keep working as YouTube changes. Everything runs on your machine; no API keys, no accounts, no cloud.
You: respect daft punk one more time
Claude: Daft Punk - One More Time (Official Video), 5:21
→ ~/Music/yt-audio-mcp/Daft Punk - One More Time (Official Video) [FGBhQbmPwH8].mp3Quick start
1. Install yt-dlp and ffmpeg
brew install yt-dlp ffmpeg # macOS
# Linux: install ffmpeg from your package manager and yt-dlp from https://github.com/yt-dlp/yt-dlp#installationKeep yt-dlp current (brew upgrade yt-dlp), since YouTube changes often.
2. Build the server
git clone https://github.com/DaniilPak/yt-audio-mcp.git
cd yt-audio-mcp
npm install && npm run build3. Add it to Claude Code
claude mcp add yt-audio --scope user -e YT_AUDIO_DIR=~/Music/yt-audio-mcp -- node "$PWD/dist/index.js"Start a new Claude Code session and ask it to download a song.
Related MCP server: yt
Tools
Tool | Input | Returns |
|
|
|
|
|
|
| none | MP3s in the output folder, newest first |
Tagged files: saved as
<title> [<videoId>].mp3with ID3 tags and the cover art embedded.No duplicates: a video you already downloaded is returned from disk. Pass
force: trueto download it again.Single tracks only: playlist parameters (
&list=…) are dropped.Safe input: only YouTube hosts are accepted, and yt-dlp is called without a shell.
Connect your client
Claude Desktop
Add this to ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows), with the path
to your clone:
{
"mcpServers": {
"yt-audio": {
"command": "node",
"args": ["/path/to/yt-audio-mcp/dist/index.js"],
"env": { "YT_AUDIO_DIR": "~/Music/yt-audio-mcp" }
}
}
}Cursor and other MCP clients
Any client that supports stdio MCP servers works. Use node /path/to/yt-audio-mcp/dist/index.js
as the command and set the environment variables below if you need them.
Environment
Variable | Default | Purpose |
|
| Where MP3s are saved |
|
| Path to the yt-dlp binary |
Desktop apps often don't inherit your shell's PATH. If you see "yt-dlp not found",
set YTDLP_PATH=/opt/homebrew/bin/yt-dlp. If ffmpeg isn't found either, add
"PATH": "/opt/homebrew/bin:/usr/bin:/bin" to the env block.
The "respect" shortcut
The repo includes a Claude Code skill in skills/respect.
Copy it to your skills folder:
mkdir -p ~/.claude/skills && cp -r skills/respect ~/.claude/skills/Then type respect <link | video id | song name> (or /respect …) in Claude Code and
it downloads the MP3 right away. A few extras:
respect <song> 320downloads at 320 kbps.respect <link> againdownloads it again, even if you already have it.respect listshows what you've downloaded.
FAQ
Why yt-dlp and not a JavaScript library? JavaScript YouTube libraries break whenever YouTube changes its player, and often produce empty files. yt-dlp is actively maintained and fixes these within days.
Does it work on Windows and Linux? The server is plain Node.js and runs anywhere yt-dlp and ffmpeg do. The examples use macOS paths; adjust them for your system.
Can it download whole playlists? Not yet: it downloads one track per call and drops playlist parameters. Playlist support would make a good contribution.
Where do my files go?
~/Music/yt-audio-mcp by default, or wherever YT_AUDIO_DIR points.
Development
npm install
npm test # builds, then runs the unit tests in src/*.test.ts
npm run dev # rebuild on changePath | Purpose |
| MCP server and tool definitions |
| URL validation and the yt-dlp wrapper |
| Unit tests |
| The "respect" Claude Code skill |
Contributing
Bug reports and pull requests are welcome. See CONTRIBUTING.md,
or pick an issue labeled good first issue.
If yt-audio-mcp is useful to you, a ⭐ helps other people find it.
Disclaimer
This tool is for downloading content you have the right to download, such as your own uploads, Creative Commons or public-domain audio, or content whose owner allows it. Respect copyright and YouTube's Terms of Service. The authors are not responsible for how the tool is used.
License
MIT © Daniil Pak
Available Tools
3 toolsdownload_mp3Download MP3 from YouTubeA
Download the audio of a YouTube or YouTube Music video as an MP3 file. Files are saved to /root/Music/yt-audio-mcp. Already-downloaded videos are returned from disk unless force=true.
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | youtube.com / music.youtube.com / youtu.be link, or a bare 11-character video ID | |
| force | No | Re-download even if the file already exists | |
| bitrate | No | "0" = best VBR (default), or a fixed CBR bitrate | 0 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations only declare readOnlyHint=false and openWorldHint=true; the description adds real behavioral context beyond that: the exact on-disk destination (/root/Music/yt-audio-mcp) and the cache-then-refetch semantics tied to force. It still omits failure modes (invalid URL, geo-blocked or age-restricted video, network errors) and whether partial downloads are cleaned up.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with zero filler; the primary action and the artifact come first, and the caching caveat follows. Nothing is redundant with the title.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description carries the return-value burden and does state the destination path and the disk-cache return behavior, which is the key information. It stops short of saying what handle or metadata is actually returned to the caller (e.g. file path vs. confirmation), which would fully close the gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, and each parameter is already documented in the schema, including the force default and the bitrate enum. The description's only parameter-relevant addition is the force behavior, which largely restates the schema's 'Re-download even if the file already exists'. Baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (Download) plus resource (audio of a YouTube/YouTube Music video) and the output artifact (MP3 file). An agent can immediately tell this apart from search_youtube and list_downloads, which discover content and enumerate files rather than producing one.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives one concrete conditional rule ('Already-downloaded videos are returned from disk unless force=true'), which is useful. It never mentions the sibling tools, so it does not tell the agent to search first to obtain a URL or to use list_downloads to verify an existing file, leaving selection between tools to inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_downloadsList downloaded MP3sARead-only
List MP3 files already downloaded to /root/Music/yt-audio-mcp, newest first.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so the safety profile is covered. The description adds genuinely useful context beyond that: the concrete storage location and the 'newest first' ordering, which an agent cannot derive from the empty schema. It omits pagination/result-size behavior, keeping it from a 5.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence with the action, target, location, and ordering front-loaded. Every clause earns its place and nothing is padded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a no-parameter, read-only listing tool with no output schema, the description covers what is listed, where, and in what order. It could note the shape of the returned entries (filenames vs. metadata) since no output schema exists, but the gap is minor.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so the baseline is 4 and there is nothing for the description to clarify or compensate for. It adds no misleading parameter language either.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource ('List MP3 files already downloaded'), plus the exact directory and sort order, which cleanly separates it from the write-oriented download_mp3 and search_youtube siblings. It stops just short of 5 because it never names the alternatives it is contrasted with.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no explicit when-to-use statement, but the scope ('already downloaded to /root/Music/yt-audio-mcp') strongly implies this is a post-download inventory check rather than a discovery tool. No alternatives or exclusions are mentioned, so the guidance is only implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_youtubeSearch YouTubeARead-only
Search YouTube and return video IDs/URLs that can be passed to download_mp3.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| query | Yes | Search text, e.g. "artist - song title" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds value beyond that by disclosing the shape of the result (video IDs/URLs) in the absence of an output schema. It omits result ordering, pagination, and any rate-limit behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single front-loaded sentence with zero filler; the action, the return type, and the downstream consumer all appear immediately.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description correctly shoulders the return-value explanation (video IDs/URLs). Combined with the annotations and a mostly simple two-parameter schema, this is nearly complete; only limit semantics and empty-result behavior are unaddressed.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is only 50%: query is documented with an example format, but limit has no description anywhere. The tool description adds no parameter-level meaning at all, so the agent gets no guidance on what limit controls or what the default of 5 implies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ("Search YouTube") plus the concrete return payload ("video IDs/URLs"). It also names the downstream sibling download_mp3, so an agent can place it in the pipeline without opening any other tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description establishes clear context by saying results "can be passed to download_mp3," which tells the agent this is the search step that precedes downloading. It stops short of explicit when-not guidance or naming list_downloads as an alternative for retrieval of already-downloaded items.
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.
3 tool updates
v1.0.0- First observed
download_mp3 - First observed
list_downloads - First observed
search_youtube
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: search_youtube finds videos, download_mp3 fetches audio, list_downloads inspects the local library. No overlap or ambiguity exists between them.
All three follow a verb_noun pattern (search_youtube, download_mp3, list_downloads), which is mostly consistent. The only minor deviation is download_mp3 using a file format (mp3) as the noun rather than a resource like 'audio', but the pattern is still readable and predictable.
Three tools is well-scoped for a focused YouTube-audio downloader. Each tool earns its place and covers a distinct step in the workflow without bloat.
The core workflow (search, download, list) is fully covered. Minor gaps exist—no delete/remove downloaded files and no explicit overwrite/force management beyond the description note—but agents can work around these.
Maintenance
Related MCP Connectors
YouTube transcripts, search, channel browsing, and playlists for AI agents via MCP.
An MCP server that gives any LLM or agent clean YouTube transcripts on demand: a single video, a whole channel, or a playlist, plus AI cleanup of auto-generated captions. API-key auth, credit-based, same backend as the public v1 API. Get a free API key with 25 free credits at youtubetranscriptdownload.com/account.
MCP server for Producer/Riffusion AI music generation
An MCP server that gives your AI access to the source code and docs of all public github repos
Related MCP Servers
- AlicenseBqualityDmaintenanceA simple MCP server that allows AI assistants like Cursor or Claude Desktop to search for and play tracks on YouTube Music through natural language commands.221 npm12MIT
- AlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that provides YouTube data access without API keys or quotas. It enables agents to search videos, retrieve transcripts and metadata, and perform full-text search across cached content for AI context retrieval.3 npm-
- AlicenseAqualityAmaintenanceMCP server that provides YouTube video data to AI agents, supporting search, metadata, comments, and transcripts without an API key.69 npmISC
- AlicenseAqualityDmaintenanceMCP server that lets AI agents search YouTube and fetch transcripts.23MIT