Stophy blog
How to Add a YouTube MCP Server to Claude Code
Wire the Stophy YouTube MCP server into Claude Code with one command. Search videos, pull transcripts, read comments, and browse channels without leaving the terminal.
Claude Code can read your repo, run your tests, and edit files, but ask it what a conference talk actually said and it has nothing to work with. There's no YouTube in its toolbox. The Stophy MCP server adds it. One claude mcp add and the model can search videos, fetch transcripts, read comment threads, and browse channels mid-session.
This guide covers both transports Claude Code supports, the hosted HTTP endpoint and a local stdio server, plus how to confirm the tools actually registered.
Prerequisites
- Claude Code installed and authenticated
- A Stophy API key (see below)
- Node.js, only for the local stdio option
Get an API key
Create an account at stophy.dev/dashboard. Keys are issued instantly and start with st_. Copy one. It goes straight into the command in the next step.
Pricing is per call. One credit per data tool, stophy_get_credits is free, and credits don't expire. You don't touch the YouTube Data API, request quota, or run a scraper.
Add the server to Claude Code
Claude Code keeps MCP servers in its own config, so you add them with the CLI rather than editing a file by hand. Pick one transport.
Hosted HTTP (recommended)
No local process, no Node, nothing to keep running. Claude Code talks to api.stophy.dev directly and your key rides in the auth header.
1claude mcp add --transport http stophy https://api.stophy.dev/v1/mcp \2 --header "Authorization: Bearer st_YOUR_API_KEY"Local stdio server
If you'd rather run the server as a subprocess, to proxy traffic, pin a version, or work in a locked-down network, use the npm package. Claude Code spawns it and passes the key through the environment.
1claude mcp add stophy -e STOPHY_API_KEY=st_YOUR_API_KEY -- npx -y @stophy/mcpConfirm it registered
1claude mcp liststophy should show up as connected. If it doesn't, jump to Troubleshooting.
Run your first query
Open a session and ask for something that needs YouTube. Claude Code picks the tool on its own.
Search YouTube for "claude code" and show me the top 3 by view count.
That calls stophy_search_videos. Results come back as structured JSON, an array at data.items[] where each item carries videoUrl, viewCount, viewCountText, and durationText, so the model can rank and cite them directly. This is a real response, trimmed to the fields that matter:
1{2 "success": true,3 "creditsRemaining": 35689,4 "data": {5 "query": { "q": "claude code", "type": "video", "sortBy": "popularity" },6 "items": [7 {8 "type": "video",9 "videoUrl": "https://youtube.com/watch?v=fl1DSmwQKKY",10 "title": "What is Claude Code?",11 "author": "Claude",12 "viewCount": 3963558,13 "viewCountText": "4M Views",14 "durationText": "2:56"15 },16 {17 "type": "video",18 "videoUrl": "https://youtube.com/watch?v=QoQBzR1NIqI",19 "title": "CLAUDE CODE FULL COURSE 4 HOURS: Build & Sell (2026)",20 "author": "Nick Saraev",21 "viewCount": 2026302,22 "viewCountText": "2M Views",23 "durationText": "4:10:43"24 },25 {26 "type": "video",27 "videoUrl": "https://youtube.com/watch?v=wZeOwqmSw84",28 "title": "Learn 97% of Claude in Under 16 Minutes",29 "author": "Dan Martell",30 "viewCount": 1696299,31 "viewCountText": "1.7M Views",32 "durationText": "15:13"33 }34 ]35 }36}Then chain it. Hand the model the top result and ask for the transcript.
Get the transcript for https://youtube.com/watch?v=fl1DSmwQKKY and summarize what Claude Code does.
That's stophy_get_video with type="transcript". It returns timestamped segments the model reads like any other source:
1{2 "data": {3 "language": { "code": "en" },4 "segments": [5 { "start": 4.32, "text": "Claude Code is an agentic coding" },6 { "start": 6.24, "text": "tool that understands your code base," },7 { "start": 8.28, "text": "edits your files, run commands, and" }8 ]9 }10}Comments work the same way. Ask for type="comments" and you get the real threads, ranked, with like counts:
1{2 "data": {3 "items": [4 { "author": "@monothony", "text": "I hit my weekly limit just watching this video.", "likeCount": 1500 },5 { "author": "@jaedynchilton8179", "text": "Even the thumbnail is using Opus 4.6 over 4.7 lmao", "likeCount": 413 }6 ]7 }8}The tools you just added
| Tool | What it does |
|---|---|
stophy_search_videos | Search YouTube by keyword, with filters for type, upload date, duration, and sort order |
stophy_get_video | Fetch details, transcript, comments, replies, or live chat for a video URL |
stophy_get_channel | Browse a channel's videos, Shorts, playlists, or about page |
stophy_get_playlist | List a playlist's videos with metadata |
stophy_get_suggestions | Get autocomplete suggestions for a partial query |
stophy_get_credits | Check your remaining balance (free) |
What that unlocks
- Research mid-task. Search a topic, pull transcripts from the top results, and have Claude Code fold the findings into the code or doc it's already writing.
- Comment mining. Fetch a video's threads and ask for the recurring complaints or feature requests.
- Channel audits. Pull a channel's uploads with view counts to benchmark what lands.
- Playlist extraction. Turn a course playlist into structured notes or a study outline, one transcript at a time.
Troubleshooting
stophy not connected in claude mcp list? Re-check the key at stophy.dev/dashboard and make sure the header reads exactly Bearer st_... with one space and no stray whitespace.
Tools missing in a session? They load at session start. Restart Claude Code after adding the server, then run claude mcp list to confirm it's registered and connected.
Local server failing? Run npx -y @stophy/mcp in a terminal to surface the real error, usually a missing Node install or a blocked npm registry.
FAQ
Does this use the official YouTube Data API? No. Stophy reads YouTube without Google quota or approval forms, so there's nothing to apply for and no daily cap to hit.
What does each call cost?
One credit per data tool. stophy_get_credits is free and credits don't expire. New accounts start with a free balance.
Do I have to run anything locally?
Not with the hosted HTTP transport. claude mcp add --transport http registers the remote server with your key, so there's no Node process to keep alive. The local stdio option is there when you want it.
Can I limit the server to one project? Yes. Claude Code scopes MCP servers, so add it from inside a project to keep it out of your global config.
Related guides
- Add the YouTube MCP server to Codex
- Add the YouTube MCP server to Cursor
- Add the YouTube MCP server to Hermes Agent
- The Stophy CLI and MCP server, side by side
Get your API key at stophy.dev/dashboard →
Full reference for every client and tool lives at docs.stophy.dev/mcp.
Related posts
How to Add a YouTube MCP Server to Codex
Add the Stophy YouTube MCP server to OpenAI's Codex CLI with one TOML block. Search videos, pull transcripts, read comments, and browse channels from your terminal.
How to Add a YouTube MCP Server to Cursor
Add the Stophy YouTube MCP server to Cursor with one JSON block. Search videos, pull transcripts, read comments, and browse channels from Cursor's Agent.
How to Add a YouTube MCP Server to Hermes Agent
Add the Stophy YouTube MCP server to Nous Research's Hermes Agent with one YAML block. Search videos, pull transcripts, read comments, and monitor live chat.