- Home
- MCP servers
- MCP YouTube Extract
MCP YouTube Extract
- python
16
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"sinjab-mcp_youtube_extract": {
"command": "mcp_youtube_extract",
"args": [],
"env": {
"YOUTUBE_API_KEY": "YOUR_YOUTUBE_API_KEY"
}
}
}
}You can run a self-contained MCP server that exposes YouTube video information and transcripts without requiring an API key for core functionality. This server exposes a single tool to fetch video metadata and transcripts, and it includes comprehensive logging and error handling to help you build reliable client applications.
How to use
You will interact with the MCP YouTube Extract server through a client configuration that points to the local MCP instance. The main tool is get_yt_video_info, which accepts a YouTube video identifier and returns metadata such as title, description, channel, publish date, view count, and a transcript via built-in integration. Use this tool to retrieve rich video context for indexing, dashboards, or analysis. When you supply the video ID, you will receive a structured response that includes the metadata and a transcript if available.
How to install
Prerequisites: you need Python and a working network environment. You will install the MCP YouTube Extract package from PyPI and run the MCP server locally.
pip install mcp-youtube-extract
# Run the MCP YouTube Extract server directly
mcp_youtube_extract
Configuration and runtime notes
Optional YouTube API key: you can provide a YouTube Data API key to enhance metadata extraction. This key is only used as a fallback if the built-in extractor cannot obtain information from YouTube. If you choose to configure it, set the environment variable YOUTUBE_API_KEY to your key.
# Example optional environment configuration (for downstream clients or startup scripts)
# Set your API key only if you have one
export YOUTUBE_API_KEY=your_youtube_api_key
Running in development mode with uv
If you prefer the development workflow using uv, you can install uv and run the server through uv. This is useful when you are actively developing or testing changes.
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Clone and install the project
git clone https://github.com/sinjab/mcp_youtube_extract.git
cd mcp_youtube_extract
# Install dependencies (including dev dependencies)
uv sync --dev
# Optional: configure API key
cp .env.example .env
# Edit .env and add your YouTube API key
Client configuration example
To use the MCP server from a client, point to the local CLI or a configured MCP server entry. The examples below show a minimal local setup with the CLI endpoint.
{
"mcpServers": {
"mcp_youtube_extract": {
"command": "mcp_youtube_extract"
}
}
}
Notes on API key usage
An API key is optional. It provides additional fallback capabilities but is not required for basic video info retrieval and transcripts using the built-in extractors.
Available tools
get_yt_video_info
Fetches YouTube video metadata via yt-info-extract and retrieves the transcript via yt-ts-extract, returning a structured result with title, description, channel, publish date, view count, and transcript.