HomeBlog

OpenAI Responses API MCP: YouTube Transcripts for GPT-5

OpenAI Responses API connecting to a remote MCP server to fetch a YouTube transcript

The OpenAI Responses API can call remote MCP servers directly — you declare the server in tools, and the model discovers and calls its tools on its own. Wire in youtube2text.org's MCP server and GPT-5 can fetch any YouTube transcript mid-conversation without you writing a single fetch call. I tested this exact setup against gpt-5 today; the config below is copy-paste ready.

The tool block

This is the entire integration:

{
  "type": "mcp",
  "server_label": "youtube2text",
  "server_url": "https://youtube2text.org/mcp",
  "headers": {"x-api-key": "YOUR_KEY"},
  "require_approval": "never"
}

The headers field passes your youtube2text API key through to the server on every call. require_approval: "never" skips the human-approval round trip — reasonable here, since the only tool is a read-only transcript fetch. Get a key via Google sign-in at youtube2text.org/app/keys, or grab the shared demo key from GET https://youtube2text.org/api/demo-key (5 videos/month per IP).

Full Python example

from openai import OpenAI

client = OpenAI()

resp = client.responses.create(
    model="gpt-5",
    tools=[{
        "type": "mcp",
        "server_label": "youtube2text",
        "server_url": "https://youtube2text.org/mcp",
        "headers": {"x-api-key": "YOUR_KEY"},
        "require_approval": "never",
    }],
    input="Summarize https://www.youtube.com/watch?v=dQw4w9WgXcQ "
          "in five bullet points.",
)

print(resp.output_text)

That's it. No transcript-fetching code, no parsing, no prompt assembly. The model decides it needs the transcript, calls the tool, reads the result, and writes the summary.

What happens under the hood

Walk through resp.output and you'll see the machinery:

  1. An mcp_list_tools item appears first. The Responses API connected to https://youtube2text.org/mcp and pulled the tool manifest — in our case a single tool, transcribe_video(url, maxChars?), which returns {title, content, contentSize, videoId, pubDate, truncated}. This import happens once per conversation and gets cached on subsequent turns.
  2. When the model decides to call it, an mcp_call item shows up with the arguments it chose ({"url": "https://www.youtube.com/watch?v=..."}) and, once the server responds, the full tool output.
  3. Finally a regular message item with the model's answer, which is what output_text gives you.

The server is streamable HTTP and stateless, so there's no session handshake to manage — each call stands alone. If a video has no captions the tool returns a TRANSCRIPT_UNAVAILABLE error, which the model relays in plain English rather than crashing your run.

One quirk worth knowing

GPT-5 will happily summarize, analyze, and quote short fragments from transcripts. Ask it to reproduce long verbatim passages, though, and it may refuse — OpenAI's copyright guardrails kick in on extended word-for-word reproduction of third-party content. In my testing today, summaries, topic extraction, and Q&A all worked without friction; "give me the full transcript back" did not. If you need the raw text, skip the model entirely and hit the REST endpoint with curl — you're paying tokens to launder your own API response otherwise.

Cost note

Transcripts are big. An hour of talking is roughly 8,000-10,000 words, all of which land in GPT-5's context as tool output and get billed as input tokens. If you're summarizing at volume, pass maxChars in your prompt instruction (the model forwards it as a tool argument) or preprocess with something cheaper.

Same server, other clients

The identical MCP endpoint works with Claude — via the Messages API mcp_servers block or as a claude.ai connector and in Claude Code — so one youtube2text key covers your whole agent zoo.

Keys and plans (free 5/mo up to unlimited at $19.99) live at youtube2text.org/app/keys.