SuperAPIAI Directory

tube-bridge

github.com · AI video

Self-hosted YouTube research: video and channel search, transcripts, comments, playlists, timestamped frames and private local semantic corpora.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Windows · Linux

About this tool

Purpose

tube-bridge is a self-hosted YouTube research MCP (Model Context Protocol) server for AI agents. It enables agents to search YouTube videos and channels, read transcripts and comments, extract timestamped video frames, and build a private local semantic search corpus through 17 MCP tools. The project is MIT-licensed and provides no account system, hosted access, hosted storage, or SLA.

Main capabilities

  • Number of tools: 17 MCP tools, 14 of which require no YouTube API key.
  • Search and information: Search, video information, and trending content via yt-dlp require no API key; with a configured key, it can be upgraded to the YouTube Data API v3.
  • Transcripts and comments: Read video transcripts and comments (comments require a YouTube Data API v3 key).
  • Channel search and details: Requires an API key.
  • Local semantic corpus: Storage and embedding inference are both done locally on the machine running tube-bridge.
    • Storage: SQLite plus sqlite-vec, located at ~/.tube_bridge/corpus.db
    • Embeddings: BGE-small-en-v1.5 via fastembed
    • Chunking: 80-second windows, 20-second overlap
    • Ranking: overlap deduplication and source-based per-video limits
    • Results: similarity score, time span, video title, canonical URL, and timestamped URL
  • Frame extraction:youtube_get_frame The tool requires ffmpeg to be in PATH; the Docker image includes it. Each call downloads a small temporary media segment near the timestamp, returns a constrained JPEG as MCP ImageContent, and deletes the temporary media before returning. No frame or clip library is created.
  • Research output: title, similarity score, canonical video URL, and timestamped link.

Usage

One-minute connection

The easiest way is to use uvx, which runs the published PyPI package in an isolated environment. Usually the MCP client starts the command on your behalf.

tube-bridge requires Python 3.12 or newer. The API key is optional. ffmpeg is only used for youtube_get_frame; the first embedding operation may download the local model.

Claude Desktop: Open Settings → Developer → Edit Config and add the configuration; save and restart Claude Desktop.

Cursor: In the project, create .cursor/mcp.json, or add the server to the user-level MCP configuration.

VS Code: Create .vscode/mcp.json.

Pi: The package-relative adapter and the canonical tube-bridge-research skill can be loaded from the same Git source. The adapter registers a status tool and all 17 MCP tools (prefixed with tube_bridge_), reads the existing plugin.json and mcp.json, starts only the local stdio runtime, preserves bounded text and image content, and forwards only allowlisted subprocess environments. The Pi package manager installs Node adapter dependencies, but does not install Python or ffmpeg. Ensure that the python3 visible to Pi is Python 3.12+ and that tube-bridge dependencies are installed; install ffmpeg separately to use youtube_get_frame. By default, Pi-managed state is located in the platform data directory; set TUBE_BRIDGE_PI_DATA to move that root directory. Explicit TUBE_BRIDGE_CACHE still takes precedence for the runtime database. The optional real-time frame gating is /tube-bridge-selftest frame.

If the desktop client cannot find uvx, replace "uvx" with which uvx(macOS/Linux) or where.exe uvx(Windows) The absolute path returned.

Complete research workflow example

Ask the agent:

Search YouTube for recent videos about local-first AI agents. Read the transcript of the strongest result, add it to a corpus named local-agents, find the section discussing memory, return the timestamped source link, and extract a frame from that moment.

The agent can complete this with the following tool sequence: add more videos using corpus_add, then use corpus_search to search all transcripts at once.

Optional YouTube Data API key

A YouTube Data API v3 key unlocks comments, channel search, and channel details, and improves the reliability of search, video info, and trending. Create a key in the Google Cloud Console, enable YouTube Data API v3, and expose it to the process that starts tube-bridge. Do not commit the key to the MCP configuration file; use the client's key/environment support.

Other ways to run

  • Persistent PyPI install: health endpoint http://localhost:8080/health; Streamable HTTP endpoint http://localhost:8080/mcp.
  • Official MCP Registry: registered name io.github.TheWhiteWater/tube-bridge. Clients that support the registry can install the PyPI distribution with uvx and start the stdio server, with no hosting middleman required.
  • Remote HTTP configuration: for self-run HTTP instances, protect the remote MCP routes by setting a server-side Bearer key./health stays public. When TUBE_BRIDGE_AUTH_KEY is set,/mcp、/sse and /messages require a Bearer key. Legacy SSE is available at /sse .

Environment variables and run modes

  • stdio is recommended for local clients;
  • Streamable HTTP at /mcp is available for self-hosted remote use;
  • successful fallback responses keep their normal mode;
  • controlled failures use typed MCP errors with stable code、source and retryable fields;
  • cache and corpus databases are separate and owned by the operator.

Agent Plugin preview

GitHub Releases include tube-bridge-agent-plugin-<version>.zip, which includes: local stdio MCP configuration, the tube-bridge-research skill, research templates, and source evaluation guidelines. Agent Plugins v1 does not standardize dependency installation. Install Python 3.12+, ffmpeg, and package dependencies in the environment used by the plugin host. The bundle contains no credentials.

When to use it

  • AI agents doing YouTube video research that need search, transcripts, comments, and visual frame evidence.
  • Building private local semantic search corpora that aggregate multiple video transcripts for cross-video search.
  • Needing a self-hosted research toolchain with no vendor lock-in.

Limitations

  • YouTube may rate-limit anonymous yt-dlp and transcript requests, especially from cloud-hosted IP ranges.
  • A Data API key improves discovery and metadata reliability, but does not replace transcript access.
  • Initial local embedding model setup may require network access and extra disk space.
  • tube-bridge is self-hosted software; no accounts, public hosted access, managed storage, or SLA are provided.
  • If YouTube blocks requests from your network, set TUBE_BRIDGE_PROXY. Proxy credentials should go in environment variables rather than committed configuration.
  • python test_tools.py is an optional live YouTube smoke test. The deterministic test suite does not call YouTube.

License

MIT — see LICENSE.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools