youtube-transcript-mcp
youtube-transcript-mcp
코딩 에이전트가 YouTube 동영상 트랜스크립트를 읽고 검색할 수 있게 해주는 MCP 서버입니다. API 키도, Google 계정도, 가입할 것도 필요 없습니다. YouTube의 공개 엔드포인트를 통해 자막을 가져오고, 원시 트랜스크립트 덤프가 제공하지 않는 한 가지 작은 기능, 즉 챕터 요약을 추가합니다.
이 프로젝트는 제가 개인적으로 쓰려고 만든 작은 도구에서 시작했습니다. YouTube 링크가 포함된 대화를 자주 접하게 되었고, 그 동영상이 실제로 무엇을 말하는지 알아야 했는데, 트랜스크립트를 계속 복사해서 붙여넣는 것이 시간 낭비였습니다. 그래서 Model Context Protocol에서 실행되는 모든 것이 그냥 물어볼 수 있는 재사용 가능한 서버가 되었습니다.
기능
네 가지 도구가 있습니다.
get_transcript(video_url_or_id, languages=["en"], include_timestamps=False)는 전체 트랜스크립트를 일반 텍스트로 가져옵니다. 전체 YouTube URL(watch?v=, youtu.be, /embed/, /shorts/, /live/) 또는 11자리 동영상 ID만 받습니다.get_video_metadata(video_url_or_id)는 YouTube의 인증 없는 oEmbed 엔드포인트를 통해 제목, 채널 이름, 채널 URL, 썸네일을 반환합니다. 업로드 날짜나 전체 설명은 의도적으로 반환하지 않습니다. 그 이유는 공식 Data API 키가 필요하고, 여기서 핵심은 키가 필요 없다는 것이기 때문입니다.search_transcript(video_url_or_id, query, languages=["en"])는 키워드나 문구와 일치하는 세그먼트를 대소문자 구분 없이 찾아내며, 각 세그먼트에 [mm:ss] 타임스탬프가 포함되어 모델이 동영상에서 해당 내용이 언급된 위치를 가리킬 수 있습니다.summarize_chapters(video_url_or_id, gap_seconds=4.0, min_chunk_seconds=45.0, languages=["en"])는 트랜스크립트를 자연스러운 멈춤 지점에서 대략적인 시간 블록 청크로 나누어 반환하므로, 에이전트가 거대한 덩어리를 통째로 삼키는 대신 섹션별로 요약할 수 있습니다. 이는 휴리스틱이며, YouTube의 실제 챕터 데이터가 아닙니다.
모든 도구는 오류를 포함한 일반 문자열을 반환합니다(예: "Error: captions are disabled for this video"). 호출하는 에이전트에게 예외가 표시되지 않으며, 스택 트레이스도 유출되지 않습니다.
Related MCP server: YouTube for AI Agents
의도적으로 하지 않는 일
자막이 비활성화된 동영상, 비공개 또는 이용할 수 없는 동영상, 자막이 없는 라이브 스트림에서는 작동하지 않습니다. 추측하는 대신 그렇게 명시합니다.
YouTube Data API에 의존하지 않습니다. 설계상, 키 없이 업로드 날짜나 전체 설명을 얻을 수 없습니다.
캐시하지 않습니다. 같은 동영상에 대한 두 번의 호출은 매번 다시 가져옵니다. 이 도구의 실제 사용에는 충분합니다. 대량으로 필요해지면 캐싱을 추가하세요.
설정
Python 3.11+ 및 uv가 필요합니다.
uv sync독립 실행으로 시작을 확인합니다:
uv run server.pyMCP stdio 입력을 기다리며 대기하므로, 클라이언트가 연결될 때까지 아무것도 하지 않는 것처럼 보입니다. 정상입니다. Ctrl+C로 종료합니다.
MCP 클라이언트에 등록
클라이언트의 MCP 설정에 추가합니다. 서버는 stdio로 호출되므로 구성은 명령줄입니다. Claude CLI를 예시로 사용하면:
claude mcp add youtube-transcript -- uv --directory /absolute/path/to/youtube-transcript-mcp run server.py또는 JSON 구성에서:
{
"mcpServers": {
"youtube-transcript": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/youtube-transcript-mcp", "run", "server.py"]
}
}
}힘들게 얻은 교훈
자막(자동 생성 또는 수동)이 있는 동영상만 작동합니다. 자막이 없는 동영상은 명확한 오류를 반환하는데, 이는 의도적인 선택입니다. 빈 결과는 조용한 실패처럼 보이지만, 오류는 그 원인을 명확히 합니다.
언어 목록이 중요합니다.
languages=["en"]은 영어 트랙이 존재할 때 영어 트랙을 가져옵니다. 채널이 다른 언어로만 업로드하는 경우 해당 언어 코드를 전달하세요.mcp>=1.28.1을 고정하되 2.0 미만으로 유지하세요. mcp 2.x는mcp.server.fastmcp를 이름을 바꾸었고, 서버 시작 시 import가 조용히 실패합니다. 실제로 로드되는 버전을 사용하세요.
라이선스
MIT. LICENSE를 참조하세요.
Available Tools
4 toolsget_transcriptA
Fetch the full transcript of a YouTube video as plain text.
Args:
video_url_or_id: Full YouTube URL (watch/youtu.be/embed/shorts) or bare 11-char video ID.
languages: Preferred language codes in priority order, e.g. ["en", "en-GB"]. Defaults to ["en"].
include_timestamps: If true, prefix each line with a [mm:ss] timestamp.
| Name | Required | Description | Default |
|---|---|---|---|
| languages | No | ||
| video_url_or_id | Yes | ||
| include_timestamps | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of behavior and does a good job: it explains accepted URL formats, the bare ID alternative, language priority ordering, the default language list, and timestamp formatting. It does not mention edge cases like missing captions or rate limits, but the disclosed behavior covers the core interaction well.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and well-structured: a one-line purpose, followed by a concise Args block. Every sentence earns its place, and parameter docs are front-loaded with the needed specifics.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a three-parameter tool with an output schema, the description provides enough to invoke the tool correctly: required argument, optional language behavior, and timestamp control. It could be strengthened with guidance about when to use sibling tools or what happens when no transcript is available, but it is largely complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, and it does thoroughly. Each parameter is explained with concrete examples, accepted formats, defaults, and behavioral effects, adding substantial meaning beyond the bare schema properties.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The first sentence clearly states the action ('Fetch the full transcript'), the resource ('YouTube video'), and the output form ('as plain text'). The word 'full' differentiates it from sibling tools like search_transcript, which implies partial or query-based retrieval.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied by the purpose: use this tool when you need the complete transcript of a YouTube video. However, there is no explicit guidance about when to prefer search_transcript, get_video_metadata, or summarize_chapters instead, nor exclusions such as 'use search_transcript for snippets'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_video_metadataA
Fetch title, channel name, and thumbnail for a YouTube video via the no-auth oEmbed endpoint.
Note: oEmbed does not expose upload date or full description (those require the official
Data API + an API key). This returns what's available without one.
Args:
video_url_or_id: Full YouTube URL or bare 11-char video ID.
| Name | Required | Description | Default |
|---|---|---|---|
| video_url_or_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations available, the description carries the behavioral disclosure burden. It credibly explains that the tool uses a no-auth endpoint, returns only a limited set of metadata, and does not expose upload date or full description. It could also mention error behavior or invalid inputs, but the core behavioral limitations are transparently disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and front-loaded with the main purpose. The limitation note is valuable context, and the Args section is minimal and directly useful. Every sentence contributes to correct invocation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter metadata retrieval tool with a provided output schema, the description covers purpose, input format, expected returned fields, and key limitations. Nothing essential for selecting or invoking the tool is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides only a bare string type with 0% description coverage, but the description fully compensates by defining accepted values: 'Full YouTube URL or bare 11-char video ID.' This gives the agent exactly what it needs to construct a valid argument.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Fetch') and names the exact resources returned ('title, channel name, and thumbnail'), clearly distinguishing this from the transcript-focused sibling tools. It also names the mechanism ('no-auth oEmbed endpoint'), leaving no ambiguity about what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly implies when to use this tool (when basic YouTube metadata is needed without authentication) and explicitly notes when it is insufficient (when upload date or full description is required, which 'require the official Data API + an API key'). It does not explicitly reference sibling tools, but the field-level exclusions provide solid guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_transcriptA
Search a video's transcript for a keyword/phrase and return matching segments with timestamps.
Args:
video_url_or_id: Full YouTube URL or bare 11-char video ID.
query: Keyword or phrase to search for (case-insensitive substring match).
languages: Preferred language codes in priority order. Defaults to ["en"].
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| languages | No | ||
| video_url_or_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the burden of behavioral disclosure. It does disclose that query matching is case-insensitive and substring-based, and that languages default to ['en']. However, it does not mention what happens when no transcript is available, whether network fetching is involved, or how missing language captions are handled.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description opens with a precise one-sentence purpose and then uses a clean bulleted Args list. There is no redundant or filler text; every sentence earns its place and the most important information is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity, the description covers purpose, return type (matching segments with timestamps), and all parameters. An output schema exists to cover return-value details, but the description does not address edge cases or when to choose this tool over siblings, so it is not fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description fully compensates by explaining all three parameters: video_url_or_id accepts a full URL or bare 11-char ID, query is a case-insensitive substring match, and languages are priority-ordered with a default. This adds significant meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action: search a video's transcript for a keyword/phrase and return matching segments with timestamps. It differentiates itself from sibling tools like get_transcript and get_video_metadata by focusing on search-within-transcript rather than retrieval of the full transcript or metadata.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The purpose implies when to use it (when you need to find specific content in a transcript rather than reading the whole transcript), but it does not explicitly state when to prefer alternatives. No exclusions or alternative routing are provided, so the usage context is only implied.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
summarize_chaptersA
Break a transcript into rough time-blocked chunks at natural pauses, for easier per-section summarizing.
This is a heuristic, not real chapter data: it splits wherever the gap between two consecutive
caption snippets exceeds `gap_seconds`, then merges any resulting chunk shorter than
`min_chunk_seconds` into its neighbor so chunks stay summarizable.
Args:
video_url_or_id: Full YouTube URL or bare 11-char video ID.
gap_seconds: Silence gap (seconds) between captions that triggers a new chunk boundary.
min_chunk_seconds: Minimum chunk duration; shorter chunks get merged forward.
languages: Preferred language codes in priority order. Defaults to ["en"].
| Name | Required | Description | Default |
|---|---|---|---|
| languages | No | ||
| gap_seconds | No | ||
| video_url_or_id | Yes | ||
| min_chunk_seconds | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and does so admirably. It explicitly discloses that this is 'a heuristic, not real chapter data' and explains the exact split/merge algorithm involving gap_seconds and min_chunk_seconds, so the agent knows what behavior to expect.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The definition is front-loaded with a one-sentence summary, followed by a concise explanation of the heuristic behavior and a clean Args section. Every sentence carries necessary information, and there is no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has an output schema, so return values need not be repeated. The description covers the algorithm, parameters, defaults, and limitations, which is everything an agent needs to call it correctly. The only minor nuance is languages defaulting to ['en'] in the prose while the schema shows null, but the behavior is still clear.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description alone documents semantics. It gives meaningful explanations for all four parameters, including units ('seconds'), behavior ('triggers a new chunk boundary', 'merged forward'), and accepted values for video_url_or_id. This fully compensates for the schema's lack of descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Break a transcript into rough time-blocked chunks at natural pauses', which clearly defines the tool's output and purpose. It further distinguishes itself from real chapter data and from the sibling retrieval/search tools by stating it is a heuristic chunking operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The phrase 'for easier per-section summarizing' gives a clear context and intended use. It does not explicitly name alternatives (get_transcript, search_transcript) or state when not to use it, so it stops short of a 5, but it is not ambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
get_transcript - First observed
get_video_metadata - First observed
search_transcript - First observed
summarize_chapters
TDQS
Scored across 4 tools
Each tool targets a distinct operation: fetching raw transcript text, fetching metadata, searching within a transcript, and chunking into chapters. Even though three tools operate on transcripts, their purposes are clearly separated and descriptions make the boundaries obvious.
All tool names follow a consistent verb_noun snake_case pattern: get_transcript, get_video_metadata, search_transcript, summarize_chapters. The verbs clearly indicate the action, and the nouns indicate the resource or output.
With 4 tools, the server is well-scoped for a focused YouTube transcript utility. Each tool covers a meaningful, non-redundant capability without unnecessary bloat.
The set covers the core transcript workflows: fetching, searching, chunking, and basic metadata retrieval. A minor gap is the lack of a tool to list available transcript languages or caption tracks, which could help when the default language is unavailable.
Maintenance
Related MCP Connectors
YouTube transcripts, search, channel/playlist listings and upload tracking for AI agents.
YouTube transcripts, video search, chapters and extractive summaries. No YouTube API key, no LLM.
YouTube transcripts, search, channels, playlists and bulk transcript jobs for AI agents. 14 tools.
Transcripts, summaries, chapters and timestamped answers for video links, for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to fetch transcripts, metadata, and download videos/audio from YouTube without API keys.33MIT
- AlicenseAqualityDmaintenanceEnables AI agents to search, watch, summarize, clip, and extract transcripts from YouTube videos, all without needing an API key or leaving the chat.99 npm54Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables LLMs to interact with YouTube videos by fetching transcripts, summarizing content, and answering questions based on video context.-
- AlicenseAqualityDmaintenanceEnables AI assistants to search YouTube, fetch transcripts, and get AI summaries of videos without API keys.367 npmMIT