Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

Enables extracting YouTube video transcripts, comments, and search results via MCP. Supports both Stdio and StreamableHTTP transports.

README.md

YouTube Data MCP Server

A Model Context Protocol (MCP) server for extracting YouTube video transcripts, comments, and search results. Supports both Stdio and StreamableHTTP transports.

Features

  • getTranscript - Extract subtitles/transcripts with optional timestamps
  • getVideoInfo - Get video metadata (title, views, comments count)
  • getComments - Fetch comments with pagination and sorting
  • getCommentReplies - Get replies to specific comments
  • searchYoutube - Search videos, channels, and playlists

What's New in v2.0

  • Dual Transport: Stdio (default) + StreamableHTTP for web integration
  • Reliable Transcripts: Replaced youtube-transcript with youtube-caption-extractor (bot detection bypass, serverless support)
  • Timestamp Support: Optional start time and duration for each transcript segment
  • Modular Architecture: Clean separation of concerns (config, types, services, tools)
  • MCP SDK v1.25.2: Latest SDK with improved stability

Requirements

  • Node.js 18+
  • SerpAPI key (for search, comments, video info)

Installation

git clone https://github.com/diasm3/serpapi-youtube-mcp-server.git
cd serpapi-youtube-mcp-server
npm install

Configuration

Create a .env file:

SERPAPI_KEY=your_serpapi_key_here
PORT=3000  # optional, for HTTP mode

Get your SerpAPI key at serpapi.com.

Running the Server

# Build
npm run build

# Stdio mode (default) - for Claude Desktop, Cursor, etc.
npm start

# HTTP mode - for web applications
npm start -- --http
# or
MCP_TRANSPORT=http npm start

HTTP Endpoints

When running in HTTP mode:

  • GET /health - Health check
  • POST /mcp - MCP request handler

MCP Client Configuration

Claude Desktop / Cursor

{
  "mcpServers": {
    "youtube-data": {
      "command": "node",
      "args": ["/path/to/serpapi-youtube-mcp-server/build/index.js"],
      "env": {
        "SERPAPI_KEY": "your_serpapi_key_here"
      }
    }
  }
}

Using npx

{
  "mcpServers": {
    "youtube-data": {
      "command": "npx",
      "args": ["-y", "youtube-data-mcp"],
      "env": {
        "SERPAPI_KEY": "your_serpapi_key_here"
      }
    }
  }
}

API Tools

getTranscript

Extract transcript/subtitles from a YouTube video.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | url | string | Yes | YouTube URL or video ID | | lang | string | No | Language code (default: 'en') | | includeTimestamps | boolean | No | Include start/duration per segment |

Get the Korean transcript for https://youtube.com/watch?v=xxxxx with timestamps

getVideoInfo

Get video metadata using SerpAPI.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | url | string | Yes | YouTube URL or video ID |

Returns: title, views, publish date, channel, comment count, pagination tokens

getComments

Fetch video comments with pagination.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | url | string | Conditional | Required for first page | | limit | number | No | Max comments (default: 100) | | sort | string | No | 'relevance' or 'time' | | pageToken | string | No | For pagination |

getCommentReplies

Get replies to a specific comment.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | pageToken | string | Yes | repliesToken from comment |

searchYoutube

Search YouTube for videos, channels, playlists.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | query | string | Yes | Search query | | limit | number | No | Max results (default: 10) | | gl | string | No | Country code (us, kr, jp) | | hl | string | No | Language code (en, ko, ja) | | sp | string | No | Filter parameter | | pageToken | string | No | For pagination |

Project Structure

src/
├── index.ts          # Server entry (Stdio + HTTP)
├── config/           # Environment configuration
├── types/            # Zod schemas + TypeScript types
├── services/
│   ├── serpapi.ts    # SerpAPI integration
│   └── youtube.ts    # Transcript extraction
├── tools/            # MCP tool definitions
└── utils/            # Helper functions

Troubleshooting

Transcript not available

  • Some videos don't have captions enabled
  • Try different language codes (en, ko, ja, etc.)
  • Auto-generated captions may not be available for all videos

SerpAPI errors

  • Verify your API key is valid
  • Check your SerpAPI quota/limits
  • Ensure the video is publicly accessible

HTTP mode not starting

  • Check if PORT is already in use
  • Verify environment variables are set

License

MIT

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Search servers.