YouTube MCP serverand Python AI tasks
qbash hosts a YouTube MCP server you can use in Claude, ChatGPT, Codex, Cursor, Grok Bot and Muse.
Developers use qbash Tasks to write cloud-hosted Python functions that pair YouTube with models such as Claude and GPT.
MCP server
Build a YouTube MCP server
Give ChatGPT, Claude and your other AI tools access to YouTube through one server. You pick which YouTube tools it shares, and you can add other connectors, memory folders and Tasks to the same server.
How to set it up
- Connect YouTube on the qbash Connectors page.
- Create an MCP server and add the YouTube tools you want to share.
- Paste the server URL into your client. It connects with OAuth or an access token.
Python AI task
Write a YouTube task in Python
A qbash Task is a hosted Python function that calls YouTube and AI models.
Rank last month’s videos by watch time
Get the channel’s top 20 videos for 28 days, sorted by minutes watched, then ask an inline prompt which ones hold viewers and which lose them early.
end = datetime.now().date() - timedelta(days=3)
start = end - timedelta(days=27)
report = qbash.integrations.youtube.get_top_videos(
start_date=start.isoformat(),
end_date=end.isoformat(),
metrics="views,estimatedMinutesWatched,averageViewDuration,likes",
sort="-estimatedMinutesWatched",
max_results=20,
)
rows = report.get("rows", [])
if rows:
review = qbash.ai.run_prompt(
slug="youtube-top-videos",
variables={"videos": json.dumps(rows)},
)
qbash.output(review)
else:
qbash.output("The channel had no views in this period.")
Sample get_top_videos response
{
"rows": [
{
"video": "aBcD1234xyz",
"views": 1820,
"estimatedMinutesWatched": 5410,
"averageViewDuration": 178,
"likes": 96
},
{
"video": "eFgH5678uvw",
"views": 2410,
"estimatedMinutesWatched": 3120,
"averageViewDuration": 77,
"likes": 41
}
],
"column_headers": [
{
"name": "video",
"data_type": "STRING",
"column_type": "DIMENSION"
},
{
"name": "views",
"data_type": "INTEGER",
"column_type": "METRIC"
},
{
"name": "estimatedMinutesWatched",
"data_type": "INTEGER",
"column_type": "METRIC"
},
{
"name": "averageViewDuration",
"data_type": "INTEGER",
"column_type": "METRIC"
},
{
"name": "likes",
"data_type": "INTEGER",
"column_type": "METRIC"
}
],
"row_count": 2
}
What the YouTube connector can do
- Upload a video to YouTube and return its ID. Defaults to private; videos stay private until the Google project passes YouTube's API audit
- Check whether an uploaded video finished processing. Upload is asynchronous, so poll this after upload_video
- Set a custom thumbnail for a video. Max 2 MB, JPEG or PNG
- Make a private video public, or schedule it to go public at a future time
- List the channel's uploaded videos, newest first. Reads the uploads playlist, so it costs no search quota and includes videos uploaded moments ago
- Get one video's metadata, status and statistics
- Update a video's metadata. Only the fields you pass change; everything else is preserved
- Permanently delete a video from the channel. This cannot be undone
- Like, dislike, or clear your rating on a video
- Search YouTube. Bills to a dedicated 100-calls-per-day bucket separate from the main quota pool
- List playlists owned by the channel
- Create a playlist and return its ID
- Delete a playlist. The videos in it are not deleted
- List the videos in a playlist
- Add a video to a playlist
- Remove a video from a playlist. Removes every occurrence if the video appears more than once
- List comment threads on a single video, with their replies
- List comment threads across every video on a channel. Use list_video_comments for a single video
- Reply to a comment thread as the authenticated channel
- Get channel details: subscriber count, total views, video count and the uploads playlist ID
- Run a channel-level analytics report over a date range. Revenue metrics (estimatedRevenue, cpm, adImpressions, ...) are unavailable: this integration does not request the monetary scope
- Run an analytics report scoped to one video. Revenue metrics (estimatedRevenue, cpm, adImpressions, ...) are unavailable: this integration does not request the monetary scope. Impressions and thumbnail click-through rate are not available from this API at all
- List the channel's best-performing videos for a period. Revenue metrics (estimatedRevenue, cpm, adImpressions, ...) are unavailable: this integration does not request the monetary scope
- Break views down by how viewers found the video: YouTube search, suggested videos, browse features, external sites and more
qbash Tasks: AI applications in Python
A Task is a Python function that calls YouTube, your other connectors and models such as Claude, GPT, Gemini and Grok. qbash hosts and runs it.
Run Tasks on a schedule or from your team's tools
- Deterministic where it counts Write the logic in Python and call a model only for the steps that need judgement, so the rest runs the same way every time.
- Version controlled Every save is a revision you can compare and roll back.
- Logged Each run records its inputs, output, errors and what started it.
- Shared credentials Connections belong to your organization, so a Task keeps working when its author is away.
YouTube MCP questions
Can the YouTube MCP server report revenue?
No. The connection does not request YouTube’s monetary analytics scope, so revenue metrics such as estimatedRevenue and cpm return an error. Views, watch time, subscribers and traffic sources are available.
Why do videos uploaded through qbash stay private?
Google keeps videos uploaded by an API project private until that project passes the YouTube API Services audit. upload_video defaults to private for that reason, and the privacy you set takes effect once qbash’s project clears the audit.
Related analytics connectors
Build a YouTube task
Write it in Python with AI steps, and qbash hosts it with versions and run logs.
Build a YouTube MCP server
Pick the YouTube tools to share and connect ChatGPT, Claude or Grok Bot.