YouTube Researcher MCP Server
Provides tools for searching YouTube videos, fetching video and channel details, calculating engagement metrics, downloading thumbnails, and generating aggregate niche statistics using the YouTube Data API v3.
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., "@YouTube Researcher MCP Server Analyze the YouTube niche for 'vegan recipes' (top 10 videos)"
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.
YouTube Researcher MCP Server
v1.1.0 · MIT License
An MCP (Model Context Protocol) server for researching YouTube niches. Wraps the YouTube Data API v3 to search for videos, fetch metadata, calculate engagement metrics, download thumbnails, and produce aggregate niche statistics.
Built for Claude Code — define your niche, and the server returns structured data on what's working: title patterns, engagement rates, video lengths, top tags, channel sizes, and thumbnail images for visual analysis.
Recommended Workflow
For the leanest context usage, query 10 videos and delegate analysis to a subagent:
User provides topic — never assume or infer
youtube_analyse_niche(query, maxResults=10)— top 10 by view count with full metricsyoutube_get_thumbnails(videoIds)— download all 10 thumbnailsSpawn a single agent that reads the raw data + thumbnail images, analyses everything, and writes a research report to disk
Main context receives only the file path and a brief summary
This keeps the main conversation window clean. The analyse_niche tool returns large JSON (100KB+ at 30 videos) — always save to disk rather than processing in the primary context.
Companion Skill
A ready-made Claude Code skill is included in skill/SKILL.md. To install:
mkdir -p .claude/skills/researching-youtube-niche
cp skill/SKILL.md .claude/skills/researching-youtube-niche/SKILL.mdThe skill handles the full workflow — topic prompt, niche analysis, thumbnail download, agent delegation, and report generation. Customise the output path and report structure to suit your workspace.
Related MCP server: YouTube MCP
Prerequisites
Node.js >= 18
A YouTube Data API v3 key (free tier — see setup below)
Google Cloud Setup
Go to Google Cloud Console
Create a new project (or select an existing one)
Navigate to APIs & Services > Library
Search for YouTube Data API v3 and click Enable
Navigate to APIs & Services > Credentials
Click Create Credentials > API Key
(Recommended) Restrict the key:
Click the key name to edit
Under API restrictions, select Restrict key and choose YouTube Data API v3
Under Application restrictions, optionally restrict by IP
Copy the API key
Installation
git clone https://github.com/larrygmaguire-hash/youtube-researcher-mcp.git
cd youtube-researcher-mcp
npm installPre-built JavaScript is included in build/ — no TypeScript compilation needed. To rebuild from source: npm run build.
Configuration
Environment Variable
Create a .env file or pass the key directly:
YOUTUBE_API_KEY=your_key_hereThe server validates this at startup and exits if the key is missing.
Claude Code Registration
Global — add to ~/.claude.json:
{
"mcpServers": {
"youtube-researcher": {
"type": "stdio",
"command": "node",
"args": ["/path/to/youtube-researcher-mcp/build/index.js"],
"env": {
"YOUTUBE_API_KEY": "your_key_here"
}
}
}
}Workspace-scoped — add to .mcp.json in the workspace root (same structure). This keeps the server available only within that workspace.
Tools
youtube_search_niche
Search YouTube for videos by keyword. Returns video IDs sorted by view count, date, relevance, or rating.
Parameter | Type | Required | Default | Description |
query | string | Yes | — | Search keyword(s) |
maxResults | number | No | 25 | 1–50 |
order | string | No | viewCount |
|
publishedAfter | string | No | — | ISO 8601 date filter (e.g. |
regionCode | string | No | — | ISO 3166-1 alpha-2 code (e.g. |
Returns: { videoIds: string[], count: number, quotaUsed: number }
Note: This is the only tool that supports the rating sort order and the regionCode filter.
youtube_get_video_details
Fetch full metadata for video IDs. Returns title, description, tags, thumbnails, duration, view/like/comment counts, and calculated engagement metrics. Batches up to 50 per API call.
Parameter | Type | Required | Description |
videoIds | string[] | Yes | Video IDs (max 50) |
Returns per video:
Field | Type | Description |
videoId | string | YouTube video ID |
title | string | Video title |
description | string | Full description text |
tags | string[] | Video tags |
publishedAt | string | ISO 8601 publish date |
durationSeconds | number | Duration in seconds |
durationFormatted | string | Human-readable duration (e.g. |
viewCount | number | Total views |
likeCount | number | Total likes |
commentCount | number | Total comments |
channelId | string | Channel ID |
channelTitle | string | Channel name |
categoryId | string | YouTube category ID |
thumbnailUrls | object | URLs at default/medium/high/standard/maxres sizes |
engagementRate | number | (likes + comments) / views |
likeToViewRatio | number | likes / views |
commentDensity | number | comments / views |
daysSincePublish | number | Days since publish (minimum 1) |
viewVelocity | number | views / daysSincePublish |
youtube_get_channel_details
Fetch channel metadata including subscriber count, total views, and video count. Deduplicates channel IDs automatically.
Parameter | Type | Required | Description |
channelIds | string[] | Yes | Channel IDs (max 50; duplicates removed) |
Returns per channel:
Field | Type | Description |
channelId | string | Channel ID |
title | string | Channel name |
description | string | Channel description |
subscriberCount | number | Subscriber count |
videoCount | number | Total videos published |
totalViewCount | number | Lifetime view count |
publishedAt | string | Channel creation date |
thumbnailUrl | string | Channel avatar URL |
hiddenSubscriberCount | boolean | Whether the sub count is hidden |
youtube_analyse_niche
Primary entry point. Compound tool that searches, fetches video/channel details, calculates metrics, and returns aggregate statistics in a single call.
Parameter | Type | Required | Default | Description |
query | string | Yes | — | Niche keyword(s) |
maxResults | number | No | 30 | 1–50. Recommend 10 for lean workflow |
publishedAfter | string | No | — | ISO 8601 date filter |
minViews | number | No | — | Minimum view count filter (post-fetch — see note) |
order | string | No | viewCount |
|
Automatic filters (no parameter needed):
Videos under 60 seconds are excluded (Shorts detection by duration, not YouTube's Shorts flag)
Active live streams are excluded
minViews gotcha: This is a post-fetch filter. The search and video detail API calls run first (consuming quota), then videos below the threshold are removed from results. A high minViews value can return very few or zero videos while still costing the full quota.
Not available on this tool: regionCode and rating sort order — use youtube_search_niche for those.
Returns:
{
query: string,
fetchedAt: string, // ISO 8601 timestamp
totalVideosAnalysed: number,
videos: VideoMetrics[], // Full per-video data (see youtube_get_video_details)
channels: ChannelMetrics[], // Deduplicated channel data
aggregates: {
medianViewCount: number,
averageViewCount: number,
medianEngagementRate: number,
averageEngagementRate: number,
medianDurationSeconds: number,
medianLikeToViewRatio: number,
topTags: [{ tag, count }], // Top 20 by frequency
durationDistribution: { // Video count per bucket
under5min, fiveToTen, tenToTwenty, overTwenty
},
publishDayDistribution: { // Count by day of week (UTC)
Monday, Tuesday, ...
},
channelSizeDistribution: { // By subscriber count
micro: <10K, mid: 10K-100K, large: 100K-1M, mega: 1M+
}
},
quotaUsed: number
}youtube_get_thumbnails
Download thumbnail images to a local directory. No API quota cost — fetches directly from YouTube's image CDN.
Parameter | Type | Required | Default | Description |
videoIds | string[] | Yes | — | Video IDs (max 50) |
outputDir | string | No |
| Save path |
Behaviour: Tries maxresdefault.jpg first; falls back to hqdefault.jpg on 404. Files saved as [videoId].jpg.
Returns: { downloaded: number, outputDir: string, files: { [videoId]: "/absolute/path.jpg" } }
youtube_quota_status
Report estimated quota usage for the current server session. No parameters.
Returns:
{
"quotaUsed": 103,
"dailyLimit": 10000,
"remaining": 9897,
"note": "Quota resets at midnight Pacific Time. Usage is estimated..."
}Note: The counter tracks usage within the current server process. It resets when the server restarts, and does not reflect the actual Google-side daily total.
Calculated Metrics
For each video, the server calculates:
Metric | Formula |
Engagement rate | (likes + comments) / views |
Like-to-view ratio | likes / views |
Comment density | comments / views |
Days since publish | (now - publishedAt) / 86400000, minimum 1 |
View velocity | views / days since publish |
Quota
YouTube Data API v3 provides 10,000 free units per day.
Operation | Cost |
Search (search.list) | 100 units |
Video details (videos.list, batch 50) | 1 unit |
Channel details (channels.list, batch 50) | 1 unit |
Thumbnail download | 0 (direct fetch) |
A typical full niche analysis: ~103 units. Daily budget allows ~48 analyses per day.
Quota resets at midnight Pacific Time.
Development
npm run dev # Watch mode — recompiles on changes
npm run build # One-time build
npm start # Run the serverTech stack: TypeScript 5.3, ES2022 target, NodeNext modules, @modelcontextprotocol/sdk ^1.0.0. No runtime dependencies beyond the MCP SDK — uses Node 18+ native fetch for all HTTP calls.
Licence
MIT
Available Tools
6 toolsyoutube_analyse_nicheA
High-level niche analysis — the primary entry point for YouTube research. Searches for videos, fetches full metadata, calculates engagement metrics, and returns sorted results with aggregate statistics including median views, engagement rates, top tags, duration distribution, publishing day patterns, and channel size breakdown. Filters out Shorts (<60s) and active live streams automatically.
Inputs: query (required), order, minViews, maxResults, +1 more.
youtube_get_channel_detailsA
Fetch channel metadata including subscriber count, total views, video count, and creation date. Useful for understanding the competitive landscape — whether top videos come from large or small channels.
Inputs: channelIds (required).
youtube_get_thumbnailsA
Download thumbnail images for video IDs to a local directory. Enables Claude vision analysis of thumbnail style, composition, text overlays, faces, and colour schemes. Tries maxresdefault first, falls back to hqdefault. No API quota cost.
Inputs: videoIds (required), outputDir.
youtube_get_video_detailsA
Fetch full metadata and calculated engagement metrics for one or more video IDs. Returns title, description, tags, thumbnails, duration, view/like/comment counts, engagement rate, view velocity, and more. Batches efficiently (50 per API call).
Inputs: videoIds (required).
youtube_quota_statusA
Returns estimated API quota consumption for the current server session. YouTube Data API v3 has a 10,000 unit daily limit. A typical full niche analysis costs ~103 units.
Inputs: no named parameters.
youtube_search_nicheA
Search YouTube for videos in a niche or category. Returns video IDs and basic metadata sorted by the specified order. Use this for targeted searches when you already have video IDs from a previous search or want raw search results without metric calculations.
Inputs: query (required), order, maxResults, regionCode, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
The tools are mostly distinct, but youtube_search_niche and youtube_analyse_niche overlap in purpose—both search a niche, differing only in analysis depth. The description for search_niche is also confusingly worded, mentioning video IDs from a previous search, which blurs its role.
All tools use a consistent 'youtube_' prefix with snake_case, and most follow a verb_noun pattern (e.g., get_video_details, analyse_niche). However, 'quota_status' lacks a verb, deviating slightly from the otherwise coherent naming scheme.
With 6 tools, the server is well-scoped for a YouTube research purpose. Each tool covers a necessary function—search, analysis, video details, channel details, thumbnails, and quota—without excess redundancy.
The toolset covers core research workflows: search/analyze niches, retrieve video/channel metadata, download thumbnails, and monitor API usage. Minor gaps exist, such as no direct comment retrieval or transcript access, but the main research lifecycle is well-covered.
Maintenance
Related MCP Connectors
One MCP server for all web data. Scrape, search, crawl, and AI research in one install.
An MCP server for deep research or task groups
SEO MCP server for keyword research, SERP analysis, audits, and Search Console workflows.
Real-time YouTube transcripts, comments, channels & video search MCP. Local npx or hosted OAuth.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn 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.530 npm4MIT
- AlicenseAqualityDmaintenanceA production-ready MCP server for YouTube integration with intelligent caching. Enables searching videos, retrieving transcripts, analyzing channels, and monitoring live streams via natural language.311MIT
- FlicenseNot gradedqualityDmaintenanceMCP server for YouTube that provides tools to fetch video metadata and transcripts, enabling natural language queries about YouTube videos.2-