home / mcp / youtube mcp server
Provides access to YouTube data, transcripts, channels, and playlists via a standardized MCP interface.
Configuration
View docs{
"mcpServers": {
"zubeidhendricks-youtube-mcp-server": {
"command": "zubeid-youtube-mcp-server",
"args": [],
"env": {
"YOUTUBE_API_KEY": "AIza...",
"YOUTUBE_TRANSCRIPT_LANG": "en"
}
}
}
}You can run a YouTube MCP Server to let AI models query YouTube data, fetch transcripts, and explore videos, channels, and playlists through a standardized interface. This guide gives you practical steps to install, configure, and use the server with an MCP client today.
You will run the MCP server locally or via a client, then connect to it from your MCP-enabled assistant. Use it to retrieve video details, fetch transcripts in preferred languages, search videos, and explore channels and playlists. When you issue requests through your MCP client, you can: obtain video metadata, retrieve and search transcripts, list channel content, and explore playlist items.
Prerequisites: you need Node.js and npm installed on your system. You will install the MCP server globally or run it via a local runtime.
# Install the MCP server globally
npm install -g zubeid-youtube-mcp-server
# Then configure your client with the API key you obtain belowYou must provide a YouTube Data API key to run the server. The transcripts language can be set to a default language if you wish to customize the transcript language.
{
"mcpServers": {
"zubeid-youtube-mcp-server": {
"command": "zubeid-youtube-mcp-server",
"env": {
"YOUTUBE_API_KEY": "your_youtube_api_key_here"
}
},
"youtube_npx": {
"command": "npx",
"args": ["-y", "zubeid-youtube-mcp-server"],
"env": {
"YOUTUBE_API_KEY": "your_youtube_api_key_here"
}
}
}
}Get video details, fetch transcripts, and search for videos using your MCP client connected to the YouTube MCP Server.
// Get video details
const video = await youtube.videos.getVideo({ videoId: "video-id" });
// Get video transcript
const transcript = await youtube.transcripts.getTranscript({ videoId: "video-id", language: "en" });
// Search videos
const searchResults = await youtube.videos.searchVideos({ query: "search term", maxResults: 10 });To test and build locally, install dependencies, run tests, and build the project.
# Install dependencies
npm install
# Run tests
npm test
# Build
npm run build
# Lint
npm run lintThis server provides endpoints to access video information, transcript management, channel management, and playlist management. Ensure you keep your API key secure and set a default transcript language if needed.
Treat your API key like a secret. Do not expose it in client-side code or public repositories. Use environment variables in your MCP client configuration and limit access to trusted environments.
Retrieve video details such as title, description, duration, and other metadata.
List videos within a channel or playlist to explore content.
Retrieve transcripts for a video, with optional language support.
Search YouTube for videos matching a query.
Fetch details about a channel.
List videos associated with a channel.
List items within a playlist.
Get details about a playlist.