Gemini CLI · about 3 minutes · Sign in or API key

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.

Server URL
https://youtubetranscriptapi.com/mcp
Before you start

What you need

  • Gemini CLI or Antigravity. If gemini tells 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.
Setup

Connect Gemini CLI

  1. Add the server to Gemini CLI

    Terminal
    gemini mcp add --transport http youtube https://youtubetranscriptapi.com/mcp
  2. Sign in

    Start Gemini CLI and run /mcp auth youtube. It finds our sign-in page by itself; approve on the consent screen.

  3. Check it

    /mcp lists the server and its seven tools.

Gemini CLI with an API key

Terminal
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.

json
{
  "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.

json
{
  "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.

Test it

Try this prompt

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).

Pricing

What each call costs

ToolWhat it doesCost
get_transcriptRead what's said in any public video1 credit
search_youtubeSearch YouTube for videos or channels4 credits
search_channelSearch one channel's videos for a topic1 credit
list_channel_videosList a channel's latest 100 uploads20 credits
get_latest_videosSee a channel's 15 newest videosFree
resolve_channelTurn an @handle into a channel IDFree
list_playlist_videosList the videos in a playlist20 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.
Help

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.

YouTube MCP server for Gemini CLI and Antigravity