YouTube MCP Server
A Model Context Protocol (MCP) server for interacting with YouTube videos. This server provides tools for extracting video metadata, captions, and converting them to markdown format with various templates.
Features
- Video Metadata: Fetch comprehensive video information
- Caption Extraction: Support for auto-generated and manual captions
- Multiple Languages: Built-in support for English and French
- Template System: Three built-in markdown templates:
- Basic: Simple transcript format
- Detailed: Full metadata with timestamps
- Search: Results highlighting with context
- Search Functionality: Search within video captions
- Flexible Authentication: Supports both API key and OAuth2 authentication
Prerequisites
- Node.js (v16 or higher)
- npm or yarn
- A YouTube Data API key and/or OAuth2 credentials
Installation
- Clone the repository:
- Install dependencies:
- Build the project:
Configuration
Create a .env
file in the root directory with your YouTube credentials:
MCP Configuration
Add the server to your MCP settings file (usually at ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
):
Usage
The server provides the following tools:
1. Get Video Info
2. Get Captions
3. Convert to Markdown
4. List Templates
Dependencies
OAuth2 Setup
For OAuth2 authentication (required for private video access):
- Create a project in the Google Cloud Console
- Enable the YouTube Data API v3
- Create OAuth2 credentials (Web application type)
- Run the authentication script:
- Follow the browser prompts to authorize the application
- Copy the refresh token to your configuration
Customizing Templates
You can add custom templates by modifying the DEFAULT_TEMPLATES
array in src/index.ts
. Templates follow this structure:
License
MIT
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This server cannot be installed
Enables interaction with YouTube videos by extracting metadata, captions in multiple languages, and converting content to markdown with various templates.