what is YouTube MCP Server?
YouTube MCP Server is a Model Context Protocol (MCP) server designed for interacting with YouTube data, allowing users to query videos, channels, comments, and transcripts through a standard input/output interface.
how to use YouTube MCP Server?
To use the server, you can install it via Smithery or manually clone the repository, install dependencies, and set up your environment variables. After that, you can build and run the server to start querying YouTube data.
key features of YouTube MCP Server?
- Advanced video search with filtering options
- Detailed information retrieval for videos and channels
- Comparison of statistics across multiple videos
- Discovery of trending videos by region and category
- Analysis of channel performance and video statistics
- Retrieval of video comments and transcripts
- Generation of video analysis and transcript summaries
use cases of YouTube MCP Server?
- Analyzing video performance metrics for content creators.
- Retrieving transcripts for educational videos.
- Comparing statistics of competing videos for market research.
- Discovering trending content in specific regions.
FAQ from YouTube MCP Server?
- What are the prerequisites for using the server?
You need Node.js (v16+) and a YouTube Data API key.
- How can I deploy the server using Docker?
You can build the Docker image and run the container with the provided commands in the documentation.
- What types of data can I query?
You can query video details, channel statistics, comments, and transcripts.
YouTube MCP Server
A Model Context Protocol (MCP) server for interacting with YouTube data. This server provides resources and tools to query YouTube videos, channels, comments, and transcripts through a stdio interface.
Features
- Search for YouTube videos with advanced filtering options
- Get detailed information about specific videos and channels
- Compare statistics across multiple videos
- Discover trending videos by region and category
- Analyze channel performance and video statistics
- Retrieve video comments and transcripts/captions
- Generate video analysis and transcript summaries
Prerequisites
- Node.js (v16+)
- YouTube Data API key
Installation
Installing via Smithery
To install YouTube MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @coyaSONG/youtube-mcp-server --client claude
Installing Manually
-
Clone this repository:
git clone https://github.com/coyaSONG/youtube-mcp-server.git cd youtube-mcp-server
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory:YOUTUBE_API_KEY=your_youtube_api_key_here PORT=3000
Usage
Building and Running
-
Build the project:
npm run build
-
Run the server:
npm start
-
Run in development mode:
npm run dev
-
Clean build artifacts:
npm run clean
Docker Deployment
The project includes a Dockerfile for containerized deployment:
# Build the Docker image
docker build -t youtube-mcp-server .
# Run the container
docker run -p 3000:3000 --env-file .env youtube-mcp-server
API Reference
Resources
youtube://video/{videoId}
- Get detailed information about a specific videoyoutube://channel/{channelId}
- Get information about a specific channelyoutube://transcript/{videoId}
- Get transcript for a specific video- Optional query parameter:
?language=LANGUAGE_CODE
(e.g.,en
,ko
,ja
)
- Optional query parameter:
Tools
Basic Tools
search-videos
- Search for YouTube videos with advanced filtering optionsget-video-comments
- Get comments for a specific videoget-video-transcript
- Get transcript for a specific video with optional language
Statistical Tools
get-video-stats
- Get statistical information for a specific videoget-channel-stats
- Get subscriber count, view count, and other channel statisticscompare-videos
- Compare statistics across multiple videos
Discovery Tools
get-trending-videos
- Retrieve trending videos by region and categoryget-video-categories
- Get available video categories for a specific region
Analysis Tools
analyze-channel-videos
- Analyze performance trends of videos from a specific channel
Prompts
video-analysis
- Generate an analysis of a YouTube videotranscript-summary
- Generate a summary of a video based on its transcript
Examples
Accessing a Video Transcript
youtube://transcript/dQw4w9WgXcQ
Getting a Transcript in a Specific Language
youtube://transcript/dQw4w9WgXcQ?language=en
Using the Statistical Tools
// Get video statistics
{
"type": "tool",
"name": "get-video-stats",
"parameters": {
"videoId": "dQw4w9WgXcQ"
}
}
// Compare multiple videos
{
"type": "tool",
"name": "compare-videos",
"parameters": {
"videoIds": ["dQw4w9WgXcQ", "9bZkp7q19f0"]
}
}
Using the Transcript Summary Prompt
{
"type": "prompt",
"name": "transcript-summary",
"parameters": {
"videoId": "dQw4w9WgXcQ",
"language": "en"
}
}
Error Handling
The server handles various error conditions, including:
- Invalid API key
- Video or channel not found
- Transcript not available
- Network issues
License
MIT