YouTube connector
Search videos, read channels and playlists, and manage comments, ratings, and subscriptions through the YouTube Data API.
On this page
The youtube connector gives workflows access to YouTube through the YouTube Data API v3. Look up channels and videos, search, read playlists and comments, reply to comments, and manage subscriptions. Two tools read a channel's public feed and need no sign-in, so you can watch for new uploads without using API quota.
Prerequisites
- A Google account that can approve YouTube access (for every tool except the two listed below).
- The project_contributor role or higher in your project.
- A workspace selected in the Console header.
The tools youtube_resolve_channel_id and youtube_list_channel_videos_rss use public pages and the public channel feed, not the YouTube Data API, so they need no token. Every other tool needs a YouTube access token on the active profile.
Connect in AgentRuntime
The simplest route is to sign in with Google. One Google connection can also serve other Google connectors; see Google Workspace.
- Sign in with Google
Open Connections and click Sign in with Google. Enter a Display name, tick YouTube in the services list, and click Continue to Google. Choose your account and approve the permissions.
- Add the connector
Click MCP in the sidebar, click Add connectors, find youtube, select it, and click Add to workspace.
- Attach the Google connection
Open the new instance. On Instance config, click New profile, enter a Display name, and choose your Google account in the credentials section.
- Make the profile active
Set Status to Active — can be used in workflows, click Save, then click Use this profile for workflows.
- Test it in a workflow
In Workflow Studio, add a connector tool step for this instance and choose
youtube_list_channel_videos_rsswith a channel handle. Then tryyoutube_searchoryoutube_get_channelwithmineset totrueto confirm the signed-in account works.
If you already have a YouTube OAuth access token, you can instead choose Type secrets on this screen on Instance config and paste it into access_token. A pasted token expires, and you must replace it yourself.
See MCP instances for more on profiles.
What you can build
- Channel digest. Run
youtube_list_channel_videos_rsson a few channels each week, summarize the titles with an LLM step, and email the digest. - Comment triage. Run
youtube_get_comment_threadson a new video, have an LLM flag spam or questions, send the questions to a person with a human step, then answer withyoutube_reply_comment. - Topic research. Use
youtube_searchfor a topic, read each hit withyoutube_list_videos, and save the findings to a sheet. - Subscription sync. List current subscriptions with
youtube_subscriptions_list, compare with a list you maintain, and add missing channels withyoutube_subscriptions_insert.
Tools
Look up without signing in
| Tool | What it does |
|---|---|
youtube_resolve_channel_id | Finds a channel ID from an ID, an @handle, or a channel URL |
youtube_list_channel_videos_rss | Lists a channel's recent videos from its public feed. channel_identifier and limit are required; a limit of 0 returns the whole feed |
Read with a signed-in account
| Tool | What it does |
|---|---|
youtube_search | Searches for videos, channels, or playlists (query required, optional type, order, max_results up to 50) |
youtube_get_channel | Returns a channel. Pass exactly one of channel_id, for_username, or mine set to true |
youtube_get_video | Returns one video by video_id |
youtube_list_videos | Returns several videos by video_ids |
youtube_list_channel_videos | Lists a channel's videos using search (channel_id required) |
youtube_list_playlists | Lists playlists for a channel_id, or for the signed-in account with mine set to true |
youtube_list_playlist_items | Lists the entries in a playlist (playlist_id required) |
youtube_get_comment_threads | Lists comment threads for a video_id or a channel_id |
youtube_subscriptions_list | Lists the signed-in account's subscriptions |
Change data
| Tool | What it does |
|---|---|
youtube_insert_comment | Posts a top-level comment on a video (video_id and text) |
youtube_reply_comment | Replies to a comment (parent_comment_id and text) |
youtube_rate_video | Sets a rating on a video: like, dislike, or none to clear it |
youtube_subscriptions_insert | Subscribes the signed-in account to a channel (channel_id) |
youtube_subscriptions_delete | Removes a subscription by subscription_id |
youtube_custom_api_call | Sends any YouTube Data API v3 request (method, path, optional query and body). Can change data |
Reading tools also take paging inputs such as max_results and page_token, and some take part to choose which fields come back.
Example
Get the latest videos from a channel without using any quota:
{
"id": "youtube_rss",
"type": "mcp",
"name": "Latest channel videos",
"tool_name": "youtube_list_channel_videos_rss",
"tool_args": {
"channel_identifier": "@GoogleDevelopers",
"limit": 5
},
"timeout_s": 30
}Studio fills in instance_id when you pick the instance. The result has channel_id, count, and items, each with id, title, link, pubDate, and author. A later step can read {{steps.youtube_rss.result.items}}.
Configuration
| Key | Required | Default | Description |
|---|---|---|---|
access_token | For all tools except the two public ones | none | A YouTube OAuth access token. Signing in with Google supplies it for you |
api_base | No | https://www.googleapis.com/youtube/v3 | The YouTube Data API address |
user_agent | No | agentruntime-mcp-youtube-go/1.0 | The User-Agent sent with requests |
request_timeout_seconds | No | 30 | Time limit for each request, in seconds |
Troubleshooting
| Issue | Fix |
|---|---|
resolved config is missing access_token | The tool needs a signed-in account. Attach your Google connection to the active profile, or use one of the two public tools |
youtube api error 401 | The token is invalid or expired. Sign in with Google again, or replace a pasted token |
youtube api error 403 | YouTube refused the request. Read the message that follows the code: it may be a quota limit, a missing permission, or comments turned off on the video. Use the RSS tool for simple "latest videos" checks, since it uses no quota |
| Channel not found | Try the @handle, the full channel URL, or the channel ID that starts with UC |
| Empty search results | Check query, type, and order. Set type to video, channel, or playlist |
Related
- Integrations quickstart
- Google Workspace for the shared Google sign-in
- MCP instances
- RSS connector for other feeds
- Connector catalog
- Troubleshooting