Skip to main content
Glama
YouTube MCP

YouTube MCP

by mrsknetwork

YouTube MCP

Connect AI assistants to YouTube: search, transcripts, metadata, and more.

npm Downloads Socket Badge MIT MCP


What can it do?

Once connected, your AI can:

  • Extract clean, word-for-word video transcripts. No credentials required.

  • Search YouTube by keyword, date range, duration, quality, and region.

  • Fetch trending videos for any country and category.

  • Retrieve video stats, metadata, comments, captions, and channel details.

  • Look up channels by @handle (e.g. @MrBeast).

  • Access your own subscriptions, members, and membership tiers via OAuth.


Related MCP server: youtube-connector-mcp

Getting Started

The server supports three access tiers. Pick the one that fits your use case.

Guest Mode (No Setup)

Works out of the box. The get_video_transcript tool uses yt-dlp to extract transcripts without any API credentials.

{
  "mcpServers": {
    "youtube-mcp": {
      "command": "npx",
      "args": ["-y", "@mrsknetwork/ytmcp@latest"]
    }
  }
}

Unlocks all public data tools. Best for search, metadata, comments, trending videos, and transcripts.

1. Get a Google API Key

  1. Open the Google Cloud Console.

  2. Enable YouTube Data API v3 for your project.

  3. Go to Credentials and create an API Key.

2. Add to your MCP client config or .env file

Pass GOOGLE_API_KEY via env in your MCP client config, or place GOOGLE_API_KEY=YOUR_KEY inside a .env file in the project directory.

{
  "mcpServers": {
    "youtube-mcp": {
      "command": "npx",
      "args": ["-y", "@mrsknetwork/ytmcp@latest"],
      "env": {
        "GOOGLE_API_KEY": "YOUR_GOOGLE_API_KEY"
      }
    }
  }
}

OAuth 2.0

1. Create an OAuth 2.0 Client

  1. Open the Google Cloud Console.

  2. Enable YouTube Data API v3 for your project.

  3. Go to Credentials > Create Credentials > OAuth 2.0 Client ID.

  4. Set Application type to Web application.

  5. Add this exact Redirect URI: http://localhost:31415/oauth2callback.

  6. Go to OAuth Consent Screen > Test Users and add your Gmail address.

2. Add to your MCP client config

Credentials are passed securely via environment variables in the MCP config. They are never stored in files.

{
  "mcpServers": {
    "youtube-mcp": {
      "command": "npx",
      "args": ["-y", "@mrsknetwork/ytmcp@latest"],
      "env": {
        "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
        "GOOGLE_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

3. First-time login

On your first tool call, the AI will share a login link. Click it, authorize the app in your browser, then tell the AI you are done. Your session is saved. You will not need to log in again unless you revoke access.

4. Signing out

Ask your AI to call revoke_oauth_token to sign out and delete your stored credentials at any time.


Available Tools

Tool

Auth

Description

get_video_transcript

None

Download a full spoken transcript using yt-dlp. Specify language_code (e.g. en, es) and whether to prefer manual or auto-generated captions. Returns source metadata with the text.

search_content

API Key

Search YouTube for videos, channels, or playlists. Filter by order, published_after, published_before, video_duration, video_definition, and region_code. Supports pagination.

get_video_metadata

API Key

Fetch title, description, tags, duration, and stats (views, likes, comments) for one or more videos by ID.

get_channel_metadata

API Key

Fetch channel profile, subscriber count, video count, and uploads playlist ID. Accepts a channel ID or @handle.

list_trending_videos

API Key

Fetch the most popular videos on YouTube for a given region_code and optional category_id. Supports pagination.

list_playlists

API Key

List playlists for a channel, or fetch specific playlists by ID. Returns title, description, and item count.

list_playlist_items

API Key

List all videos inside a playlist in order. Returns title, position, and video ID for each entry.

list_video_comments

API Key

Fetch top-level comment threads for a video or channel. Filter by keyword with search_terms. Supports pagination.

list_comment_replies

API Key

Fetch replies to a specific comment thread by parent_comment_id. Supports pagination.

list_video_captions

API Key

List available caption tracks for a video, including language code and type (manual or auto-generated).

list_video_categories

API Key

List YouTube video category names and IDs for a given region. Use the IDs with search_content or list_trending_videos.

list_channel_activities

API Key

Fetch a channel's recent activity feed, including uploads and playlist additions.

list_channel_sections

API Key

List the shelf sections displayed on a channel's page, in order.

list_supported_languages

API Key

List all languages supported by YouTube, with language codes and localized names.

list_supported_regions

API Key

List all regions supported by YouTube, with region codes and names.

list_subscriptions

API Key / OAuth

List public subscriptions for a channel by channel_id (API Key), or your own subscriptions with mine=true (OAuth).

list_channel_members

OAuth

List current paying members of your channel. Requires an active memberships program.

list_membership_levels

OAuth

List the membership tier names and levels configured for your channel.

revoke_oauth_token

OAuth

Sign out and permanently delete your stored Google credentials from the server.


Building from Source

git clone https://github.com/mrsknetwork/ytmcp.git
cd ytmcp
npm install
npm run build
cp .env.example .env # Set GOOGLE_API_KEY inside .env
node build/server/index.js

License

Licensed under the MIT License.

Available Tools

19 tools
get_channel_metadataA
Read-only

Fetch channel profile, statistics, and content details by channel ID or @handle. Returns snippet (title, description, country, thumbnails), statistics (subscriberCount, videoCount, viewCount), and contentDetails (uploads playlist ID — use with list_playlist_items to browse all channel videos). Accepts either channel_ids (comma-separated) or handle (e.g., '@MrBeast').

Inputs: handle, channel_ids, max_results. Returns: kind, items, pageInfo, nextPageToken

get_video_metadataA
Read-only

Fetch full metadata for one or more YouTube videos by ID, or retrieve the most popular videos chart. Returns snippet (title, description, channelId, tags, publishedAt), contentDetails (duration in ISO 8601, definition, caption), and statistics (viewCount, likeCount, commentCount). Provide comma-separated video_ids for lookup, or chart_type='mostPopular' for trending videos.

Inputs: video_ids, chart_type, category_id, max_results. Returns: kind, items, pageInfo, nextPageToken

get_video_transcriptA
Read-only

Download the full spoken transcript of a YouTube video as clean plain text using yt-dlp — no API credentials required. Tries manual English captions first (or specified language_code), then auto-generated, then falls back to the first available language. Returns concatenated plain text plus metadata about which language and caption type was used. Ideal for content research without consuming YouTube API quota.

Inputs: video_id (required), end_minutes, language_code, prefer_manual, +2 more.

list_channel_activitiesA
Read-only

Get a chronological feed of a channel's recent actions such as uploads, playlist additions, and recommendations. Returns snippet (type, publishedAt, title) and contentDetails (upload.videoId, playlist.playlistId). Useful for tracking what a channel has posted recently. Use page_token to paginate.

Inputs: mine, channel_id, page_token, max_results.

list_channel_membersA
Read-only

List current paying members of the authenticated user's channel. Requires OAuth with the YouTube channel membership scope and an active memberships program on the channel. Returns snippet (memberDetails.channelId, creatorChannelId, membershipsDetails.highestActiveLevel.displayName).

Inputs: max_results.

list_channel_sectionsA
Read-only

Get the shelf and section layout of a YouTube channel page (e.g., 'Featured Videos', 'Popular Uploads', 'Single Playlist'). Returns snippet (title, type, style, position) and contentDetails (playlists[], channels[]). Useful for understanding how a channel organizes and surfaces its content.

Inputs: mine, channel_id.

list_comment_repliesA
Read-only

Fetch replies to a specific comment thread using parent_comment_id, or fetch individual comments by comma-separated comment_ids. Returns snippet (textDisplay, authorDisplayName, likeCount, publishedAt, parentId). Use page_token to paginate through large reply threads.

Inputs: page_token, comment_ids, max_results, parent_comment_id.

list_membership_levelsA
Read-only

List the membership tier pricing levels configured for the authenticated user's channel. Requires OAuth. Returns items[].snippet.levelDetails.displayName for each tier (e.g., 'Member', 'Super Fan'). Use alongside list_channel_members to understand which tier each member belongs to.

Inputs: no named parameters.

list_playlist_itemsA
Read-only

List video entries inside a YouTube playlist in order. Returns snippet (title, description, position, videoOwnerChannelTitle, thumbnails) and contentDetails (videoId). Use the videoId values with get_video_metadata or get_video_transcript for further detail. Use page_token to walk through all items.

Inputs: playlist_id (required), page_token, max_results.

list_playlistsA
Read-only

List playlists belonging to a channel or fetch specific playlists by ID. Returns snippet (title, description, channelId, thumbnails) and contentDetails (itemCount). Use list_playlist_items with the returned playlist id to browse all videos inside a playlist. Use page_token to paginate.

Inputs: channel_id, page_token, max_results, playlist_ids. Returns: kind, items, pageInfo, nextPageToken

list_subscriptionsA
Read-only

List a channel's public subscriptions by channel_id (requires API Key), or list your own subscriptions with mine=true (requires OAuth). Returns snippet (title, description, resourceId.channelId) and contentDetails (totalItemCount, newItemCount). Use for_channel_id to check if a channel is subscribed to specific channels. Use page_token to paginate.

Inputs: mine, channel_id, page_token, max_results, +1 more.

list_supported_languagesA
Read-onlyIdempotent

List all languages supported by YouTube (e.g., for caption and UI localization). Returns items[].snippet.hl (language code) and items[].snippet.name (human-readable name). Optionally pass language_code to get names localized in that language.

Inputs: language_code.

list_supported_regionsA
Read-onlyIdempotent

List all geographic regions supported by YouTube content targeting. Returns items[].snippet.gl (region code, e.g., 'US') and items[].snippet.name. Use region codes with list_video_categories or search_content to geo-filter results.

Inputs: language_code.

list_video_captionsA
Read-only

List available caption track metadata for a video (requires API Key or OAuth). Returns items[].snippet with language (e.g., 'en'), name, trackKind ('standard', 'asr' for auto-generated, 'forced'), and lastUpdated. Use this to discover what caption languages exist for a video; use get_video_transcript to download the actual text.

Inputs: video_id (required).

list_video_categoriesA
Read-onlyIdempotent

List standard YouTube video category names and IDs for a given region (e.g., 'US', 'IN'). Returns items[].id and items[].snippet.title. Use the returned category IDs with search_content or list_trending_videos to filter content by category.

Inputs: region_code (required).

list_video_commentsA
Read-only

Fetch top-level comment threads for a video or all comments on a channel. Returns snippet.topLevelComment (authorDisplayName, textDisplay, likeCount, publishedAt) and replies.comments[] for threaded replies. Use search_terms to filter comments containing a specific phrase. Use page_token to paginate.

Inputs: video_id, channel_id, page_token, max_results, +1 more.

revoke_oauth_tokenA
Idempotent

Revoke the stored OAuth token and sign the user out of the YouTube MCP server. Calls Google's token revocation endpoint, deletes the local token file (~/.ytmcp_tokens.json), and clears the in-process auth cache. After revoking, any tool that requires OAuth will prompt the user to re-authenticate. Requires OAuth.

Inputs: no named parameters.

search_contentA
Read-only

Search YouTube for videos, channels, or playlists. Returns items[].id (videoId/channelId/playlistId) and items[].snippet (title, description, thumbnails, channelTitle, publishedAt). Use content_type to filter by resource type. Use page_token from a previous response to paginate additional pages.

Inputs: search_query (required), order, page_token, max_results, +6 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 19 tools

    Disambiguation4/5

    Most tools are clearly separated by resource type (videos, channels, playlists, comments, captions) and action (list vs get vs search). A few overlaps exist: get_video_metadata's mostPopular mode duplicates list_trending_videos, and list_video_comments vs list_comment_replies may require careful reading to tell top-level threads from replies.

    Naming Consistency5/5

    Tool names consistently use snake_case verb_noun patterns: list_* for collection retrieval, get_* for specific resources/metadata, with search_content and revoke_oauth_token as readable exceptions. The naming makes the resource and action predictable across the whole set.

    Tool Count3/5

    At 19 tools, the set sits in the borderline-heavy 16-25 range. Each tool has a clear job, but some could be consolidated (e.g., merging mostPopular handling into list_trending_videos, or separating auth/membership tools into another server).

    Completeness4/5

    The set covers the read-oriented YouTube workflow thoroughly: search, video/channel/playlist metadata, comments, captions/transcripts, categories, and channel organization. It lacks write operations such as uploading videos, creating playlists, or posting comments, but those appear outside the server's apparent research-focused intent.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers