Sponsored by Deepsite.site

Youtube Data

Created By
diasm310 months ago
Content

YouTube Data MCP Server

A Model Context Protocol (MCP) server for extracting YouTube video transcripts and comments. This server provides tools to get transcripts and comments from YouTube videos for analysis and summarization.

Features

  • getTranscript: Extract subtitles/transcripts from YouTube videos
  • getVideoInfo: Get basic information about a YouTube video
  • getReplies: Fetch comments for YouTube videos (using SerpAPI)
  • getCommentReplies: Get replies to specific YouTube comments

Requirements

  • Node.js 16+
  • TypeScript
  • SerpAPI API key (for comments functionality)

Installation(for Developer)

# Clone the repository
git clone https://github.com/diasm3/serpapi-youtube-mcp-server.git
cd youtube-data-mcp

# Install dependencies
npm install

Configuration

Create a .env file in the root directory with your SerpAPI key:

SERPAPI_KEY=your_serpapi_key_here

You can get a SerpAPI key by signing up at SerpAPI.

Build and Run

# Build the project
npm run build

# Run the server
npm start

The server will start running and listening for commands via stdin/stdout.

Using with Claude

To use this MCP server with Claude:

  1. Add the server to your Claude configuration file:
{
  "mcpServers": {
    "youtube-data": {
      "command": "npx",
      "args": ["-y","youtube-data-mcp"],
      "env": {
        "SERPAPI_KEY": "your_serpapi_key_here"
      }
    }
  }
}
  1. Restart Claude to apply the configuration.

  2. Now you can ask Claude to:

    • "Get the transcript for this YouTube video: [URL]"
    • "Show me the comments for this YouTube video: [URL]"
    • "Get replies to specific comments"

API Tools

searchYoutube

Search for videos, channels, and playlists on YouTube.

Parameters:

  • query: Search query for YouTube (required)
  • limit: Maximum number of results to return (optional, default: 10)
  • gl: Country code for search results (optional, e.g., 'us', 'kr', 'jp')
  • hl: Language code for search results (optional, e.g., 'en', 'ko', 'ja')
  • sp: Special parameter for filtering or pagination (optional)
  • pageToken: Token for pagination from previous response (optional)

Example (via Claude):

Search for "JavaScript tutorial" on YouTube and show me the top 5 results

getVideoInfo

Retrieve basic information about a YouTube video.

Parameters:

  • url: YouTube video URL or video ID (required)

Returns:

  • videoId: The video's ID
  • title: The video's title
  • viewCount: Number of views
  • publishDate: Date when the video was published
  • channelName: Name of the channel that published the video
  • commentCount: Number of comments on the video
  • commentsNextPageToken: Token for fetching comments
  • commentsSortingTokens: Tokens for different comment sorting options

Example (via Claude):

Get information about this YouTube video: https://www.youtube.com/watch?v=dQw4w9WgXcQ

getTranscript

Extracts transcripts/subtitles from YouTube videos.

Parameters:

  • url: YouTube video URL or video ID (required)
  • lang: Language code for transcript (optional, default: 'en')

Example (via Claude):

Please get the transcript for this YouTube video: https://www.youtube.com/watch?v=dQw4w9WgXcQ

getReplies

Retrieves comments from a YouTube video using SerpAPI.

Parameters:

  • url: YouTube video URL or video ID (required for initial page, optional for pagination)
  • limit: Maximum number of comments to retrieve (optional, default: 100)
  • sort: Sort order for comments ('relevance' or 'time', optional, default: 'relevance')
  • pageToken: Token for pagination from previous response (optional)

Example (via Claude):

Show me comments for this YouTube video: https://www.youtube.com/watch?v=dQw4w9WgXcQ

getCommentReplies

Gets replies for a specific YouTube comment.

Parameters:

  • pageToken: Reply token from a comment to get its replies (required)

This function is typically used programmatically after getting the repliesToken from a comment.

Understanding SerpAPI Integration

This MCP server uses SerpAPI's YouTube Search API and YouTube Video API to fetch search results, comments, and other data. SerpAPI provides a way to scrape YouTube data without directly using YouTube's official API.

Key points about SerpAPI usage:

  • The server uses the youtube_video engine with the v parameter (YouTube video ID)
  • Comments are paginated using tokens returned in the API response
  • Comment replies are fetched separately using their specific tokens
  • API calls are limited by your SerpAPI subscription plan

Troubleshooting

  • If you encounter a 400 Bad Request error, verify your SerpAPI key is valid and properly set in the .env file
  • Check the server logs for detailed error messages and debugging information
  • For comment-related issues, ensure SerpAPI still supports the YouTube Video API format used

License

MIT

Server Config

{
  "mcpServers": {
    "youtube-data": {
      "command": "npx",
      "args": [
        "-y",
        "youtube-data-mcp"
      ],
      "env": {
        "SERPAPI_KEY": "your_serpapi_key_here"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
ChatWiseThe second fastest AI chatbot™
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server
DeepChatYour AI Partner on Desktop
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
CursorThe AI Code Editor
Serper MCP ServerA Serper MCP Server
Tavily Mcp
Playwright McpPlaywright MCP server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs