# How to add a YouTube MCP server to Claude Code

October 8, 2026

Add a YouTube MCP server to Claude Code with one command. Ask about any video and your agent reads the transcript, the comments and the channel behind it.

To add a YouTube MCP server to Claude Code, run one command. Claude Code can then search YouTube, read a video's transcript, read its comments and look at the channel behind it, all from a plain question.

Stophy is the web data API for AI agents, and its MCP server covers YouTube along with other sites. You sign in with your browser, so there is no API key to copy.

## The short version

| Step | What you do |
| --- | --- |
| Add the server | Run one command in your terminal |
| Sign in | Run /mcp in Claude Code and select Authenticate |
| Ask | Paste a YouTube link or name a topic |

I ran four YouTube calls through the Stophy MCP tools, and the output below is what came back. I did not change my own Claude Code setup for this post. The setup command is the one on the Stophy [MCP page](https://stophy.dev/mcp).

## What is a YouTube MCP server?

MCP is the way an agent calls outside tools. A YouTube MCP server gives the agent tools that read YouTube. You paste a link or name a topic, and the agent calls the tool and answers from what comes back.

Without it, Claude Code has no way to watch a video. It can read your repo and run your tests, but a conference talk is closed to it. With it, the agent reads the captions, so it knows what the speaker said, and it reads the comments, so it knows what viewers thought.

The Stophy server has three tools. stophy_search_endpoints finds an endpoint from plain words. stophy_describe_endpoint shows its inputs and output fields. stophy_call runs it. YouTube is one source among many, and each YouTube action is an endpoint such as youtubeSearch or youtubeTranscript.

## Step 1. Add the server to Claude Code

Run this in your terminal.

```shell
claude mcp add --transport http stophy https://mcp.stophy.dev/mcp
```

## Step 2. Sign in

Open Claude Code, run /mcp, select stophy and select Authenticate. Your browser opens, you sign in, and the server shows as connected. The server uses OAuth, so there is no key to copy.

A new account has 1,000 credits. Every YouTube endpoint works, including playlists, related videos and charts.

Honest take. This takes one minute and nothing sits in a config file. The step people miss is Authenticate, so do not skip it.

## What Claude Code can do with YouTube

Each row is an endpoint. The Stophy [YouTube API pages](https://stophy.dev/youtube-transcript-api) show the fields of each one.

| Ask for | Endpoint |
| --- | --- |
| Search videos, channels, playlists, Shorts | youtubeSearch |
| Stats, description and chapters of a video | youtubeVideo |
| What a video says | youtubeTranscript |
| Comments, and replies to one comment | youtubeComments |
| A channel and its videos, Shorts or playlists | youtubeChannel |
| Search inside one channel | youtubeChannelSearch |
| Playlist contents | youtubePlaylist |
| The videos YouTube suggests next | youtubeRelated |
| Videos on a hashtag, search suggestions, community posts, charts | youtubeHashtag, youtubeSuggest, youtubePost, youtubeCharts |

## Example 1. Find the videos on a topic

The question is find the most watched Claude Code tutorials from this year. The agent finds the endpoint with stophy_search_endpoints, then makes this call.

```json
{
  "id": "youtubeSearch",
  "input": {
    "query": "claude code tutorial",
    "type": "videos",
    "uploadDate": "thisYear",
    "prioritize": "popularity"
  },
  "fields": ["title", "channelName", "views", "durationSeconds", "videoId"]
}
```

fields keeps only the keys you name, so the response is small and the agent spends fewer tokens. One call returned 20 videos. These are the first three.

```json
{
  "success": true,
  "data": {
    "results": [
      { "videoId": "fl1DSmwQKKY", "title": "What is Claude Code?", "channelName": "Claude", "durationSeconds": 176, "views": 12907621 },
      { "videoId": "QoQBzR1NIqI", "title": "CLAUDE CODE FULL COURSE 4 HOURS: Build & Sell (2026)", "channelName": "Nick Saraev", "durationSeconds": 15043, "views": 2625582 },
      { "videoId": "0vZ_UVLhSQQ", "title": "Getting started with Claude.ai", "channelName": "Anthropic", "durationSeconds": 319, "views": 2379232 }
    ],
    "cursor": "seen.eyJ0b2tlbiI6..."
  },
  "creditsUsed": 1
}
```

Look at the third row. It has fewer views than the fourth video in the full list, which had 2,466,188. The search ranks by YouTube's idea of popular, so read the views column and do not assume a strict order.

## Example 2. Read what a video says

Next the question is what the top video says. The agent takes the videoId from the first result and calls the transcript endpoint.

```json
{
  "id": "youtubeTranscript",
  "input": { "videoId": "fl1DSmwQKKY", "language": "en" }
}
```

```json
{
  "success": true,
  "data": {
    "videoId": "fl1DSmwQKKY",
    "language": "en",
    "isAutoGenerated": true,
    "durationSeconds": 175,
    "text": "Claude Code is [music] an agentic coding tool that understands your code base, edits your files, run commands, ... Unlike Claude AI, Claude Code has direct access to your files in your terminal and your entire code base. ..."
  },
  "creditsUsed": 1
}
```

From that text the agent can answer, for example, how Claude Code differs from the chat app. The video says it has direct access to your files and your terminal.

One thing to know. My first call left out language, and the transcript came back in Arabic, although the video is in English. I got the same result on a second call. Set language when you care. Say "in English" in your prompt and the agent will pass it. Add includeTimestamps set to true when you want a segments list with startSeconds and endSeconds for each line.

isAutoGenerated is true here, which is why you see [music] in the text. Read before you quote.

## Example 3. Read the comments

Then the question is what viewers said. The agent calls the comments endpoint, sorted by top.

```json
{
  "id": "youtubeComments",
  "input": { "videoId": "fl1DSmwQKKY", "sort": "top" },
  "fields": ["authorName", "text", "likes"]
}
```

```json
{
  "success": true,
  "data": {
    "results": [
      { "authorName": "monothony", "text": "I hit my weekly limit just watching this video.", "likes": 1700 },
      { "authorName": "jaedynchilton8179", "text": "Even the thumbnail is using Opus 4.6 over 4.7 lmao", "likes": 457 },
      { "authorName": "azox001", "text": "Oh great just what we need: trying to get everyone to use claude code at the same time when you dont have enough compute for everyone.", "likes": 220 }
    ],
    "cursor": "Eg0SC2ZsMURTbXdRS0tZ..."
  },
  "creditsUsed": 1
}
```

I cut the list to three of the 20 comments that came back. Most of the top ones joke about usage limits, and few say anything about the video itself. That is the kind of read an agent can do for you. Pass the cursor to get the next page.

## Example 4. Look at the channel behind it

Last, the question is which videos on the channel get the most views.

```json
{
  "id": "youtubeChannel",
  "input": { "channelId": "@claude", "sort": "popular" }
}
```

The response has the channel profile, 621,000 subscribers and 220 videos, and a results list. The top entry was "Tag Claude in, right where you already work" at 145 seconds. The channel list gave its views as 77000000, a rounded number. For an exact count, ask for that video with youtubeVideo.

## What it costs

A call that returns data costs 1 credit, and charts cost 1 credit per 10 results. A new account has 1,000 credits. Each example above cost 1 credit. A call that returns an error or an empty list costs nothing.

## What does not work

- Private, removed and age restricted videos return an error that says so. I tried a made up id and got that error.
- Transcripts need captions. A video with none returns an error that says so.
- The transcript reads captions, so it does not describe what is on screen.
- Search order is not strictly by views, as example 1 showed.
- The agent cannot post, like or comment. Every endpoint reads public data.

## When to skip the agent

If you only want a single transcript, skip the agent and use the [free transcript tool](https://stophy.dev/tools/youtube-transcript-generator). If you want the same calls in code, the [TypeScript SDK](https://docs.stophy.dev/sdk-typescript) and the [CLI](https://stophy.dev/cli) call the same endpoints.

## Frequently asked questions

### What is a YouTube MCP server?

It is a server that gives an AI agent tools to read YouTube. The agent calls them to search videos, get a transcript, read comments or look at a channel. You add the server once and then ask in plain words.

### How do I add an MCP server to Claude Code?

Run claude mcp add with the transport and the server address. For this server that is claude mcp add --transport http stophy https://mcp.stophy.dev/mcp. Then run /mcp inside Claude Code and select Authenticate.

### Do I need an API key for the YouTube MCP server?

No. You sign in with your browser, so there is no API key to copy or store.

### Does it use the YouTube Data API?

No. You call Stophy, so you need no YouTube Data API key and no Google login. The [YouTube search API page](https://stophy.dev/youtube-search-api) lists the inputs.

### Can Claude Code get a YouTube transcript?

Yes. Paste a link and ask what the video says. The agent calls the transcript endpoint and answers from the captions. See the [YouTube transcript API](https://stophy.dev/youtube-transcript-api) for the fields.

### Does it work for a video without captions?

No. The transcript comes from the video's captions, and a video with none returns an error. You pay nothing for that call.

### How much does a YouTube call cost?

One credit for a call that returns data. Errors and empty results cost nothing, and a new account starts with 1,000 credits.

### Why did my transcript come back in the wrong language?

I saw this once. A transcript with no language came back in Arabic for an English video. Set language to en, or the code you want, and the transcript matches.

### Can Claude Code read YouTube comments?

Yes. Ask for the top comments of a video and the agent calls the comments endpoint. You can sort by top or newest and page through with the cursor.

### Does the same server work in Codex and Cursor?

Yes. Any MCP client that connects to a Streamable HTTP server and supports OAuth can use it. The [MCP page](https://stophy.dev/mcp) has the setup for each agent.
