Skip to main content
Glama

TubeKiroku

A self-hosted MCP server for YouTube transcripts. Connect it to Claude, ChatGPT or any other Model Context Protocol client, then ask for a video's transcript, read it page by page, and cite the exact moment behind an answer.

Kiroku (記録) is Japanese for "record".

You:       What command does this tutorial use to deploy? https://youtu.be/...
Assistant: (calls get_transcript) At 12:34 the presenter runs `docker stack deploy ...`
           ▶ https://www.youtube.com/watch?v=...&t=754s

Why

Pasting a YouTube link into an assistant identifies the video, but the assistant still needs the spoken words to answer questions about what was actually said. TubeKiroku fetches the captions, keeps them in a local library, and returns them with timestamps so every claim can be checked.

  • Full text, not a summary. Transcripts are returned verbatim, in pages, with an explicit continuation cursor. Summarizing is the assistant's job, and it can tell when it has not read everything.

  • Citations that hold. Every segment has a jump link. Transcript versions are immutable, so a citation still points to the same words after the captions change.

  • Honest failures. No captions, wrong language, blocked network: each is a distinct error code. An empty or failed fetch is never presented as a complete transcript.

  • Runs on your machine. Transcripts are fetched from your own connection and stored in a local SQLite file. No account, no hosted service, no telemetry.

Related MCP server: Capslane YouTube transcript MCP server

Status

Early development. Working today: single videos and channel imports. In progress:

  • Single videos: metadata, caption languages, paginated transcripts, timed passages

  • Channel imports as resumable background jobs

  • Full-text search across your library with timestamped results

  • Export (TXT / Markdown / ZIP), file import (SRT / VTT / TXT), deletion

  • Docker image with HTTP transport, local setup page, and a tunnel profile for ChatGPT

  • PyPI release and MCP Registry listing

Install

Requires uv. TubeKiroku is not on PyPI yet, so run it from GitHub.

Claude Code

claude mcp add tubekiroku -- uvx --from git+https://github.com/chethankailash/tubekiroku tubekiroku

Claude Desktop, Cursor, VS Code and other stdio clients: add to the client's MCP config (for Claude Desktop, claude_desktop_config.json):

{
  "mcpServers": {
    "tubekiroku": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/chethankailash/tubekiroku", "tubekiroku"]
    }
  }
}

Streamable HTTP (for clients that connect by URL):

uvx --from git+https://github.com/chethankailash/tubekiroku tubekiroku --transport http --port 8000
# MCP endpoint: http://127.0.0.1:8000/mcp

ChatGPT and claude.ai on the web reach MCP servers from their own cloud, so they cannot see localhost. A Docker setup with a protected tunnel is planned for them.

Tools

Tool

What it does

get_video_info

Resolve any YouTube link to its ID, title, channel and saved transcript versions.

list_languages

List caption tracks: language, origin (creator or automatic), saved or not.

get_transcript

The full transcript, one page at a time, as timestamped paragraphs or timed segments with jump links.

get_transcript_segment

The passage around a moment, with surrounding context, to verify a quote before citing it.

get_channel_info

Resolve a channel URL, @handle or ID: title, estimated uploads, how much is saved.

list_channel_videos

A channel's uploads, newest first (Shorts and past streams included), paged.

import_channel

Save transcripts for the latest N or all uploads as a background job. Previews first; starts only with confirm=true.

refresh_channel

Re-run a channel's last import to pick up new uploads; saved transcripts are reused.

get_job_status

Phase, totals per outcome (ready, absent, unavailable, retry, failed), per-video results and next steps.

list_jobs / cancel_job / retry_job

Follow, stop and resume imports.

list_saved_channels

Channels in your library with their saved transcript counts.

server_info

Version, health and library location.

Errors are returned as JSON with a stable code (invalid_input, no_captions, language_unavailable, video_unavailable, empty_track, blocked, network_error, upstream_error, cursor_invalid) and a retryable flag.

Channel imports

An import is saved in the library before any work starts, so it survives a closed chat or a restart: with stdio clients the server stops when the client closes, and the job picks up where it left off the next time the server starts. Each video ends in one of these states:

  • ready: transcript saved (or an existing saved transcript reused)

  • absent: YouTube confirmed there are no usable captions

  • unavailable: private, removed or otherwise unplayable

  • failed: a temporary error persisted after 3 attempts with backoff (retry_job tries again)

If YouTube starts rate-limiting your network, the whole job pauses with growing backoff instead of burning through attempts, and stops after repeated blocks so you can resume it later. Fetches are spaced out (TUBEKIROKU_FETCH_DELAY) to keep the load on YouTube light.

Configuration

Variable

Default

Purpose

TUBEKIROKU_DATA_DIR

~/.local/share/tubekiroku

Where the SQLite library lives.

TUBEKIROKU_PROXY_URL

unset

HTTP(S) proxy for YouTube requests, if your network is blocked.

TUBEKIROKU_FETCH_DELAY

1.5

Seconds to wait between transcript fetches during imports.

TUBEKIROKU_MAX_IMPORT

1000

Upper limit on videos per channel import.

TUBEKIROKU_TRANSPORT

stdio

stdio or http.

TUBEKIROKU_HOST / TUBEKIROKU_PORT

127.0.0.1 / 8000

HTTP bind address.

How it works

MCP client ──tools──▶ server.py ──┬──▶ library.py ───▶ SQLite: videos, transcript versions, cues
                                  ├──▶ channels.py         channels, channel membership
                                  └──▶ jobs.py ◀── worker   import jobs and per-video items
                                          │
              sources/youtube.py ◀────────┴──▶ sources/channels.py
              (captions + oEmbed)                (channel page + yt-dlp upload listing)

library.py, channels.py and jobs.py hold the logic and know nothing about MCP, so other interfaces can reuse them. Jobs advance one unit of work at a time (list the uploads, or fetch one video), commit after each, and hold a short lease so two server processes sharing a library never work on the same job. Sources sit behind small adapter interfaces; file imports and the official YouTube Data API are planned as additional adapters.

Personal use and YouTube's terms

TubeKiroku is a tool you run yourself, for your own use. It retrieves captions that YouTube shows publicly, from your own network, and stores them only on your machine. You are responsible for how you use it and for complying with YouTube's Terms of Service and the rights of video creators. The project does not operate a public instance and does not redistribute transcripts. Do not deploy it as a public service that fetches transcripts on behalf of others.

TubeKiroku is not affiliated with or endorsed by YouTube or Google.

Development

git clone https://github.com/chethankailash/tubekiroku && cd tubekiroku
uv sync
uv run pytest            # tests use a fake source and never touch the network
uv run ruff check . && uv run ruff format --check .
npx @modelcontextprotocol/inspector uv run tubekiroku   # try the tools interactively

License

MIT

Available Tools

14 tools
cancel_jobA
Idempotent

Stop a running import. Transcripts already saved are kept; retry_job resumes it later.

Inputs: job_id (required). Returns: kind, items, limit, scope, +14 more

get_channel_infoB
Read-only

Resolve a channel: ID, title, handle, estimated uploads, and how much of it is already saved.

Inputs: channel (required). Returns: url, title, handle, last_job, +5 more

get_job_statusB
Read-only

Report an import job's phase, totals per outcome, per-video results and what to do next.

Inputs: job_id (required), limit, cursor, item_status. Returns: kind, items, limit, scope, +14 more

get_transcriptA
Read-only

Return the full transcript of a YouTube video, one page at a time.

    The transcript is saved to the local library on first fetch, so later reads are instant.
    A page with a non-null next_cursor is only part of the transcript: call again with that cursor
    to read the rest. Summarizing is up to you; this tool always returns the original words.
    

Inputs: video, cursor, format, origin, +3 more. Returns: text, title, offset, origin, +10 more

get_transcript_segmentA
Read-only

Return the timed passage around a moment in a video, with nearby context and jump links.

Use it to verify or expand a quote before citing it.

Inputs: start_ms (required), video, end_ms, version, +2 more. Returns: title, end_ms, origin, version, +5 more

get_video_infoB
Read-only

Resolve a YouTube video: canonical ID, title, channel, and any transcript versions already saved.

Inputs: video (required), refresh. Returns: url, title, video_id, channel_url, +2 more

import_channelA
Idempotent

Save transcripts for a channel's uploads into the library, as a resumable background job.

    Call first without confirm to preview the scope and show it to the user. With confirm=true the
    job starts and returns a job_id; it keeps running if the chat ends. Already saved transcripts are
    reused. Use get_job_status to follow progress.
    

Inputs: channel (required), limit, scope, confirm, +2 more. Returns: limit, scope, job_id, status, +5 more

list_channel_videosA
Read-only

List a channel's uploads, newest first (Shorts and past streams included), marking saved transcripts.

Inputs: limit, cursor, channel. Returns: offset, videos, channel, next_cursor, +1 more

list_jobsB
Read-only

List recent import jobs, newest first, with their totals.

Inputs: limit. Returns: jobs

list_languagesB
Read-only

List the caption tracks a video offers: language, origin (creator or auto) and whether it is saved.

Inputs: video (required). Returns: tracks, video_id

list_saved_channelsB
Read-only

List channels in the library with known videos, saved transcripts and their latest import.

Inputs: no named parameters. Returns: channels

refresh_channelA
Idempotent

Re-run a channel's last import to pick up new uploads. Saved transcripts are reused, not refetched.

Inputs: channel (required), confirm, request_key. Returns: limit, scope, job_id, status, +5 more

retry_jobA
Idempotent

Resume a stopped, cancelled or finished job, giving failed videos a fresh set of attempts.

Inputs: job_id (required). Returns: kind, items, limit, scope, +14 more

server_infoA
Read-only

Report the TubeKiroku server version, health and where the library is stored.

Inputs: no named parameters. Returns: name, status, version, data_dir

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 14 tools

    Disambiguation4/5

    Most tools target clearly distinct resources: videos, channels, jobs, and per-video metadata. The only real overlap is the trio import_channel / refresh_channel / retry_job, which all (re)start transcript imports and could be misselected, though the descriptions do differentiate preview, increment, and resume semantics. get_transcript vs get_transcript_segment are well separated by scope.

    Naming Consistency4/5

    Nearly all tools follow a clean verb_noun snake_case pattern (list_jobs, get_video_info, import_channel, cancel_job). The single outlier is server_info, which breaks the verb-first convention but is still perfectly readable. Overall very predictable.

    Tool Count5/5

    14 tools is well within the sweet spot for a server covering video metadata, transcripts, channel imports, and job lifecycle. Each tool maps to a distinct operation with no filler.

    Completeness4/5

    The lifecycle is well covered: resolve, list, import (with preview/confirm), monitor, cancel, retry, and refresh. Gaps are minor but real: there is no way to delete or prune saved transcripts/channels, and no cross-library search beyond listing, which are likely asks given the server explicitly maintains a persistent local library.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers