yt-mcp
This server provides tools to access and analyze YouTube data using the YouTube Data API v3. It enables:
Channel Discovery (
find_channel): Resolve a channel by handle, URL, ID, or name, and retrieve statistics like subscriber count, video count, and description.Search Channel Videos (
search_channel_videos): Search within a channel using keywords, with options to sort by relevance, date, views, rating, or title, and filter by publication date. (Quota cost: 100 units per 50 results.)List Channel Videos (
list_channel_videos): List a channel's uploads newest first, with optional date range filtering and up to 200 results. (Quota: 1 unit per 50 videos.)Video Details (
get_video_details): Get a video's full description, extracted external links, tags, view/like/comment counts, duration, and publish date.Transcripts (
get_video_transcript): Retrieve timestamped transcripts with Markdown-linked timestamps, supporting language selection, time range limits, and caption merging. Transcripts incur no API quota cost.
Provides tools for searching YouTube channels, listing videos, fetching transcripts with timestamps, and retrieving video details with citations.
Click on "Install 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-mcpsearch MKBHD channel for the latest iphone review"
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.
Quiet repo, working server: the last badge is the date this server last served a tool call, published by the server itself. See "Usage signal".
Setup
Reads
YOUTUBE_API_KEYfrom.envat the project root;.env.exampleis the template.The key is a Google Cloud API key with "YouTube Data API v3" enabled.
uv syncinstalls.uv run yt-mcpserves MCP over stdio.claude mcp add yt -- uv run --directory "$PWD" yt-mcp, run from the repo root, registers it with Claude Code.
Related MCP server: YouTube MCP
Deployment
main.pyis the entrypoint hosts load, andfastmcp.jsonpoints atmain.py:mcp.Set the host's entrypoint to
main.py:mcp—src/yt_mcp/server.pyholds a bare server instance, because hosts load the entrypoint by file path and never run the package__init__.pythat registers the tools.YOUTUBE_API_KEYis read from the environment, so set it as a host secret; there is no.envin a deployment.Set proxy credentials as host secrets too, or
get_video_transcriptfails on every video while the other tools keep working — a host's IP is in a cloud range, and YouTube blocks those from caption tracks. See "Caption IP blocks".uv run fastmcp inspect main.py:mcpshows what a host will see, tool count included.USAGE_BADGE_TOKENis optional and only useful to this repository's owner; leave it unset. See "Usage signal".
Tools
search_channel_videossearches one channel's videos by keyword — search MKBHD channel for the latest iphone review.list_channel_videoslists a channel's videos newest first, filtered by date — everything from the last year.get_video_transcriptextracts a video's transcript with timestamps.get_video_detailsreturns a video's description, with the external links the creator cited pulled out for citation.find_channelresolves a channel and returns its stats.
References
Channels are given as
@mkbhd, a channel URL, aUC...id, or a channel name.Videos are given as an id or any watch /
youtu.be/ shorts URL.Date filters take relative offsets (
7d,6m,1y), dates (2025-01-31), or RFC 3339 timestamps; months and years are 30 and 365 days.
Transcripts
Lines are formatted
[[MM:SS]](watch url with &t=seconds) text, gaining an hour component past an hour —[[03:15]](https://www.youtube.com/watch?v=ID&t=195) the battery is 17% larger than previous year.The timestamp is a Markdown link that seeks to that moment, so a quoted line carries its own clickable citation; the link points at the start of the merged window, not the last cue in it.
chunk_secondsmerges caption cues into windows of that length;0keeps YouTube's raw cues.start_secondsandend_secondsnarrow a long video to one stretch.languagespicks the track by language code; with none given the video's original spoken language is used.Transcripts come from public caption tracks rather than the Data API, so they need no key and cost no quota.
Caption IP blocks
Caption tracks are served to the player rather than to the Data API, so YouTube judges the request by IP instead of by key: it blocks cloud provider ranges outright, and rate limits any single address that pulls transcripts in bulk. Both surface as
TranscriptBlockedError, and both are about the caller, not the video.A deployment therefore needs a proxy where a local checkout usually does not — the host's address is in a blocked range from the first request.
WEBSHARE_PROXY_USERNAMEandWEBSHARE_PROXY_PASSWORDroute captions through a rotating residential pool; set both. Rotation is what outlasts the rate limit, so this is the option to reach for.YOUTUBE_PROXY_URLroutes them through a single proxy instead, used forhttpandhttpsalike. It is simpler, and it gets banned in turn once enough requests come from that one address.Webshare wins when both are configured. With neither set, requests go direct.
The Data API tools are unaffected: they authenticate with the key and never hit this.
Usage signal
This is a signalling device for this repository's owner, not a feature of the server. If you are running yt-mcp for yourself, delete it — see "Removing it" below.
The problem it solves is a presentation one: a repository whose last commit is months old reads as abandoned, whether or not it is. This publishes the one fact that separates a finished project from a dead one — the date it last did work.
The middleware notes the UTC date of each tool call and, on the first call of a new date, commits
usage.jsonto this repository through the GitHub contents API. The README badge renders that file.One write per UTC day, not one per call. A process that has already published today does nothing at all on later calls.
The date is noted before the tool runs, so a call that ends in an error still counts. The server served a request either way.
What it records
One field:
{"last_used": "2026-08-10"}. A UTC date.Not tool names, not arguments, not channel handles, not video ids, not search queries, not call counts, not totals. None of those are collected, so none of them can leak — which matters, because this repository is public and so is
usage.json.It reveals when the server was last used, which cuts both ways: the badge advertises a lapse as plainly as it advertises activity.
Turning it on
Unset
USAGE_BADGE_TOKENis the default and the recommended state. With no token the middleware is never registered, so nothing inusage.pyruns and a tool call costs exactly what it costs without the feature.With a token set, the signal is on.
USAGE_BADGE_TOKENdeliberately is not namedGITHUB_TOKEN: GitHub Actions injects that name automatically, which would switch the signal on inside CI.The token is a fine-grained personal access token with Contents: read and write on this repository and nothing else. Set it as a host secret next to
YOUTUBE_API_KEY— it never belongs in the repository, and.envis gitignored.REPOSITORYinsrc/yt_mcp/usage.pynames the target. A fork that keeps this module writes to the upstream repository and is refused, which is a reason to delete rather than reconfigure.
What it costs
One commit per active day, authored by whoever owns the token, on top of whatever real history the repository has.
A
contents: writetoken inside a running server. Fine-grained tokens cannot be scoped to a single file, so that token can push anything to this repository. That is the trade the feature makes for keeping its log in the repository instead of somewhere else.Nothing on the request path. The write runs as a background task; no caller waits on GitHub.
When it fails
Every failure is swallowed and logged at warning level. A tool call never fails because the badge did not update.
A failed write releases the day, so the next tool call tries again. There is no retry loop.
Two workers racing to publish the same date is a non-event: the second sees the file already current, or gets a stale-sha rejection, and treats either as done.
Removing it
Five deletions, in any order. Nothing else references any of it.
Delete | |
| the mechanism |
| its tests |
the import and | unregisters it |
| removes the published date and its docs |
| removes the last trace |
httpx in pyproject.toml is there for this feature alone, though it arrives as a fastmcp dependency regardless.
Quota
The default daily quota is 10,000 units.
search_channel_videoscosts 100 units per 50 results, plus 1 to hydrate them.list_channel_videoswalks the channel's uploads playlist and costs 1 unit per 50 videos walked, plus 1 per 50 hydrated.find_channelandget_video_detailscost 1 unit.get_video_transcriptcosts nothing.Channel lookups are memoised for the life of the process.
Development
uv run pytestruns the suite.lint-py src testsruns ruff format, ruff check, ty and complexipy.The Data API layer is covered against a faked client; only the transcript path touches the network.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceAn MCP server that enables interaction with the YouTube Data API, allowing users to search videos, get video and channel details, analyze trends, and fetch video transcripts.
- AlicenseAqualityDmaintenanceAn MCP server that enables users to retrieve YouTube transcripts and perform video or channel searches without requiring Google API keys. It supports transcript chunking and provides tools for detailed video content analysis and channel metadata extraction.5344MIT
- AlicenseAqualityCmaintenanceAn MCP server that enables the extraction of transcripts and detailed metadata from YouTube videos. It allows users to retrieve video information like titles and descriptions, as well as transcripts with optional timestamps and language selection.2MIT
- AlicenseAqualityDmaintenanceMCP server that provides YouTube video data to AI agents, supporting search, metadata, comments, and transcripts without an API key.512MIT
Related MCP Connectors
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for Google Veo AI video generation
YouTube MCP — wraps the YouTube Data API v3 (BYO API key)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/guyvandam/yt-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server