A Model Context Protocol (MCP) server implementation for YouTube, enabling AI language models to interact with YouTube content through a standardized interface. This server uses YouTube.js (youtubei.js) to access YouTube's internal API, eliminating the need for API keys.
- Get video details (title, description, duration, etc.)
- Search videos across YouTube
- Get trending videos
- Get related videos for any video
- Retrieve video transcripts
- Support for multiple languages
- Get timestamped captions
- Search within transcripts
- Get channel details
- List channel videos
- Get channel statistics
- Get playlist details
- List playlist items
- Get playlist statistics
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json
on macOS or %APPDATA%\Claude\claude_desktop_config.json
on Windows):
{
"mcpServers": {
"youtube": {
"command": "npx",
"args": ["-y","git+https://github.com/acehoss/youtube-mcp-server"]
}
}
}
That's it! No API keys or additional configuration required.
- Clone the repository:
git clone https://github.com/acehoss/youtube-mcp-server.git
cd youtube-mcp-server
- Install dependencies:
npm install
- Build the project:
npm run build
- Run the server:
npm start
The MCP server exposes the following tools:
videos_getVideo
- Get detailed information about a YouTube videovideos_searchVideos
- Search for videos on YouTubetranscripts_getTranscript
- Get the transcript of a videovideos_getTrending
- Get trending videosvideos_getRelated
- Get videos related to a specific video
channels_getChannel
- Get channel informationchannels_listVideos
- List videos from a channel
playlists_getPlaylist
- Get playlist informationplaylists_getPlaylistItems
- Get videos in a playlist
# Run all tests
npm test
# Run unit tests only
npm run test:unit
# Run integration tests only
npm run test:integration
# Run tests in watch mode
npm run test:watch
npm run build
npm run dev
This server uses YouTube.js (youtubei.js) to interact with YouTube's internal InnerTube API. This approach:
- Eliminates the need for API keys
- Provides access to features not available in the official API
- Offers better performance for transcript retrieval
- Reduces rate limiting concerns
The project includes comprehensive test coverage:
- Unit Tests: Mock YouTube.js responses to test service logic
- Integration Tests: Real API calls using known test data (e.g., Rick Astley's "Never Gonna Give You Up")
Integration tests require an internet connection and may take longer to run.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built on YouTube.js by LuanRT
- Implements the Model Context Protocol specification
- Originally forked from youtube-mcp-server by Zubeid Hendricks