GitHubLog in
SDKs & integrations

OpenAI

Give GPT models video transcripts as a tool: the TranscriptFetch MCP server in the Responses API and the Agents SDK, with tested examples.

Works with OpenAI. The TranscriptFetch MCP server plugs into OpenAI's Responses API and the Agents SDK as a remote MCP tool, so a GPT model can read video transcripts, search YouTube, TikTok and Instagram, and list channels and playlists on its own. Every example on this page was run against production on 2026-10-20. Credits are the same as the API: one per successful caption fetch or listing page, AI Fallback Transcription 1 credit per started 5 minutes of audio, and failed requests are free.

What you need

  • An API key from the dashboard (50 free credits a month). Keep it server-side, for example in TRANSCRIPTFETCH_API_KEY.
  • The server URL https://transcriptfetch.com/mcp (streamable HTTP). It takes the API key as a bearer token, or OAuth for connectors that sign the user in.

Responses API

OpenAI's servers call TranscriptFetch for you during the response. Pass the key in the tool's authorization field. OpenAI does not store that value, so send it with every request.

PYTHON
import os
from openai import OpenAI

client = OpenAI()
response = client.responses.create(
    model="gpt-5.4",
    tools=[{
        "type": "mcp",
        "server_label": "transcriptfetch",
        "server_description": "Video transcripts from YouTube, TikTok and Instagram.",
        "server_url": "https://transcriptfetch.com/mcp",
        "authorization": os.environ["TRANSCRIPTFETCH_API_KEY"],
        "require_approval": "never",
        "allowed_tools": ["get_transcript", "search_videos"],
    }],
    input="Get the transcript of https://www.youtube.com/watch?v=jNQXAC9IVRw and quote its first sentence.",
)
print(response.output_text)

The same request with curl:

BASH
curl -s https://api.openai.com/v1/responses \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4",
    "tools": [{
      "type": "mcp",
      "server_label": "transcriptfetch",
      "server_url": "https://transcriptfetch.com/mcp",
      "authorization": "'"$TRANSCRIPTFETCH_API_KEY"'",
      "require_approval": "never",
      "allowed_tools": ["get_transcript", "search_videos"]
    }],
    "input": "Get the transcript of https://www.youtube.com/watch?v=jNQXAC9IVRw and quote its first sentence."
  }'
  • require_approval: by default OpenAI asks you to approve each call before any data goes to a remote server. "never" skips that for a server you trust.
  • allowed_tools: expose only the tools the model needs. Leave it out to offer all seven (see Tools).
  • The response's output lists mcp_list_tools, then each mcp_call (tool name, arguments, result, or an error), then the model's message.

Agents SDK

The SDK offers the same hosted tool, or a local connection where your own process calls TranscriptFetch and the key never leaves your server.

Hosted (OpenAI calls TranscriptFetch, as in the Responses API):

PYTHON
import asyncio
import os
from agents import Agent, HostedMCPTool, Runner

agent = Agent(
    name="Researcher",
    model="gpt-5.4",
    instructions="Use the TranscriptFetch tools to read videos before answering.",
    tools=[
        HostedMCPTool(tool_config={
            "type": "mcp",
            "server_label": "transcriptfetch",
            "server_url": "https://transcriptfetch.com/mcp",
            "authorization": os.environ["TRANSCRIPTFETCH_API_KEY"],
            "require_approval": "never",
            "allowed_tools": ["get_transcript", "search_videos"],
        })
    ],
)

result = asyncio.run(Runner.run(agent, "What does https://www.youtube.com/watch?v=jNQXAC9IVRw say?"))
print(result.final_output)

Local (your process calls TranscriptFetch):

PYTHON
import asyncio
import os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp


async def main() -> None:
    async with MCPServerStreamableHttp(
        name="TranscriptFetch",
        params={
            "url": "https://transcriptfetch.com/mcp",
            "headers": {"Authorization": f"Bearer {os.environ['TRANSCRIPTFETCH_API_KEY']}"},
        },
        cache_tools_list=True,
    ) as server:
        agent = Agent(
            name="Researcher",
            model="gpt-5.4",
            instructions="Use the TranscriptFetch tools to read videos before answering.",
            mcp_servers=[server],
        )
        result = await Runner.run(agent, "What does https://www.youtube.com/watch?v=jNQXAC9IVRw say?")
        print(result.final_output)


asyncio.run(main())

Tools

ToolWhat it doesCredits
get_transcriptOne video's transcript: YouTube, TikTok, Instagram or a direct media file URL1 per caption transcript; AI Fallback Transcription 1 credit per started 5 minutes of audio
search_videosSearch videos, with YouTube's upload date, duration, captions and sort filters1 per page
search_channelsFind YouTube channels or playlists1 per page
list_channel_videosA YouTube channel's videos, Shorts or live streams, or a TikTok or Instagram profile1 per page
list_channel_playlistsA YouTube channel's playlists or podcasts1 per page
list_playlist_videosA playlist's videos1 per page
get_creditsThe account's remaining creditsfree

Spend fewer tokens

Timestamped segments repeat every word with its timings. When the model only needs the words, have it call get_transcript with timestamps: false (say so in the agent's instructions), or send "timestamps": false to the REST API. Plain text uses about two-thirds fewer tokens than the same transcript as SRT, WebVTT or YouTube's caption XML: the median saving across 9 videos from 20 seconds to 2 hours was 64 to 67%, counted with OpenAI's o200k tokenizer. Keep the segments when answers need timestamps to cite.