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.
https://youtubetranscriptapi.com/mcpWhat 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.
Connect Codex
Add the server
Terminalcodex mcp add youtube --url https://youtubetranscriptapi.com/mcpSign in
Run
codex mcp login youtube, or/mcp login youtubeinside Codex. Your browser opens our consent screen; approve and you're connected.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:
codex mcp add youtube --url https://youtubetranscriptapi.com/mcp --bearer-token-env-var YTT_API_KEY
That writes this to ~/.codex/config.toml:
[mcp_servers.youtube]
url = "https://youtubetranscriptapi.com/mcp"
bearer_token_env_var = "YTT_API_KEY"Try this 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).
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
›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.