Home / MCP / YouTube MCP Server
Provides tools to extract transcripts, summarize YouTube videos, and answer content queries via MCP.
Configuration
View docs{
"mcpServers": {
"youtube": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/youtube-mcp",
"run",
"main.py",
"--transport",
"stdio",
"--debug"
],
"env": {
"GEMINI_API_KEY": "YOUR_GEMINI_API_KEY",
"YOUTUBE_API_KEY": "YOUR_YOUTUBE_API_KEY"
}
}
}
}You can run a YouTube MCP Server that analyzes videos by extracting transcripts, generating summaries, answering questions, and retrieving comments. It exposes practical tools you can call from an MCP client to interact with YouTube content efficiently.
Use an MCP client to connect to the YouTube MCP Server and call the available endpoints to access transcripts, summaries, queries, and more. The server is designed to run locally and expose a development workflow, so you can test transcripts, summaries, searches, and comment analysis against YouTube videos. You can start the server with a standard MCP workflow and then invoke specific tools like get-transcript, summarize, query, search, and get-comments to perform common video analyses.
Typical usage patterns include: - Retrieve a video transcript for a given video ID - Generate a concise summary of a video’s content - Ask natural language questions about a video and receive targeted answers - Search for YouTube videos matching specific queries - Analyze comments to understand viewer reception and sentiment
Prerequisites you need before installation:
- Python 3.9 or newer
- Access to Google Gemini API key
- YouTube Data API key
- Node.js and npm for optional Smithery-based installation (if you plan to install via Smithery)Option A: Install via Smithery (Claude Desktop auto-install)
- Run the installation command:
```
npx -y @smithery/cli install @Prajwal-ak-0/youtube-mcp --client claude
```
- This installs the MCP for Claude Desktop automatically and wires in the YouTube MCP server components for you.Option B: Local setup (manual)
1. Clone the project:
```
git clone https://github.com/Prajwal-ak-0/youtube-mcp
cd youtube-mcp
```
2. Create a virtual environment and install dependencies:
```
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .
```
3. Create a `.env` file with your API keys:
```
GEMINI_API_KEY=your_gemini_api_key
YOUTUBE_API_KEY=your_youtube_api_key
```
4. Run the MCP server in development mode:
```
mcp dev main.py
```
5. Configure the client to connect over stdio using the provided transport if needed. A ready-to-use stdio configuration can be pasted as shown in the next snippet.If you want to configure with a stdio transport, use this configuration (adjust the path to your project location):
```
{
"youtube": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/youtube-mcp",
"run",
"main.py",
"--transport",
"stdio",
"--debug"
]
}
}
```
This enables stdio-based communication with the YouTube MCP server.The server expects environment variables for API keys, typically loaded from a .env file. Use the following keys when setting up the environment:
- GEMINI_API_KEY: Your Google Gemini API key
- YOUTUBE_API_KEY: Your YouTube Data API key
Make sure these keys are accessible to the process running the MCP server.
Troubleshooting tips: - Ensure Python 3.9+ is installed and the virtual environment is activated when installing dependencies. - Verify that API keys are correct and have the required permissions for transcripts, video data, and comments access. - If the MCP server does not respond, check that the transport (stdio) is correctly configured in your client and that the working directory path is accurate.
Retrieve the transcript for a YouTube video using its ID, including timing and speaker information if available.
Generate a concise summary of a YouTube video using Gemini AI, suitable for quick highlights.
Answer natural language questions about a video's content by querying transcripts, summaries, and metadata.
Search YouTube for videos that match specific queries and return relevant results.
Fetch and analyze the comments for a YouTube video to understand audience reactions.
Return the like count for a specific YouTube video.