Codex · about 2 minutes · Sign in or API key

YouTube MCP server for Codex

One command adds the hosted server to Codex. Sign in with codex mcp login, or point it at an API key in your environment.

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

What you need

  • The Codex CLI or the Codex IDE extension. They share ~/.codex/config.toml.
  • An API key from Dashboard → API Keys (or sign in instead, where the app supports it). New accounts get 100 free credits.
Setup

Connect Codex

  1. Add the server

    Terminal
    codex mcp add youtube --url https://youtubetranscriptapi.com/mcp
  2. Sign in

    Run codex mcp login youtube, or /mcp login youtube inside Codex. Your browser opens our consent screen; approve and you're connected.

  3. Use it

    Ask for something that needs a video. Codex lists the tools it can call with /mcp.

With an API key instead

Keep the key in an environment variable and tell Codex its name:

Terminal
codex mcp add youtube --url https://youtubetranscriptapi.com/mcp --bearer-token-env-var YTT_API_KEY

That writes this to ~/.codex/config.toml:

toml
[mcp_servers.youtube]
url = "https://youtubetranscriptapi.com/mcp"
bearer_token_env_var = "YTT_API_KEY"
Test it

Try this prompt

Prompt
Use the youtube MCP tools to find the newest video from @freecodecamp and summarize its transcript.

Codex calls get_latest_videos (free) 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

›401 with an API key

Check that YTT_API_KEY is set in the shell that starts Codex, and holds the whole tk_live_… key.

›The browser didn't open for sign-in

Run codex mcp login youtube again from a terminal on the same machine; the sign-in returns to a local address.

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

Codex changes its menus from time to time. We checked these steps on 18 October 2026 against Codex MCP docs and Codex CLI reference. 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 Codex?

Create a free account first if you like: it comes with 100 credits, enough for about 100 transcripts.

YouTube MCP server for Codex: CLI and config.toml