Python MIT License Open Source Project

YouTube MCP Server in Python: Read-Only Transcripts with Citations (Free Code)

YouTube MCP server tutorial: build a read-only Python MCP server for transcripts and video metadata with timestamped citations. Free code and 135 tests.

Project Specifications & Technical Summary

Difficulty Beginner
License MIT License

A YouTube MCP server lets an AI assistant read a lecture’s transcript and answer your questions with proof: a quote, a timestamp and a link that jumps to the exact moment in the video. In this tutorial you will build one in Python with the official MCP SDK. It is strictly read-only, it asks the student for permission before it fetches anything, and every answer it returns carries a citation you can check in two clicks.

This is a beginner-to-intermediate final-year or mini project for BTech, MCA and MTech students, and a handy tool for study groups and campus demos. You will learn the Model Context Protocol, MCP Elicitation, caption formats, safe URL parsing and offline testing. The complete code is free on GitHub under the MIT License, with sample lectures, a scripted demo and 135 pytest tests that never touch the network.

What You Will Build: A Read-Only YouTube MCP Server

The project is called youtube-transcript-mcp. Any MCP client, such as Claude, Antigravity, VS Code or your own Python script, can connect to it over stdio and use six tools:

ToolWhat it returnsAsks permission?
video_infoTitle, channel, publish date, duration, link and an APA-style referenceYes
get_transcriptTranscript segments, each with a timestamp and a jump link, with paging for long lecturesYes
search_transcriptThe best-matching moments for a topic, each with a quote and a ready markdown citationYes
study_outlineTime sections with keywords and a link each, for quick revisionYes
cite_momentA citation for a given second, without fetching anythingNo
server_statusSource, permission policy, recent decisions and a terms reminderNo

There is also a prompt template, study_notes, that tells the model to add a citation after every point and not to invent anything that is not in the transcript. So when you ask “Where does the lecture explain transitive dependency?”, the answer looks like this: “Third normal form, 3NF, removes transitive dependency.” — Normalization in DBMS [2:45], and the timestamp links to …watch?v=…&t=165s.

YouTube MCP server architecture: MCP client, read-only Python server with permission resolver and citations, local caption files and the official YouTube Data API
How the pieces fit: six read-only tools, a permission resolver in front of every fetch, and two caption sources you have rights to.

Why a YouTube MCP Server Is a Good Project Right Now

The Model Context Protocol turned two in November 2026. In Two Years of MCP Builders (24 November 2026), the MCP maintainers describe the second year as “the year of the MCP builder” and report that the SDKs have crossed 5 billion total downloads. The protocol now has a stateless core (the 2026-07-28 revision), official extensions such as MCP Apps, and more than 2,500 contributors.

The same day Anthropic published MCP servers can now ship skills, run tasks, and more with Claude. It announced Skills over MCP in public beta and made Tasks and Elicitation generally available in Claude and Claude Code. Elicitation lets a server “pause to ask the user for input through a form or link, then continue where it left off”. The post also notes over 700 million monthly SDK downloads and more than 10,000 MCP connectors for Claude. The New Stack’s coverage adds that these features are meant to help agents work for longer stretches on their own.

For students, this means two things. First, MCP is no longer a niche experiment, so an MCP project is a strong line on your CV. Second, Elicitation is now supported by major clients, so you can build permission prompts that real users will actually see. A YouTube MCP server is a friendly way to practise both, because almost every student already learns from recorded lectures.

Respect YouTube’s Rules: Read-Only by Design

Before writing any code, decide what the server must never do. This project follows the YouTube Terms of Service and the YouTube API Services Terms of Service with a few simple rules:

  • Read-only. All six tools carry the MCP readOnlyHint annotation. Nothing is posted, liked, commented or uploaded.
  • No video or audio downloads, no page scraping. The server only reads caption text.
  • Only sources you have rights to. Either caption files you already own or were given (for example exported from your own channel in YouTube Studio, a lecture your teacher shared, or Creative Commons content with attribution), or the official YouTube Data API.
  • Official API limits are respected. captions.download only works for videos you own or have permission to edit, needs OAuth, and costs 200 quota units per call. The server explains this clearly when YouTube returns 403.
  • The user decides. Each fetch asks the student to tick allow and to confirm I have the right to use these captions.

These rules also make your project easier to defend in a viva. You can say exactly what data it touches and why it is allowed to.

Features, Tech Stack and Prerequisites

ItemDetails
LanguagePython 3.11 or newer
MCP libraryOfficial MCP Python SDK, mcp>=2.3,<3 (MCPServer, Resolve, Elicit, Client)
Protocol versions2025-11-25 (standalone elicitation/create) and 2026-07-28 (InputRequiredResult round trip), both tested
Caption formatsWebVTT (.vtt), SubRip (.srt) and JSON segments, with roll-up duplicate removal
SourcesLocal caption folder (offline) or YouTube Data API v3: videos.list, captions.list, captions.download
Extra dependenciesNone. HTTP uses the standard library, and the HTTP function is injected so tests can mock it
Testspytest + pytest-asyncio, 135 offline tests, sockets blocked, plus a real stdio end-to-end run
OSWindows, macOS or Linux; no API key needed for the demo

This YouTube MCP server needs no paid services, so it runs on any college lab computer. You should know basic Python, functions and dictionaries, and have a rough idea of what an MCP server is. If MCP is new to you, read our guide to building an MCP server in Python first.

Project File Structure

The YouTube MCP server is a small Python package with one module per job, so each part is easy to read, test and explain in your report:

YouTube-Transcript-MCP-Server-Python/
├── yt_transcript_mcp/
│   ├── server.py      # MCP server: 6 read-only tools, permission resolver, prompt
│   ├── consent.py     # FetchPermission form + ConsentPolicy (always / network / never)
│   ├── sources.py     # LocalSource + YouTubeAPISource (official API, GET only)
│   ├── captions.py    # WebVTT / SubRip / JSON parsing, time helpers
│   ├── citations.py   # VideoMeta, timestamp citations, APA-style reference
│   ├── search.py      # keyword search with context, study outline
│   ├── video_ids.py   # URL or ID -> 11-character video ID, watch links
│   └── cli.py         # serve | demo | cite | parse
├── samples/           # two offline sample lectures (DBMS, OS)
├── examples/          # MCP client config, sample study session
├── tests/             # 135 pytest tests, network blocked
├── docs/screenshots/
├── .github/workflows/tests.yml
├── pyproject.toml
└── README.md

How the YouTube MCP Server Works

Follow one call from start to finish. The client calls search_transcript with a video link and the words “transitive dependency”:

  • Validate: the server turns the link into an 11-character video ID. Playlists, channels and other websites are rejected before anything else happens.
  • Ask: a resolver checks the consent policy. If this video has not been approved yet, it returns an Elicit request and the client shows the student a small form.
  • Decide: if the student declines, cancels, leaves allow unticked or does not confirm rights, the tool returns NOT FETCHED. No file is read and no HTTP request is made.
  • Fetch once: after approval the server reads metadata and captions from the source and caches them for the session.
  • Cite: every hit comes back with a label such as 2:45–2:59, a deep link with &t=165s, a quote and a markdown citation.
YouTube MCP server permission flow: tools/call, MCP Elicitation form with allow and rights checkboxes, caption read and cited results
One search from start to finish. If the student declines, cancels or does not confirm rights, the tool returns NOT FETCHED and nothing is read.

Students paste links in many shapes: watch?v=, youtu.be, Shorts, embeds and live links. The parser accepts these, checks the host against an allow-list and the ID against a strict pattern. Anything else raises InvalidVideo, so a YouTube MCP server never fetches something the user did not mean, such as youtube.com.evil.example.

def parse_video_id(text: str) -> str:
    """Accept a bare ID, a watch URL, a youtu.be link, a Shorts/embed/live URL.

    Anything else (playlists, channels, other websites) is rejected, so the
    server never fetches something the user did not mean.
    """
    s = (text or "").strip()
    if ID_RE.match(s):
        return s
    if not re.match(r"^https?://", s, re.I):
        s = "https://" + s
    u = urlparse(s)
    if u.scheme.lower() not in {"http", "https"}:
        raise InvalidVideo(f"not a YouTube link: {text!r}")
    host = (u.hostname or "").lower()
    cand = None
    if host in SHORT_HOSTS:
        cand = u.path.strip("/").split("/")[0]
    elif host in YOUTUBE_HOSTS:
        if u.path == "/watch":
            cand = (parse_qs(u.query).get("v") or [None])[0]
        else:
            for pre in PATH_PREFIXES:
                if u.path.startswith(pre):
                    cand = u.path[len(pre):].split("/")[0]
                    break
    if cand and ID_RE.match(cand):
        return cand
    raise InvalidVideo(f"not a YouTube video URL or 11-character video ID: {text!r}")

Step 2: Turn Captions into Timestamped Segments

Caption files are simple text, but they have quirks. WebVTT files start with WEBVTT and may contain notes, styling tags such as <c> and HTML entities. Auto-generated captions often repeat the previous line as the text “rolls up”. The parser cleans all of this into a list of Segment(start, end, text):

def parse_vtt(text: str) -> list[Segment]:
    blocks = _blocks(text)
    if not blocks or not blocks[0][0].startswith("WEBVTT"):
        raise CaptionError("WebVTT files must start with 'WEBVTT'")
    segs = [c for b in blocks[1:] if not b[0].startswith(("NOTE", "STYLE", "REGION")) and (c := _cue(b))]
    return merge_rolling(segs)
def merge_rolling(segs: list[Segment]) -> list[Segment]:
    """Auto-captions often repeat the previous line ('roll-up'). Drop exact repeats and sort by time."""
    out: list[Segment] = []
    for s in sorted(segs, key=lambda x: x.start):
        if out and s.text == out[-1].text:
            out[-1] = Segment(out[-1].start, max(out[-1].end, s.end), s.text)
        elif out and s.text.startswith(out[-1].text + " ") and s.start <= out[-1].end:
            out[-1] = Segment(out[-1].start, max(out[-1].end, s.end), s.text)
        else:
            out.append(s)
    return out

The same module converts YouTube’s ISO 8601 durations (PT12M30S becomes 750 seconds) and formats times the way YouTube shows them (2:05, 1:02:05).

Step 3: Build Citations Students Can Trust

Citations are the heart of this YouTube MCP server. An AI summary of a lecture is only useful if you can check it. Every quote the server returns includes the timestamp, a link that starts the video at that second, and a markdown line you can paste into notes. video_info also returns an APA-style reference for your report’s bibliography.

def cite(meta: VideoMeta, start: float, text: str = "", end: float | None = None) -> dict:
    """One citation: label, deep link, markdown and a short quote."""
    label = fmt_ts(start) + (f"–{fmt_ts(end)}" if end is not None and int(end) > int(start) else "")
    url = watch_url(meta.video_id, start)
    md = f"[{label}]({url})"
    out = {"timestamp": fmt_ts(start), "seconds": int(start), "label": label, "url": url, "markdown": md}
    if text:
        out["quote"] = text
        out["markdown"] = f"“{text}” — {meta.title} {md}"
    return out
def reference(meta: VideoMeta, accessed: date | None = None) -> str:
    """APA-style reference line students can paste into a report bibliography."""
    year = meta.published[:4] if meta.published else "n.d."
    acc = (accessed or date.today()).isoformat()
    who = meta.channel or "Unknown channel"
    return f"{who}. ({year}). {meta.title} [Video]. YouTube. {watch_url(meta.video_id)} (accessed {acc})"

Step 4: Ask Permission with MCP Elicitation

Now the permission prompt, the feature that makes this YouTube MCP server safe to demo on campus. The form is a small Pydantic model with three checkboxes. Elicitation forms may only use simple fields, as the MCP Elicitation specification explains, so booleans are perfect:

class FetchPermission(BaseModel):
    """The form the user sees before a fetch."""

    allow: bool = Field(default=False, description="Allow this one read-only fetch")
    rights_ok: bool = Field(default=False, description="I own this video, or I have the right to use its captions for study")
    remember: bool = Field(default=False, description="Do not ask again for this video until the server restarts")


@dataclass
class ConsentPolicy:
    """``always``: ask before every new video; ``network``: ask only when the source uses the internet; ``never``: no prompts."""

    ask: AskWhen = "always"
    granted: set[str] = field(default_factory=set)
    log: list[dict] = field(default_factory=list)

    def needs_prompt(self, video_id: str, needs_network: bool) -> bool:
        if video_id in self.granted or self.ask == "never":
            return False
        return self.ask == "always" or needs_network

    def record(self, video_id: str, tool: str, outcome: str) -> None:
        self.log.append({"video_id": video_id, "tool": tool, "outcome": outcome})

In the server, each fetch tool has a parameter filled by a resolver instead of by the model. The resolver validates the video ID, checks the policy and returns either None (no question needed) or Elicit(message, FetchPermission). The SDK then sends the form using whatever the connection supports: a standalone elicitation/create request on protocol 2025-11-25, or an InputRequiredResult round trip on 2026-07-28. Your code is the same for both, which keeps the YouTube MCP server simple.

def asker(tool: str):
    def ask(video: str) -> Elicit[FetchPermission] | None:
        vid = _vid(video)
        if not lib.consent.needs_prompt(vid, source.needs_network):
            return None
        return Elicit(prompt_message(vid, tool, source.name, source.needs_network), FetchPermission)
    return ask

def check(vid: str, tool: str, ok: Perm | None) -> dict[str, Any] | None:
    """None means go ahead; a dict is the 'not fetched' answer."""
    if not lib.consent.needs_prompt(vid, source.needs_network):
        # The resolver did not ask (policy 'never'/'network', or remembered), so the SDK passed no form.
        lib.consent.record(vid, tool, "remembered" if vid in lib.consent.granted else "allowed")
        return None
    if not isinstance(ok, AcceptedElicitation):
        outcome = "declined" if getattr(ok, "action", "") == "decline" else "cancelled"
        lib.consent.record(vid, tool, outcome)
        return _not_fetched(vid, outcome, f"the user {outcome} the permission prompt")
    form = ok.data
    if form is None or not form.allow:
        lib.consent.record(vid, tool, "denied")
        return _not_fetched(vid, "denied", "'allow' was not ticked")
    if not form.rights_ok:
        lib.consent.record(vid, tool, "no_rights")
        return _not_fetched(vid, "no_rights", "the user did not confirm rights to use these captions")
    if form.remember:
        lib.consent.granted.add(vid)
    lib.consent.record(vid, tool, "approved")
    return None

Notice the order: the tool body checks the answer before it calls the source. A declined prompt therefore costs nothing: no file read, no API quota and no network traffic. Ticking remember stores the approval for that video only, so the next question about the same lecture is instant.

Step 5: Register the Read-Only Tools

Each tool is a normal Python function with type hints. The SDK builds the JSON schema from the signature and hides the permission parameter from the model because it is filled by the resolver. The annotations tell clients the tools are read-only, as described in the MCP tools specification:

@mcp.tool(annotations=ann)
def search_transcript(video: str, query: str, permission: Annotated[Perm, Resolve(asker("search_transcript"))],
                      max_results: int = 5, language: str = "en") -> dict[str, Any]:
    """Find where a topic is explained in the video. Every hit has a timestamp, a jump link and a ready citation."""
    vid = _vid(video)
    if not query.strip():
        raise ToolError("query must not be empty")
    if (stop := check(vid, "search_transcript", permission)):
        return stop
    meta = load(lib.get_meta, vid)
    hits = search(load(lib.get_segments, vid, language), query, max(1, min(max_results, 20)))
    return {"fetched": True, "video_id": vid, "title": meta.title, "query": query,
            "hits": [{"score": h["score"], "context": h["context"], **cite(meta, h["segment"].start, h["segment"].text, h["segment"].end)}
                     for h in hits],
            "reference": reference(meta)}

The search itself is plain Python, with no AI model needed. It scores segments by matched words, gives a bonus for the exact phrase, and returns the neighbouring lines as context. study_outline splits the lecture into fixed time sections and lists each section’s most frequent words, which is great for a quick revision sheet.

Step 6: Connect a Source: Local Files or the Official API

LocalSource reads <videoId>.vtt, .srt or .json files from a folder, with an optional <videoId>.meta.json for the title and channel. It refuses paths that escape the folder. This is the default, and it works fully offline.

YouTubeAPISource uses the official YouTube Data API v3. videos.list returns public metadata with an API key. captions.list and captions.download need an OAuth token and work for your own videos, which is ideal if your department or club runs a channel. Human captions are preferred over automatic ones:

def tracks(self, video_id: str) -> list[dict]:
    d = json.loads(self._get("captions", {"part": "snippet", "videoId": video_id}, oauth=True))
    return [{"id": t["id"], **t.get("snippet", {})} for t in d.get("items", [])]

def transcript(self, video_id: str, language: str = "en") -> list[Segment]:
    tracks = [t for t in self.tracks(video_id) if t.get("status", "serving") == "serving"]
    if not tracks:
        raise SourceError(f"no caption tracks available for {video_id}")
    lang = [t for t in tracks if (t.get("language") or "").split("-")[0] == language.split("-")[0]] or tracks
    lang.sort(key=lambda t: (t.get("trackKind") == "asr", t.get("isDraft", False)))  # human captions first
    body = self._get(f"captions/{urllib.parse.quote(lang[0]['id'], safe='')}", {"tfmt": "vtt"}, oauth=True)
    try:
        return parse_captions(body.decode("utf-8", "replace"), "vtt")
    except CaptionError as exc:
        raise SourceError(f"caption track could not be parsed: {exc}") from exc

Every request goes through one _get method that only allows www.googleapis.com, only sends GET, and turns 403, 404 and 5xx errors into clear messages. The HTTP function is passed in, which is what makes the offline tests possible.

Installation, Running the Demo and Connecting a Client

git clone https://github.com/GetProjectsIdea/YouTube-Transcript-MCP-Server-Python.git
cd YouTube-Transcript-MCP-Server-Python
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -e ".[dev]"

youtube-transcript-mcp demo      # scripted session with a simulated student
python -m pytest -q              # 135 passed

The demo uses two sample lectures in samples/, one on DBMS normalization and one on OS deadlock. They were written for the project, so you can share and change them freely; their video IDs are made up, so the links do not open real videos. In the demo, the student approves the first lecture with remember ticked, declines the second, then approves without confirming rights:

YouTube MCP server demo in the terminal: permission prompts, timestamped citations, study outline and blocked fetches
The scripted offline demo: a simulated student approves one video, declines another, and every answer carries a timestamp link.

To use the YouTube MCP server from a real client, add it to the client’s MCP configuration. Point --captions at your own folder of caption files:

{
  "mcpServers": {
    "youtube-study": {
      "command": "youtube-transcript-mcp",
      "args": ["serve", "--source", "local", "--captions", "/path/to/your/captions", "--ask", "always"]
    }
  }
}

For the official API, use serve --source youtube and set YOUTUBE_API_KEY and, for captions of your own videos, YOUTUBE_OAUTH_TOKEN as environment variables. Never put keys in the repo. The --ask option controls prompts: always (default), network (only when the internet is used) or never (local testing only).

Then try prompts like these: “Find where the lecture explains BCNF and give me the timestamps”, “Make a two-minute outline of this lecture for revision”, or “Write five viva questions from the deadlock lecture and cite where each answer is explained.”

Testing the YouTube MCP Server Offline with pytest

Tests that call real APIs are slow, need keys and break when quotas run out. Here every test runs offline. An autouse fixture blocks internet sockets, so any accidental network call fails loudly, and a FakeHttp class stands in for the YouTube Data API:

@pytest.fixture(autouse=True)
def no_network(monkeypatch):
    """Fail loudly if anything tries to open an internet connection."""
    real_connect = socket.socket.connect

    def guarded(self, address):
        if self.family in (socket.AF_INET, socket.AF_INET6):
            raise RuntimeError(f"network access attempted in tests: {address!r}")
        return real_connect(self, address)

    monkeypatch.setattr(socket.socket, "connect", guarded)
    monkeypatch.setattr(socket, "create_connection", lambda *a, **k: (_ for _ in ()).throw(RuntimeError("network access attempted in tests")))
    monkeypatch.delenv("YOUTUBE_API_KEY", raising=False)
    monkeypatch.delenv("YOUTUBE_OAUTH_TOKEN", raising=False)

A FormUser plays the student and answers each permission form, and a mode fixture runs the server tests on both MCP protocol versions. Here is what the YouTube MCP server test suite covers:

Test fileWhat it checks
test_video_ids.py25 accepted and rejected link shapes, including look-alike hosts
test_captions.pyVTT, SRT and JSON parsing, tags, entities, roll-up lines, durations, time windows
test_citations_search.pyCitation labels and links, APA reference, search ranking, outlines
test_sources.pyLocal files, path escape, mocked API calls, OAuth vs key, 403 handling, host allow-list
test_server.pyEvery fetch tool asks first; decline, cancel, no allow and no rights all mean no fetch; remember; policies; caching
test_cli.pyDemo, cite and parse commands, missing keys, and a real stdio end-to-end session
135 pytest tests passing for the YouTube MCP server, offline with the network blocked, on both MCP protocol versions
135 offline tests pass. Sockets are blocked, the YouTube Data API is mocked, and permission prompts are tested on both protocol versions.

YouTube MCP Server Security Notes and Limitations

  • Read-only is enforced in code, not just in the docs: the API client has no method that writes, and only GET requests to one host are possible.
  • Transcripts are untrusted text. A caption line could contain instructions aimed at the AI. The server returns captions as data with citations, and the study_notes prompt tells the model to report what the lecture says, not to follow it.
  • The form must reach a person. A client that auto-accepts elicitation forms defeats the purpose; use clients that show them to the user.
  • Approvals live in memory. Remember lasts until the server restarts, which is a safe default for shared lab computers.
  • Keyword search is simple. It does not understand synonyms; see the future scope for embeddings.
  • Keep secrets in environment variables and give OAuth tokens the smallest scope YouTube allows.

Troubleshooting the YouTube MCP Server

  • “not a YouTube video URL or 11-character video ID”: you passed a playlist, channel or another site. Copy the link of a single video.
  • “no caption file for video …”: name the file <videoId>.en.vtt, <videoId>.srt or <videoId>.json inside your captions folder.
  • 403 from YouTube: caption downloads only work for videos you own or can edit. Use a caption file you have rights to instead.
  • Every call says NOT FETCHED: tick both allow and I have the right to use these captions in the form.
  • The client never shows a form: it may not support elicitation. Update the client, or test locally with --ask never.
  • Exit code 2 with --source youtube: set YOUTUBE_API_KEY and/or YOUTUBE_OAUTH_TOKEN first.

Learning Outcomes and Viva Questions

After building this YouTube MCP server you can explain MCP tools, annotations, prompts and Elicitation, parse real caption formats, design safe input validation, and write fast offline tests for code that normally needs the internet. Be ready for questions like these:

  • Why does the server ask for permission before the fetch and not after?
  • What is the difference between readOnlyHint and actually being read-only?
  • How does the resolver pattern work on both MCP protocol versions?
  • Why are look-alike hosts such as youtube.com.evil.example rejected?
  • Why does captions.download return 403 for most public videos?
  • How do the tests prove that no network call happens?

Future Scope and Ideas to Extend

Once the basic YouTube MCP server works, pick one of these extensions to make your project stand out:

  • Semantic search: add local embeddings so “normal forms” also finds “1NF, 2NF and 3NF”.
  • Multi-video search: search a whole course folder and rank lectures.
  • Quiz generator: a prompt that writes MCQs with a citation for every answer.
  • Visual study panel: show the outline as an interactive view with MCP Apps.
  • Skills over MCP: ship a study-notes playbook alongside the tools, like the pack in our Claude Code skills project.
  • Per-user approvals: combine with the ideas in our MCP server authorization gateway to log every approval.

FAQ

What is a YouTube MCP server?

A YouTube MCP server is a Model Context Protocol server that gives AI assistants tools to read YouTube data, such as video details and transcripts. This project is a read-only version for studying: it returns transcript text with timestamps and links, so every answer can be checked against the video.

Is it allowed to use YouTube transcripts this way?

Use only captions you have the right to use: your own videos, lectures shared with you by the owner, or Creative Commons content with attribution, and follow the YouTube Terms of Service and API Services Terms. The project never downloads video or audio and does not scrape YouTube pages. For the official API, caption downloads only work for videos you own or can edit.

Do I need a YouTube API key?

No. The default source reads caption files from a folder and works offline, including the demo and all tests. An API key is only needed for public metadata through videos.list, and an OAuth token for captions of your own videos.

What is MCP Elicitation and why use it here?

Elicitation lets an MCP server pause a tool call and ask the user for input through a form, then continue. Anthropic made it generally available in Claude and Claude Code on 24 November 2026. Here it is used to ask the student for permission, and confirmation of rights, before any transcript is read.

Which MCP clients can use this server?

Any MCP client that can start a stdio server, such as Claude Desktop, Claude Code, Antigravity, VS Code or your own Python client. For the permission prompt, the client must support form elicitation.

Can I submit this as my final-year project?

Yes. The code is MIT licensed. Add one feature from the future scope list, explain the permission flow and the citation format in your report, and run the 135 tests during your demo. The source is on GitHub.

Download the Source Code

The complete project (server, permission prompts, caption parsers, citation builder, local and API sources, sample lectures, 135 tests, CI and screenshots) is on GitHub: GetProjectsIdea/YouTube-Transcript-MCP-Server-Python. It is released under the MIT License, so you can use this YouTube MCP server as a starter for coursework, college projects and your own study tools.

References

Conclusion

You have built a complete, read-only YouTube MCP server in Python: it parses links safely, turns captions into timestamped segments, asks the student for permission with MCP Elicitation, and answers with citations that link to the exact second of the lecture. Clone the repository, run youtube-transcript-mcp demo, add your own caption files, and turn it into a strong final-year project. Happy coding!

Team Get Projects

Contributor & Author
View All Projects →

Contributor at GetProjects.org, sharing open-source codebases, tutorials, and practical software architectures.

0 Discussion Comments

Markdown Supported

Join the Discussion & Code Review

Share architectural feedback, benchmark results, or troubleshooting notes.