YouTube connector for Claude Code

Use Porter’s YouTube connector for Claude Code to pull video views, watch time and traffic sources into your terminal, then turn them into files, scripts and scheduled reports in your own project.

  • Save video stats as CSV in your repo
  • See which traffic sources bring watch time
  • Run a weekly YouTube report from a script
  • Compare organic YouTube with your ads
G2★★★★★Rated 4.6/5 from 288 G2 reviews (October 2026) · Used by 1,600+ marketing teams and agencies

By · Last updated November 26, 2026

Claude Codeporter connected
List my 4 most viewed videos over the last 30 days YouTube has published and save them to reports/yt-top.csv
porter / YouTube / Trailgear Demo✓ 4 rows
Saved reports/yt-top.csv. The tent setup tutorial leads views and watch time.
VideoViewsMinutes watched
Tent setup tutorial48,210182,400
Packing for 3 days31,880140,120
Gear review: stoves19,42061,900
Trail vlog #128,96022,310
Demo data, Trailgear Demo account
34 YouTube fields
01Setup

How to connect YouTube to Claude Code

Connecting YouTube to Claude Code takes 3 steps and no API keys: connect your YouTube channels in Porter with Google, add Porter’s MCP server to Claude Code with one command, then sign in from /mcp and ask. The same server also works in Cursor, VS Code and Codex, as Porter’s YouTube MCP server page shows. Using the Claude app instead? See the YouTube connector for Claude.

Before you start

  • You need Claude Code installed (Anthropic’s Claude Code overview), a free Porter account and the Google account that owns or manages the YouTube channel.
  • Works with any Claude model in Claude Code, from Opus to Sonnet and Haiku.
  1. Step 1: Connect YouTube in Porter

    Sign up free at Porter, pick YouTube as the source and sign in with Google. Tick every channel you want Claude Code to read.

  2. Step 2: Add Porter to Claude Code

    In your terminal, run this command. It adds Porter for every project on your machine; drop --scope user to add it to the current project only.

    Terminal
    claude mcp add --transport http --scope user porter https://mcp.portermetrics.com/mcp

    Or, inside Claude Code, install Porter’s plugin, which adds the server and Porter’s skill together: /plugin marketplace add portermetrics/porter, then /plugin install porter-metrics@portermetrics.

  3. Step 3: Sign in and ask

    Start claude, type /mcp, pick porter and sign in with the Google account you use in Porter. When porter shows as connected, paste this prompt:

    Prompt
    Which YouTube channels can you see? List my 20 most viewed videos over the last 30 days YouTube has published, with video title and views, and save them to reports/yt-top.csv.

Guides and videos

app.portermetrics.com / create

Create: YouTube to Claude

Sign in with Google

Select the channel Claude can use.

$ claude mcp add --transport http --scope user porter https://mcp.portermetrics.com/mcp

$ claude mcp list
porter: https://mcp.portermetrics.com/mcp (HTTP)
Then, add Porter's MCP server from your terminal.
> /mcp
porter · needs authentication → Authenticate

> Which YouTube accounts can you see?
● porter - list_accounts (MCP)
Trailgear Demo
After you sign in from /mcp, Claude Code lists your YouTube accounts.
02Use cases and prompts

What you can do in Claude Code

Claude Code works inside your project, so YouTube answers can become files, scripts and dashboards instead of chat replies. Each use case has a prompt to copy and uses the YouTube fields Porter reads.

Can Claude Code export YouTube video stats?

The problemYouTube Studio shows videos one at a time, so a content audit means copying numbers.

What Claude Code doesClaude Code pulls video title, video URL, published date, views and watch time for your videos through Porter and writes them to a CSV.

What you getA full video file in your repo, ready for analysis.

Prompt
Using YouTube, list my 50 most viewed videos over the last 90 days YouTube has published, with video title, video URL, video published date, views and estimated minutes watched, and save them as data/yt-videos.csv.

Which traffic sources bring watch time?

The problemViews by source don’t show which sources keep people watching.

What Claude Code doesClaude Code pulls views and estimated minutes watched by traffic source and compares them.

What you getA source table that shows where to focus.

Prompt
Using YouTube, show views and estimated minutes watched by traffic source for the last 28 days YouTube has published, compare each source’s minutes per view and save it to reports/yt-sources.csv.

Can I schedule a YouTube report with Claude Code?

The problemIn YouTube Studio, comparing two weeks of views and watch time means switching date ranges and noting them by hand.

What Claude Code doesEach Monday claude -p compares views, estimated minutes watched and the top 3 videos with the week before.

What you getreports/yt-weekly.md naming the videos that drove watch time.

Prompt
claude -p "Using YouTube, compare last week with the week before: views, estimated minutes watched and the top 3 videos. Write it to reports/yt-weekly.md" --allowedTools "mcp__porter" "Write"
03Why Porter

Why Porter for YouTube in Claude Code

Porter reads your YouTube channel with the Google account that owns it, with no Google Cloud project, and puts YouTube next to Google Ads, GA4 and 30+ other sources behind the same server.

✓

One server for all your sources

The same porter server answers about YouTube, Meta Ads, Google Ads, GA4 and Shopify, so one script can pull every channel.

⊞

Every video in one file

Porter reads every video on the channel, so one prompt replaces opening each one in YouTube Studio.

⚙

No Cloud project or OAuth client

You sign in with Google in Porter and in Claude Code. There is no Google Cloud project or YouTube API key to set up.

↻

Hosted dashboards when a file isn’t enough

Ask for a Porter AI dashboard and it is published at its own link, synced automatically and ready to share with a client.

04Dashboard

Dashboard template

Ask Claude to build a live YouTube dashboard with AI dashboards, or browse Porter’s templates for other sources.

AI dashboards

Build a live YouTube dashboard from your terminal

Describe the dashboard in one sentence and Porter builds it. A client-ready dashboard in minutes, with no chart dragging and no BI tool to learn. Ask Claude Code:

Prompt
Build a live YouTube dashboard for my channel with the last 30 days YouTube has published: views, estimated minutes watched, subscribers gained and lost with a weekly trend, views by traffic source and my top 10 videos.
Live URLEach dashboard at its own link: no login, no app, no download
Auto-syncFresh YouTube data, nobody re-exports each period
Scheduled deliveryEmail or PDF sends on a set day
White labelYour logo and branding for clients
Sharing permissionsView or edit access per person
YouTube dashboard template by Porter
Template

The YouTube dashboard template

Start from Porter’s official YouTube dashboard template, or run the prompt above in Claude Code and Porter publishes the dashboard at its own link.

Or start from a template

05Pricing

Pricing

You can start free, since Porter’s YouTube connector for Claude comes with every plan. Use the calculator for your number of accounts, or see Porter pricing for every plan.

What you get

  • Free plan: never expires, with unlimited connected accounts and the last 15 days of data in Claude (30 days in Data Studio and Sheets)
  • Reporting: from $12.50 per account a month billed annually, or $15 month to month for one account
  • Billing: each YouTube channel counts as one account, with volume discounts and no per-seat fee
  • No credits needed: Claude's YouTube analytics questions are reads, so they use no AI credits
  • Trial: 14 days of full access, no card

Price calculator

$33.33/mo$6.67 per account

An account is one ad account, Stripe account, store, page or GA4 property. The Free plan never expires and has unlimited accounts, with the last 15 days of data in AI chats.

06Data and actions

YouTube data Claude can use

Claude reads your channel by day, six daily breakdowns (traffic source, device, operating system, subscribed status, content type and playback location) and your top videos for the date range, with all 34 fields in the YouTube fields list. One question reads one breakdown at a time: to cross traffic source with device, ask for each and let Claude compare them.

12 YouTube fields Claude uses most

FieldWhat it's for
Dateyoutube_dateThe day, as YouTube Analytics reports it
Viewsyoutube_viewsViews; the days add up to YouTube's total for the period
Estimated Minutes Watchedyoutube_estimated_minutes_watchedWatch time in minutes, rounded by YouTube each day
Average View Duration (s)youtube_average_view_durationAverage length of a view; an average, never summed
Average Percentage Viewedyoutube_average_view_percentageShare of a video watched per view; an average
Subscribers Gained · Subscribers Lostyoutube_subscribers_gained · youtube_subscribers_lostSubscriber change per day
Likes · Comments · Sharesyoutube_likes · youtube_comments · youtube_sharesEngagement per day
Traffic Sourceyoutube_traffic_source_typeHow viewers reached the video: search, suggested, external…
Content Typeyoutube_content_typeShorts, videos or live streams
Subscribed Statusyoutube_subscribed_statusWhether the viewer was subscribed
Video Title · Video URLyoutube_video_title · youtube_video_urlThe video's current title and its link
Video Published Dateyoutube_video_published_atWhen the video went live, to count videos per period

Product stats

WhatYouTube connector
Fields34 in 10 groups: 16 dimensions and 18 metrics
TablesChannel by day; daily breakdowns by traffic source, device, operating system, subscribed status, content type and playback location; top videos for the range
FreshnessUp to the last day YouTube has published, about 3 days back; the last week's figures can still drop slightly
Top videosUp to the 200 most viewed videos of the range, for the whole range rather than by day
BreakdownsOne per question; content type adds up to the channel's views exactly, the others land slightly below
AccessGoogle sign-in as the channel owner, with read-only YouTube and YouTube Analytics permissions; one channel per connection
Not includedAge and gender, video by day, and videos below the top 200 of the range

See all 34 YouTube fields

07Security

Is it safe?

Yes. Porter's YouTube connector for Claude Code reads your channel analytics with the read-only permissions you accept on Google's sign-in screen. With those permissions Porter cannot upload, edit or delete anything on your channel.

Google's own sign-in

You sign in on Google's page and accept read-only access to YouTube and YouTube Analytics. You never give Porter your password, and you can remove Porter's access from your Google account at any time.

Analytics, read when you ask

Claude queries Porter, not YouTube directly. Porter asks YouTube Analytics for the fields and dates in your question and returns them to Claude.

What the connector needs from Google

A sign-in with the Google account that owns or manages the channel, because YouTube only shows channel analytics to its owner. Each channel you pick is one connection.

08FAQ

FAQ

Answers on setup, scope, scripts and credits, plus fixes for the most common Claude Code errors with YouTube. Setup questions every source shares, like where Claude Code saves the server and how to share it with your team, are in the Claude Code hub FAQ.

Can I add TikTok to the YouTube report?

Yes. Connect TikTok in Porter and ask for Video Views next to YouTube views. Claude Code writes both channels to one content report.

Why do prompts ask for the days YouTube has published?

YouTube Analytics updates with a delay of a few days, so prompts on this page ask for the latest published range to compare complete days.

Do Claude Code questions use Porter credits?

Reading YouTube data uses no AI credits, so questions and reports on this page are free on every plan.

Troubleshooting

Why does /mcp show porter as needing authentication?

Claude Code adds the server before you sign in. Pick porter in /mcp, choose Authenticate and sign in with the Google account you use in Porter.

Why does my claude -p script stop and ask for permission?

Scripts can’t answer permission prompts. Pass the tools the script may use, for example --allowedTools "mcp__porter" "Write", so Claude Code can read Porter and save files without stopping.

Why does Claude Code see my channel but return no data?

Usually the Google account doesn’t own or manage that channel, or it is a Brand Account you haven’t switched to. Check channel permissions in YouTube Studio, then ask again.

09Next

More Claude connectors

YouTube views make more sense next to your other social channels and the traffic and campaigns around them, and Porter brings each of those sources in through the same MCP URL. Add the ones you report on, or browse all Claude connectors:

Not only Claude

The same Porter account and connection work in any AI tool that supports MCP, at no extra cost.

Try the connector in Claude Code

Porter’s YouTube connector for Claude Code takes one command, so your first video file can land in your project today.

Free plan · 14-day trial · No card needed

Video and content marketers: views, watch time and sources land in one file.

Social media managers: the videos and sources worth repeating stand out.

Agencies: one script builds the weekly report for every client channel.