A small MCP server for fetching YouTube video transcripts, wrapping youtube-transcript-api
Project description
youtube-context-mcp
A small MCP server that lets agents read YouTube video transcripts so you can ask questions about a video, summarize it, or pull quotes.
It's a thin wrapper around youtube-transcript-api,
which does all the actual fetching. This project just exposes it as two MCP tools.
It returns a video's existing captions/subtitles — it does not transcribe audio (no Whisper/ASR). Videos without captions have nothing to return.
Install
Run it on demand with uv (no install needed):
uvx youtube-context-mcp
Or install it:
pip install youtube-context-mcp
Use it with an agent
Add it to your MCP client config:
{
"mcpServers": {
"youtube-context": {
"command": "uvx",
"args": ["youtube-context-mcp"]
}
}
}
Or, in Claude Code:
claude mcp add youtube-context -- uvx youtube-context-mcp
Running over HTTP
By default the server talks stdio (the client launches it). If your client runs on a different host — for example LM Studio on Windows while this server runs in WSL2 — run it as a long-lived HTTP server instead and point the client at a URL:
youtube-context-mcp --transport http --host 0.0.0.0 --port 8000
Then add it by URL:
{
"mcpServers": {
"youtube-context": { "url": "http://localhost:8000/mcp" }
}
}
(--host 0.0.0.0 makes it reachable from the Windows side; WSL2 forwards localhost.)
Tools
| Tool | What it does |
|---|---|
get_transcript(video, languages=["en"], include_timestamps=False, translate_to=None) |
Returns the transcript as text. video is a URL or 11-char ID. Set include_timestamps for [mm:ss] / [h:mm:ss] lines; translate_to for an ISO language code. |
list_transcripts(video) |
Lists available transcripts (language, code, manual vs auto-generated, translatable) plus the translation targets. Use it when get_transcript can't find your language. |
Proxies (optional)
YouTube blocks most datacenter/cloud IPs, so on a server you may hit RequestBlocked /
IpBlocked. Locally this is rarely needed. To route requests through a proxy, set env vars:
| Env var | Purpose |
|---|---|
WEBSHARE_PROXY_USERNAME, WEBSHARE_PROXY_PASSWORD |
Use Webshare rotating residential proxies. |
WEBSHARE_PROXY_LOCATIONS |
Optional CSV of country codes, e.g. us,de. |
YT_TRANSCRIPT_HTTP_PROXY, YT_TRANSCRIPT_HTTPS_PROXY |
Use a generic HTTP/HTTPS proxy instead. |
YT_TRANSCRIPT_TIMEOUT |
Per-request timeout in seconds (default 20). |
With no env set, requests go out directly.
Troubleshooting
RequestBlocked/IpBlocked— YouTube blocked the IP. Set the proxy env vars above.- No transcript found — call
list_transcriptsto see which languages exist for that video. - Transcripts disabled — the uploader turned captions off; nothing can be fetched.
Development
uv sync
uv run ruff check . && uv run ruff format --check .
uv run pytest
uv run mcp dev src/youtube_context_mcp/server.py --with-editable . # interactive inspector
License
MIT
Credits
All transcript fetching is done by youtube-transcript-api
by Jonas Depoix. This project is just an MCP adapter on top of it.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file youtube_context_mcp-0.2.0.tar.gz.
File metadata
- Download URL: youtube_context_mcp-0.2.0.tar.gz
- Upload date:
- Size: 58.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d04b79f4127bffe98489d830b325a7b0cbe901d9ae60deede26fe2781595b4ab
|
|
| MD5 |
0ae0de477b24b9234fffb4badd688466
|
|
| BLAKE2b-256 |
8034db65a488ee16f122a17ef503fac5fd8164c33ede485bca2550c4fde5da30
|
Provenance
The following attestation bundles were made for youtube_context_mcp-0.2.0.tar.gz:
Publisher:
publish.yml on realiti4/youtube-context-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
youtube_context_mcp-0.2.0.tar.gz -
Subject digest:
d04b79f4127bffe98489d830b325a7b0cbe901d9ae60deede26fe2781595b4ab - Sigstore transparency entry: 1755657591
- Sigstore integration time:
-
Permalink:
realiti4/youtube-context-mcp@8568718e5c62b989c6095937251a402a0a15bbc3 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/realiti4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8568718e5c62b989c6095937251a402a0a15bbc3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file youtube_context_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: youtube_context_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2624a40160343604a7b461ce1fd0b4ec11e9d48a177c2d2366d0c40afe5eaf71
|
|
| MD5 |
7c84bd6b2dd6719f6448849f2e73b59e
|
|
| BLAKE2b-256 |
f1c22fd8826c5f3ced9c13a258b60472db7f872ba6488b2a10c75a6a32c42d03
|
Provenance
The following attestation bundles were made for youtube_context_mcp-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on realiti4/youtube-context-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
youtube_context_mcp-0.2.0-py3-none-any.whl -
Subject digest:
2624a40160343604a7b461ce1fd0b4ec11e9d48a177c2d2366d0c40afe5eaf71 - Sigstore transparency entry: 1755657605
- Sigstore integration time:
-
Permalink:
realiti4/youtube-context-mcp@8568718e5c62b989c6095937251a402a0a15bbc3 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/realiti4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8568718e5c62b989c6095937251a402a0a15bbc3 -
Trigger Event:
release
-
Statement type: