YouTube MCP Server
YouTube MCP 服务器
一个托管的模型上下文协议(MCP)服务器,为 Claude、Cursor、Windsurf 以及任何其他 MCP 客户端提供四个只读的 YouTube 工具。搜索 YouTube、读取视频和频道数据、获取字幕,无需 Google Cloud 项目,也无需 YouTube Data API 密钥。
https://mcp.hasdata.com/api/mcp?apis=youtube
目录
Related MCP server: YouTube MCP Server
你需要什么
一个支持流式 HTTP 并带自定义请求头的 MCP 客户端。一个来自仪表盘的 HasData API 密钥,免费创建。仅此而已。这是一个远程服务器。无需安装任何包,无需运行任何容器,整个流程中也不需要任何 Google 账户。
快速开始
服务器 URL 对所有客户端都是相同的。我们在 Claude Code 和 Claude Desktop 中进行了实际操作验证。其他配置块遵循各客户端自己文档中关于远程服务器的格式。
字段 | 值 |
URL |
|
传输方式 | HTTP,流式 |
认证请求头 |
|
支持 OAuth 的客户端可以将相同的 URL 添加为连接器,无需在配置文件中放置密钥即可登录。
claude mcp add --transport http youtube "https://mcp.hasdata.com/api/mcp?apis=youtube" \
--header "x-api-key: HASDATA_API_KEY"设置,然后连接器,然后添加自定义连接器,然后粘贴 https://mcp.hasdata.com/api/mcp?apis=youtube 并登录。
对于配置文件方式,Claude Desktop 只加载本地(stdio)服务器,因此远程服务器需要通过 mcp-remote 桥接器访问,这需要 Node。将此添加到 claude_desktop_config.json:
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.hasdata.com/api/mcp?apis=youtube",
"--header",
"x-api-key:HASDATA_API_KEY"
]
}
}
}x-api-key: 的值在冒号后没有空格。Claude Desktop 在传递参数时不经过 shell,空格会拆分请求头。
~/.cursor/mcp.json 适用于所有项目,或 .cursor/mcp.json 适用于单个项目:
{
"mcpServers": {
"youtube": {
"url": "https://mcp.hasdata.com/api/mcp?apis=youtube",
"headers": { "x-api-key": "HASDATA_API_KEY" }
}
}
}~/.codeium/windsurf/mcp_config.json。Windsurf 将该字段称为 serverUrl,而不是 url:
{
"mcpServers": {
"youtube": {
"serverUrl": "https://mcp.hasdata.com/api/mcp?apis=youtube",
"headers": { "x-api-key": "HASDATA_API_KEY" }
}
}
}{
"mcpServers": {
"youtube": {
"url": "https://mcp.hasdata.com/api/mcp?apis=youtube",
"type": "streamableHttp",
"headers": { "x-api-key": "HASDATA_API_KEY" },
"disabled": false
}
}
}工作区中的 .vscode/mcp.json:
{
"servers": {
"youtube": {
"type": "http",
"url": "https://mcp.hasdata.com/api/mcp?apis=youtube",
"headers": { "x-api-key": "HASDATA_API_KEY" }
}
}
}~/.codex/config.toml:
[mcp_servers.youtube]
url = "https://mcp.hasdata.com/api/mcp?apis=youtube"
[mcp_servers.youtube.headers]
"x-api-key" = "HASDATA_API_KEY"~/.gemini/settings.json:
{
"mcpServers": {
"youtube": {
"httpUrl": "https://mcp.hasdata.com/api/mcp?apis=youtube",
"headers": { "x-api-key": "HASDATA_API_KEY" }
}
}
}示例提示词
提示词,而非代码。粘贴一个进去,代理会自动选择工具。每个提示词都标注了它所需的调用次数,因为在 MCP 中,模型决定进行多少次调用,而每次成功调用消耗 10 个积分。
查找上个月关于模型上下文协议观看次数最多的十个视频,然后提取排名第一的视频的字幕,并告诉我它对工具调用提出的三个主张。
两次调用,20 积分。
获取频道 @GoogleDevelopers。列出它发布的标签页,然后总结最近五个上传视频,并告诉我哪些主题重复出现。
两次调用,20 积分。读取你尚未见过的标签页需要第二次调用,因为标签页列表包含在第一次响应中。
获取这个视频 ID,dQw4w9WgXcQ。获取其统计数据,然后检查它的相关视频中有哪些来自同一频道。
一次调用,10 积分。相关视频随同一响应一起返回。
在 YouTube 上搜索"网页抓取教程",按上传日期排序,仅限四分钟以内的视频,并给我每个有章节的结果的章节标题。
一次调用,10 积分。
如果存在的话,提取这个视频的德语字幕,并告诉我它支持哪些语言。
一次调用,10 积分。
搜索接受 YouTube 自己的过滤标记,代理无需后处理即可按时长、上传日期和内容类型进行筛选。字幕随可用语言轨道的列表一起返回,这让代理无需猜测即可选择。
分页每次都会消耗一次调用。一个研究提示词如果搜索一次、翻页两次、然后提取三个字幕,那就是六次调用、60 积分。试用额度在回答窄范围问题上比在开放式爬取上更经用。
工具
四个工具,全部只读。以下示例是从真实调用中截取的,其中的数字会随着 YouTube 的更新而变化。请将它们视为数据结构示例。每个工具名称都链接到其端点参考文档,其中包含完整的字段列表。
示例是负载(payload),而非完整响应。tools/call 结果包含一个文本块,该文本本身是 JSON,包含 url、status、text 和 json,抓取的数据位于 json 下。从原始 JSON-RPC 响应来看,路径是 result.content[0].text,解析后取 .json。聊天客户端会为你解包这些内容,而直接与端点通信的代码则不会。
获取 YouTube 搜索结果
hasdata_youtube_search_getYoutubeSearchResults
搜索 YouTube 并返回整个结果页面,按结果类型拆分。
参数 | 类型 | 必填 | 说明 |
| string | 是 | 自由文本查询,与用户输入方式完全一致 |
| string | 默认为 | |
| string | 相对于当前时间的上传时间窗口 | |
| string | 时长分桶,例如 | |
| string | 限制为一种内容类型 | |
| array | 功能标志,可组合使用 | |
| string | 从搜索 URL 复制的原始 YouTube | |
| string | 上一次响应中的 | |
| string | 两位字母的国家和语言代码,以及设备类型 |
结果页面被拆分为 videoResults、shortsResults、inlineShortsResults、playlistResults、channelResults 和 shelves,付费展示位于 adsResults 和 sponsoredResults 中。哪些块出现取决于查询,没有内容的块是缺失的,而不是空的。在迭代之前请先测试键是否存在。searchInformation 携带总数,pagination.nextPageToken 是你回传为 paginationToken 的内容。广告永远不会混入自然结果数组中,不过有两个广告数组需要跳过。
{
"positionOnPage": 1,
"videoId": "GuTcle5edjk",
"title": "you need to learn MCP RIGHT NOW!! (Model Context Protocol)",
"viewsOriginal": "1.6M views",
"views": 1653824,
"length": "38:40",
"publishedDate": "11 months ago",
"extensions": ["4K"],
"chapters": [
{ "title": "Intro", "time": "0:00" },
{ "title": "Problem: LLMs Suck at Accessing Code", "time": "0:40" }
],
"channel": { "name": "NetworkChuck", "verified": true }
}那里有两件事值得一提。views 是解析后的整数,紧挨着 1.6M views 显示字符串,无需后缀解析器。另外,chapters 会出现在搜索结果中,而不仅仅在视频本身中,不过只有部分视频带有章节。
搜索端点参考文档列出了端点接受的所有 sp 和 filters__ 标记。
获取 YouTube 视频数据
hasdata_youtube_video_getYoutubeVideo
按 ID 获取单个视频。
参数 | 类型 | 必填 | 说明 |
| string | 是 | 来自 |
| string | 两位字母的国家和语言代码,以及设备类型 |
返回 title、thumbnail、channel、publishedDate、lengthSeconds、category、isFamilySafe 和 isUnlisted,以及 relatedVideos、endScreenVideos、keywords、captions、music 和 socialLinks 数组。description 是一个对象,在 content 中保存完整文本,并有一个 links 数组,其中每个链接和话题标签都带有 startIndex、length、text 和 url。text 字段保存作者书写的链接原文,url 保存 YouTube 的重定向包装器,如果你要从描述中提取赞助商或联盟营销目标链接,这一点很重要。
在复制下面的示例之前,请按工具名称阅读解析字段。搜索和频道结果将解析后的数字放在
views中,将显示字符串放在viewsOriginal中。此响应则相反,将字符串保留在views中,将数字放在extractedViews中,likes和subscribers也采用同样的反转方式。搞错了的话,item.views > 100000在这里会比较字符串,而且永远不会抛出异常。
{
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"views": "1,806,075,152 views",
"extractedViews": 1806075152,
"likes": "19M",
"extractedLikes": 19344370,
"publishedDate": "Oct 24, 2009",
"lengthSeconds": 214,
"category": "Music",
"channel": { "name": "Rick Astley", "subscribers": "4.53M subscribers", "extractedSubscribers": 4530000 }
}获取 YouTube 频道数据
hasdata_youtube_channel_getYoutubeChannel
按 ID 或句柄获取频道,一次一个标签页。
参数 | 类型 | 必填 | 备注 |
| string | 是 | 规范的 |
| string | 默认为 | |
| string | 上一次响应中的令牌 | |
| string | 两位字母的国家代码、语言代码和设备 |
默认标签页返回 channelInfo、featuredVideo 和 sections。其他标签页返回各自的形状。channelInfo 携带句柄、头像、横幅、描述、频道关键词以及频道的 rssUrl,足以在不轮询的情况下持续关注某个频道。
下面示例中的
availableTabs数组保存的是显示标签,它们不是tab接受的取值。Home、Live、Courses和Search不对应任何参数值,其余的需要转成小写。一个读取该列表并逐项遍历的代理会在第一项上失败。
{
"channelInfo": {
"channelId": "UC_x5XG1OV2P6uZZ5FSM9Ttw",
"name": "Google for Developers",
"handle": "@GoogleDevelopers",
"rssUrl": "https://www.youtube.com/feeds/videos.xml?channel_id=UC_x5XG1OV2P6uZZ5FSM9Ttw",
"isFamilySafe": true,
"availableTabs": ["Home", "Videos", "Shorts", "Live", "Courses", "Playlists", "Posts", "Search"]
}
}获取 YouTube 视频转录
hasdata_youtube_transcript_getYoutubeTranscript
视频的带时间戳的转录文本。
参数 | 类型 | 必填 | 备注 |
| string | 是 | 11 个字符的视频 ID |
| string | 你想要的轨道的 BCP-47 代码 | |
| string | 设置为 |
在信任语言之前,先检查响应中的
selected。请求视频不包含的languageCode既不会失败也不会返回空,而是静默回退到默认轨道。列表中的每个条目都带有languageName和languageCode,一种语言可能出现两次,一次是人工编写的,一次是type设置为asr的。
{
"transcript": [
{ "startMs": 320, "endMs": 18800, "snippet": "[Music]", "startTimeText": "0:00" },
{ "startMs": 18800, "endMs": 21800, "snippet": "We're no strangers to", "startTimeText": "0:18" }
],
"availableTranscripts": [
{ "languageName": "English", "languageCode": "en" },
{ "languageName": "English", "languageCode": "en", "type": "asr", "selected": true },
{ "languageName": "German (Germany)", "languageCode": "de-DE" },
{ "languageName": "Japanese", "languageCode": "ja" }
]
}错误与失败路径
你的客户端几乎从不会在工具调用中看到 HTTP 错误码。MCP 层返回 200,并把失败放在结果内部,isError 设置为 true,原因以文本形式给出。代理读到的是消息,而不是你可能预期的状态行。
错误的密钥以工具输出的形式出现,而不是连接失败。 tools/list 接受任何非空密钥并返回全部四个工具,因此客户端完成握手并显示绿色。随后第一次工具调用返回 isError: true 和文本 HasData API error: 401 Unauthorized。注意这个字符串,因为流程中更早的阶段不会报告该问题。
缺少密钥是唯一真正的 HTTP 错误。 授权在任何工具之前运行,连接本身以 401 失败。CORS 头存在,浏览器客户端读取的是状态,而不是不透明的网络失败。
破坏工具模式的参数会在成为抓取之前被拒绝。 服务器以 isError: true 和文本 MCP error -32602: Input validation error 回应,并指出违规字段。不会抓取任何内容,也不会产生任何费用。消息指出字段名,但不指出可接受的值,因此上面的参数表是参考。
调用成功但找不到任何内容的情况最容易让人上当。 它以普通结果的形式到达,requestMetadata.status 设置为 ok,而数据键直接缺失。响应体中没有任何内容说明结果为空。要测试你需要的字段,而不是错误。
平台拒绝的标识符返回 400,requestMetadata.status 设置为 error。不存在的频道句柄是常见的触发方式。
携带数据的结果也带有 requestMetadata.id,在支持工单中值得引用。
定价、免费层与限制
每个 YouTube 工具每次成功调用花费 10 个积分。响应大小不改变价格。一整页搜索结果与只有一条视频的页面花费相同。
免费试用是 30 天内 1,000 个积分,无需绑卡,即 100 次 YouTube 调用。之后,活跃账户在余额低于 100 时每天会补充 100 个积分,因此低流量的代理可以无限期地在免费层运行。
付费套餐起价为 每月 $49,包含 200,000 个积分,即 20,000 次调用。单价随用量下降,从入门套餐的 每 1,000 次调用 $2.45,到 Business 的 $0.99、Growth 的 $0.83,以及最大的 高用量套餐 的 $0.75。
你的套餐还决定并发数。免费试用允许同时 1 个请求,Startup 为 15,Business 为 30,Growth 为 50,高用量套餐从 200 到 1,500。在任何无人值守的场景中都要防御性地处理溢出情况,因为扇出的代理会先于你触达上限。
返回非 200 的请求不计费。成功但找不到任何内容的调用仍然算一次调用。
工具选择
apis 查询参数决定你的代理能看到哪些工具。工具越少,花在工具定义上的上下文就越少,模型选错工具的机会也越少。
?apis=youtube the four tools in this repo
?apis=youtube,google_serp add Google search
?apis=youtube,tiktok,instagram a social research bundle该参数接受 youtube 这样的提供商名称和 google_maps_search 这样的单个 API 名称。拼写错误的名称会被忽略。如果所有名称都错误,请求以 400 失败,响应体会列出它无法识别的名称以及所有有效值。去掉该参数,同一端点会暴露全部 57 个 HasData 工具。
对比
与官方的 YouTube Data API v3 相比:
YouTube Data API v3 | 本服务器 | |
设置 | Google Cloud 项目和 API 密钥 | 一个密钥和一个 URL |
搜索配额 | 每天"默认配额分配 100 次 | 你套餐的积分,每次调用 10 个 |
非你所有视频的转录 |
| 支持,附带语言列表 |
搜索结果中的章节 | 无 | 有 |
搜索结果中的观看次数和点赞数 | 缺失,需要第二次 | 同一响应中同时给出显示字符串和整数 |
费用 | 每日配额内免费 | 试用期后付费,每次调用 10 个积分 |
写入与私有数据 | 通过 OAuth 上传、播放列表、评论和你自己的分析 | 只读,仅公开数据 |
最后两行很重要。如果每日配额覆盖你的用量,并且你拥有所查询的频道,那么官方 API 是更便宜的选择,你应该采用它。
大多数其他 YouTube MCP 服务器只做转录。本服务器还能搜索、读取带互动数据的视频,并遍历频道标签页,因此代理无需第二个服务器即可完成整个研究流程。
本服务器不做什么。 没有评论、没有频道管理、没有上传、没有分析、没有私有数据。它只读取未登录访客能看到的内容。
常见问题
有官方的 YouTube MCP 服务器吗?
Google 没有发布。YouTube 没有第一方 MCP 服务器。每个选项都是由其他人构建的,要么围绕 YouTube Data API v3,要么围绕公开页面。本服务器由 HasData 维护,读取公开页面,因此不需要 Google 凭据。
什么是 YouTube MCP 服务器?
一种将 YouTube 数据以工具形式暴露给 AI 客户端调用的服务器。客户端通过 Model Context Protocol 发送工具调用,服务器获取数据并返回结构化 JSON,模型处理结果,永远不会看到 HTML 页面。本服务器暴露四个工具并远程运行。客户端连接到一个 URL,不启动任何本地进程。
我需要 YouTube API 密钥或 Google Cloud 项目吗?
不需要。唯一的凭据是你的 HasData 密钥。无需创建 Google Cloud 项目、填写配额表单或面对 OAuth 同意屏幕,因为这些工具读取的是公开的 YouTube 页面,而不是 YouTube Data API。
我需要托管或运行什么吗?
不需要。这是一个基于 streamable HTTP 的远程 MCP 服务器。无需安装任何东西,无需保持容器运行,无需重启进程。
数据是实时的还是缓存的?
实时的。每次调用在请求时获取页面,并带有自己的 requestMetadata.id。两次相同的调用是两次独立的抓取,而不是重放存储的副本。观看次数和点赞数等计数器跟随页面,因此它们会随页面变化而变化。
当 YouTube 改变布局时会发生什么?
你这边什么都不会发生。我们跟踪变化并保持响应模式稳定,因此字段名和类型保持不变。没有值的字段在条目中缺失,而不是存在且为 null。读取可选字段时使用默认值。
我可以将它与其它 HasData API 一起使用吗?
可以。apis 参数接受一个列表,?apis=youtube,google_serp 会给你的代理四个 YouTube 工具加上 Google 搜索。去掉该参数 即可获得全部工具。
我可以获取任何视频的转录吗?
只有在视频有转录的情况下才可以,availableTranscripts 会在你请求之前告诉你存在哪些转录。
我可以使用 OAuth 登录而不是粘贴密钥吗?
可以,在支持它的客户端中可以。Claude Desktop 和 Cursor 可以将端点添加为连接器并登录。无人值守的代理和脚本使用 x-api-key 头。
合规与个人数据
HasData 仅访问公开可用的数据。平台的条款可能限制自动化访问,您需自行负责合规。当您收集的数据包含个人信息时,请确保您依据 GDPR、CCPA 或您所在司法辖区的等效规则拥有合法的处理依据。
HasData 链接
产品页面与请求构建器 | |
服务器文档 | |
一个服务器中的全部 57 个工具 | |
客户端演练 | |
我们抓取的其他所有内容 | |
套餐与积分费用 | |
密钥与用量 |
开发
此仓库是远程服务器的配置与文档。没有构建步骤,也无需容器化。
test/ 中的测试断言工具契约,即无需在此提交就可能被破坏的部分。它们检查 ?apis=youtube 恰好返回四个工具、每个工具仍声明其必需参数、没有名称发生变化,以及正在使用的密钥确实被接受。最后一项检查会真实调用一个工具并消耗 10 积分,这是金丝雀测试的代价,它可能因正确的原因而失败。
# macOS and Linux
HASDATA_API_KEY=your_key_here npm test
# Windows PowerShell
$env:HASDATA_API_KEY="your_key_here"; npm test同一套测试在每次推送时以及每周定时在 CI 中运行,因为上游工具列表可能在本仓库无人改动的情况下发生变化。失败意味着工具列表发生了变动、密钥停止工作或端点无法访问,断言消息会指明具体原因。
贡献
对工具表格和响应示例的修正是最有价值的贡献,因为这些部分最容易发生漂移。请附上您发出的调用和收到的响应。来自 fork 的拉取请求会在没有密钥的情况下运行测试套件,实时检查会跳过而不是报红。
许可证
MIT。参见 LICENSE。
Available Tools
4 toolshasdata_youtube_channel_getYoutubeChannelyoutube_channel: GET /AInspect
Get YouTube Channel Data
Fetches a YouTube channel by its ID (UC…) or handle (@name) and returns structured data for any channel tab — featured/Home, videos, shorts, streams, playlists, posts, podcasts, releases, store, about. Returns channel identity (title, description, avatar, banner, country, join date), subscriber and total-view counts, social links, and the items on the requested tab (videos with views and publish date, playlists, posts, podcasts, etc.). Use to monitor competitor channels, build creator/brand directories, track posting cadence and growth signals, or feed videoId into the YouTube Video / Transcript endpoints.
| Name | Required | Description | Default |
|---|---|---|---|
| gl | No | The two-letter country code for the country you want to limit the search to. Provide one exact documented value (245 allowed), e.g. `ac`, `af`. | |
| hl | No | The two-letter language code for the language you want to use for the search. Provide one exact documented value (159 allowed), e.g. `af`, `ak`. | |
| tab | No | Channel tab to scrape. Each tab returns a different content shape: - `featured` (default) — channel Home page (channel trailer + curated rows) - `videos` — uploaded long-form videos - `shorts` — Shorts feed - `streams` — past and upcoming live streams - `playlists` — created and saved playlists - `posts` / `community` — community posts - `podcasts` — podcast episodes - `releases` — music releases - `about` — channel description, links, stats - `store` — channel merch | |
| channelId | Yes | YouTube channel identifier — either the canonical channel ID (`UC…`, 24 chars) or the public handle starting with `@` (e.g. `@PewDiePie`). Legacy `/c/<custom>` and `/user/<name>` URL slugs are also accepted. | |
| deviceType | No | Device type for the request. | |
| paginationToken | No | Token returned in the previous response to fetch the next page of results. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden, and it does well: it states what is fetched, which tabs are supported, what channel-level fields are returned, and how results can be reused. It does not mention rate limits, authentication, or explicit read-only status, but the verb 'Fetches' and the GET-style title make the operation's nature clear.
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?
The description is dense but well-organized: it starts with the core fetch behavior, then explains output fields, then lists concrete use cases. Every sentence adds value; only minor redundancy exists between the description's tab list and the schema's tab enum.
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 tool with no output schema and no annotations, the description provides a solid mental model of inputs, outputs, tabs, and downstream use. It could go deeper on pagination/response structure, but the schema already covers paginationToken, and the description sufficiently explains what an agent can expect from the result.
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 description coverage is 100%, so the schema already documents every parameter. The description reinforces channelId's accepted formats and explains the meaning of tab-level output, but it does not add significant meaning beyond the schema for gl, hl, deviceType, or paginationToken. 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?
The description opens with a specific verb ('Fetches a YouTube channel by its ID or handle') and clearly distinguishes the tool from YouTube search, video, and transcript siblings by focusing on channel-level data and per-tab content. It names concrete output types, making the tool's purpose unmistakable.
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 clear application contexts ('monitor competitor channels, build creator/brand directories, track posting cadence and growth signals') and even routes downstream usage to the YouTube Video/Transcript endpoints. It does not explicitly list when not to use this tool versus search or video endpoints, but the use cases are concrete enough for an agent to decide.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
hasdata_youtube_search_getYoutubeSearchResultsyoutube_search: GET /AInspect
Get YouTube Search Results
Searches YouTube for a query and returns the full results page split into videoResults (videoId, title, views, length, publish date, chapters, channel info, extensions like 4K/CC), channelResults (channelId, handle, subscribers, verified flag), shortsResults / inlineShortsResults, themed shelves (e.g. 'People also watched', 'Latest from '), adsResults and sponsoredResults (advertiser, landing URL, position), plus searchInformation.totalResults. Each block preserves its positionOnPage so the original layout is reconstructable. Use for competitor and topic monitoring, brand-mention tracking, ad-placement intelligence, creator discovery, trend research, or to feed videoId / channelId into the YouTube Video, Channel, or Transcript endpoints.
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | Free-text search query, exactly as a user would type it into the YouTube search box. | |
| gl | No | The two-letter country code for the country you want to limit the search to. Provide one exact documented value (245 allowed), e.g. `ac`, `af`. | |
| hl | No | The two-letter language code for the language you want to use for the search. Provide one exact documented value (159 allowed), e.g. `af`, `ak`. | |
| sp | No | Raw YouTube `sp` filter token, copied verbatim from a YouTube search URL (e.g. `EgIQAQ%253D%253D`). When provided, it overrides `sortBy`, `date`, `videoType`, `length`, and `filters[]`. Use only if you need a YouTube-side filter that this API does not expose as a structured parameter. | |
| date | No | Limit results to videos uploaded within this time window relative to now. | |
| length | No | Filter by video duration bucket: - `under4` — under 4 minutes - `between420` — 4 to 20 minutes - `plus20` — over 20 minutes | |
| sortBy | No | Sort order applied to the results page. `relevance` (default) — best match for the query; `date` — newest first; `views` — most viewed first; `rating` — highest rated first; `popularity` — trending/most popular. | |
| filters__ | No | Feature flags to require on results. Multiple values are combined with AND (every flag must apply). - `hd` — HD quality - `k4` — 4K quality - `hdr` — HDR - `subtitles` — has subtitles/closed captions - `cc` — Creative Commons license - `d3` — 3D video - `d360` — 360° video - `vr180` — VR180 video - `live` — currently live - `bought` — purchased/paid content - `location` — has a geographic location tag | |
| videoType | No | Restrict results to a single YouTube content type — regular videos, Shorts, channels, playlists, or movies. | |
| deviceType | No | Device type for the request. | |
| paginationToken | No | Token returned in the previous response to fetch the next page. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description makes clear this is a read-oriented search operation that returns a results page, but no annotations are present and it does not explicitly mention authentication, rate limits, error behavior, or confirm there are no side effects. The read-only nature is implied rather than fully disclosed.
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?
The description is dense but every clause earns its place: the first sentence front-loads the purpose and output structure, and the second sentence explains real-world use cases and relationships to sibling tools. There is no redundant filler or repeated schema content.
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?
Given there is no output schema, the description thoroughly covers the response shape (videoResults, channelResults, shortsResults, shelves, adsResults, sponsoredResults, positionOnPage) and gives downstream usage context. Pagination is also covered indirectly through the paginationToken parameter, making the tool self-contained enough for an agent.
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 input schema already provides 100% descriptive coverage of all 11 parameters, including enums and the sp override behavior. The description itself adds no parameter-level meaning beyond that, so it sits at the baseline for a fully documented schema.
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?
The description opens with 'Searches YouTube for a query' and precisely identifies the resource and action, and it enumerates the distinct result sections returned. This makes the tool's purpose unmistakable and distinguishes it from the channel, video, and transcript sibling tools.
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?
It explicitly lists concrete use cases (competitor monitoring, brand tracking, ad-placement intelligence, creator discovery, trend research) and tells agents to feed returned videoId/channelId into the Video, Channel, or Transcript endpoints. This provides clear guidance on when to use the search tool versus its siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
hasdata_youtube_transcript_getYoutubeTranscriptyoutube_transcript: GET /AInspect
Get YouTube Video Transcript
Returns the timed transcript (subtitles) of a YouTube video by its 11-character videoId. languageCode selects the track (e.g. en, de-DE, pt-BR); type=asr requests the auto-generated speech-recognition track. Each segment in transcript[] carries startMs, endMs, snippet, and a formatted startTimeText. The response also includes availableTranscripts[] listing every track on the video (language name + code, type: asr for auto-generated, selected: true for the one returned) so callers can discover what else is available. Use to feed a video's spoken content into RAG/LLM pipelines, generate summaries or chapter outlines, build searchable archives, run translation or accessibility workflows, or analyze talking points across a creator's catalog (pair with the YouTube Channel endpoint to enumerate videos, then fetch transcripts).
| Name | Required | Description | Default |
|---|---|---|---|
| v | Yes | 11-character YouTube video ID — the value of the `v=` query parameter in a watch URL (e.g. `dQw4w9WgXcQ` for `https://www.youtube.com/watch?v=dQw4w9WgXcQ`). | |
| type | No | Set to `asr` to fetch the YouTube auto-generated (speech-recognition) track. Omit to fetch the human-authored track for `languageCode` when one exists. | |
| languageCode | No | BCP-47 / YouTube language code of the transcript track to return (e.g. `en`, `de`, `en-US`, `pt-BR`). Must match a track that the video actually has. When omitted, the video's default language track is returned. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and does well by explaining the response shape: transcript segments with startMs/endMs/snippet/startTimeText, plus availableTranscripts[] with language/type/selected info. It does not cover error cases such as missing tracks or invalid video IDs, but the behavioral context is strong.
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?
The description is well-structured and front-loaded, leading with the core purpose before expanding into response details and use cases. Every sentence adds meaningful context, with no filler or repetition.
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?
Despite having no output schema, the description thoroughly explains the return value structure and available track discovery. Combined with the complete parameter schema, an agent has enough information to select and invoke this tool correctly for transcript-related tasks.
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 schema already describes all three parameters with 100% coverage, so the baseline is 3. The description reinforces languageCode and type=asr semantics but adds little beyond what the schema already states; the v parameter is already fully documented in the schema.
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?
The description clearly states it returns the timed transcript (subtitles) of a YouTube video by 11-character videoId. This is a specific verb+resource that is naturally distinct from the sibling channel/search/video endpoints.
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?
It provides concrete use cases such as RAG/LLM pipelines, summaries, archives, translation, and accessibility workflows. It also suggests pairing with the YouTube Channel endpoint to enumerate videos, but it does not explicitly contrast with the search or video siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
hasdata_youtube_video_getYoutubeVideoyoutube_video: GET /AInspect
Get YouTube Video Data
Fetches a single YouTube video by its 11-character videoId. Returns title, thumbnail, raw + normalized views and likes, lengthSeconds, publish date, category, keywords/tags, isFamilySafe / isUnlisted flags, the uploading channel (id, handle, subscribers, avatar), the full description with parsed links and hashtags, available captions tracks (with kind: asr for auto-generated), Content-ID music matches (song/artist/album), creator socialLinks, and the relatedVideos, endScreenVideos, and relatedShorts rails. Use to enrich a video URL with metadata, monitor view/like growth, extract music or sponsor/affiliate links, gather features for recommender or RAG pipelines, or detect caption tracks before calling the YouTube Transcript endpoint.
| Name | Required | Description | Default |
|---|---|---|---|
| v | Yes | 11-character YouTube video ID — the value of the `v=` query parameter in a watch URL (e.g. `dQw4w9WgXcQ` for `https://www.youtube.com/watch?v=dQw4w9WgXcQ`). | |
| gl | No | The two-letter country code for the country you want to limit the search to. Provide one exact documented value (245 allowed), e.g. `ac`, `af`. | |
| hl | No | The two-letter language code for the language you want to use for the search. Provide one exact documented value (159 allowed), e.g. `af`, `ak`. | |
| deviceType | No | Device type for the request. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It clearly indicates a read-only fetch and provides rich output semantics: raw + normalized views/likes, safety/unlisted flags, captions with kind:asr, Content-ID music matches, social links, and related rails. It omits error handling, auth, and rate limits, but for a GET-style data tool the described behavior is substantially transparent.
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?
The description is long but information-dense: it front-loads the core purpose, then systematically lists return fields and use cases without filler. It could be structured into shorter sentences, but every clause adds relevant information for a tool with a rich payload.
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?
Given no output schema and no annotations, the description compensates well by enumerating the full return surface and tying usage to the transcript sibling. Minor gaps remain around error cases and access requirements, but an agent has enough to invoke the tool correctly for typical metadata enrichment tasks.
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 description coverage is 100%, and all four parameters (v, gl, hl, deviceType) are already documented with types, examples, and allowed values. The description only repeats the videoId concept and does not add meaning beyond the schema, so 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?
The description states a specific verb ('Fetches') and resource ('a single YouTube video by its 11-character videoId') and enumerates the returned fields in detail. It is clearly distinct from the sibling channel/search/transcript tools because it is scoped to video metadata.
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 lists concrete use cases: enriching video URLs, monitoring view/like growth, extracting music or affiliate links, building recommender/RAG features, and detecting caption tracks before calling the YouTube Transcript endpoint. It does not explicitly state when not to use the tool, but the context is clear enough for an agent to select it.
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.
4 tool updates
v1.0.0- First observed
hasdata_youtube_channel_getYoutubeChannel - First observed
hasdata_youtube_search_getYoutubeSearchResults - First observed
hasdata_youtube_transcript_getYoutubeTranscript - First observed
hasdata_youtube_video_getYoutubeVideo
TDQS
Scored across 4 tools
Each tool targets a clearly distinct resource: channel data, search results, transcripts, and video metadata. There is no overlap in purpose—the channel tool returns channel/playlist info, search returns result blocks, transcript returns timed subtitles, and video returns single-video metadata. An agent would have no trouble selecting the right tool for a given task.
All four tools follow the identical `hasdata_youtube_<domain>_getYoutube<Domain>` pattern (e.g., `hasdata_youtube_channel_getYoutubeChannel`). The naming is fully consistent in structure, verb, and case, making it predictable and easy to remember.
The server exposes exactly four tools, which is well-scoped for a YouTube data retrieval purpose. It covers the core read operations—channel lookup, search, transcript, and video details—without unnecessary bloat. Each tool earns its place, and the count is neither too thin nor excessive.
The tool set covers the primary read-only workflows for YouTube: fetching channel data (including playlists and posts), searching, retrieving video metadata, and getting transcripts. Minor gaps exist, such as a dedicated method for channel video lists (though the channel tool can fetch the videos tab) or comments, but the core lifecycle for data retrieval is well covered. Agents can achieve most tasks without dead ends.
Maintenance
Related MCP Connectors
YouTube transcripts, search, channel browsing, and playlists for AI agents via MCP.
YouTube transcripts, search, and channel and playlist listings for any AI app. Hosted.
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents.
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.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceA Model Context Protocol server that enables searching YouTube videos, retrieving and storing transcripts, and performing semantic search over video content without using the official YouTube API.43MIT
- AlicenseBqualityAmaintenanceA server that enables interaction with YouTube data through the Model Context Protocol, allowing users to search videos, retrieve detailed information about videos/channels, and fetch comments.12222 npm27MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables AI assistants to access YouTube data in real-time, with capabilities for searching videos, analyzing channels, retrieving video details, and extracting transcripts.13MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server providing comprehensive read-only access to YouTube data, including video search, transcripts, and channel forensics. It features 16 specialized tools designed for content analysis and metadata retrieval in LLM applications.2-