YouTube MCP server for Gemini CLI and Antigravity
Steps for both of Google's coding agents: Gemini CLI and Antigravity. Their config files look alike but use different field names, so pick the right one.
https://youtubetranscriptapi.com/mcpWhat you need
- Gemini CLI or Antigravity. If
geminitells you it has moved to Antigravity, use the Antigravity steps further down. - An API key from Dashboard → API Keys (or sign in instead, where the app supports it). New accounts get 100 free credits.
Connect Gemini CLI
Add the server to Gemini CLI
Terminalgemini mcp add --transport http youtube https://youtubetranscriptapi.com/mcpSign in
Start Gemini CLI and run
/mcp auth youtube. It finds our sign-in page by itself; approve on the consent screen.Check it
/mcplists the server and its seven tools.
Gemini CLI with an API key
gemini mcp add --transport http --header "Authorization: Bearer YOUR_API_KEY" youtube https://youtubetranscriptapi.com/mcp
Or in ~/.gemini/settings.json. Use httpUrl: in Gemini CLI, url means the older SSE transport.
{
"mcpServers": {
"youtube": {
"httpUrl": "https://youtubetranscriptapi.com/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}Antigravity
Add the server in ~/.gemini/config/mcp_config.json (all workspaces) or .agents/mcp_config.json (one workspace). Antigravity uses serverUrl; url and httpUrl don't work for remote servers there.
{
"mcpServers": {
"youtube": { "serverUrl": "https://youtubetranscriptapi.com/mcp" }
}
}Without headers, Antigravity signs in for you. To use a key, add "headers": { "Authorization": "Bearer YOUR_API_KEY" }; the file doesn't read environment variables, so keep it out of shared folders. In the CLI, /mcp shows the server.
Try this prompt
Use the youtube tools to search @freecodecamp's videos for "docker" and summarize the best match.
The agent calls search_channel (1 credit) and get_transcript (1 credit).
What each call costs
| Tool | What it does | Cost |
|---|---|---|
| get_transcript | Read what's said in any public video | 1 credit |
| search_youtube | Search YouTube for videos or channels | 4 credits |
| search_channel | Search one channel's videos for a topic | 1 credit |
| list_channel_videos | List a channel's latest 100 uploads | 20 credits |
| get_latest_videos | See a channel's 15 newest videos | Free |
| resolve_channel | Turn an @handle into a channel ID | Free |
| list_playlist_videos | List the videos in a playlist | 20 credits |
- Failed calls are never charged: a video without captions, a bad link, a timeout.
- A long transcript comes back in parts. Later parts, and reading the same video again within 24 hours, cost nothing.
- Free tools still need a balance of at least 1 credit.
- New accounts get 100 free credits, no card needed. See plans.
If something doesn't work
›The tools don't load in Gemini CLI
Check the field is httpUrl. With url, Gemini CLI tries the older SSE transport, which this server doesn't use.
›Antigravity doesn't see the server
It needs serverUrl, and the file has to be the global or workspace mcp_config.json named above.
›It says I've run out of credits
The app shows our message with a link to billing. Free tools such as get_latest_videos need at least 1 credit too. Calls that fail are never charged.
›"Transcript unavailable" for a video
The video has no captions, is private, or was removed. Nothing is charged. Try another language with “use the Spanish captions”, for example, if the video has captions in a different language.
Disconnect
Revoke the key in Dashboard → API Keys. If you signed in instead, use Dashboard → Connected apps.
Gemini CLI changes its menus from time to time. We checked these steps on 18 October 2026 against Gemini CLI MCP docs and Antigravity MCP docs. If something looks different, the app has probably moved it; tell us through the contact form.
Product names and logos belong to their owners and are shown only to say which apps this works with. OpenAI, ChatGPT, Codex and the OpenAI logo are trademarks of OpenAI. YouTubeTranscriptAPI isn't affiliated with or endorsed by them.
Ready to connect Gemini CLI?
Create a free account first if you like: it comes with 100 credits, enough for about 100 transcripts.