Skip to content

2shin0/youtube-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

YouTube Data Collector MCP Server

이 λ ˆν¬μ§€ν† λ¦¬λŠ” FastMCPλ₯Ό 기반으둜 κ΅¬μΆ•λœ YouTube 데이터 μˆ˜μ§‘μš© MCP(Model Context Protocol) μ„œλ²„μž…λ‹ˆλ‹€.

Claude, ChatGPT λ“±μ˜ LLM을 YouTube API와 μ—°λ™ν•˜μ—¬ μžλ§‰ μΆ”μΆœ, μ˜μƒ 검색, 채널 뢄석, λŒ“κΈ€ μˆ˜μ§‘ λ“±μ˜ μž‘μ—…μ„ μˆ˜ν–‰ν•  수 μžˆλ„λ‘ 4κ°€μ§€ 핡심 도ꡬ(Tool)λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€.

ν”„λ‘ νŠΈμ—”λ“œ/MCP ν΄λΌμ΄μ–ΈνŠΈλŠ” 이 λ ˆν¬μ§€ν† λ¦¬ λ₯Ό μ°Έκ³ ν•΄ μ£Όμ„Έμš”.

μ£Όμš” κΈ°λŠ₯

이 MCP μ„œλ²„λŠ” λ‹€μŒκ³Ό 같은 κΈ°λŠ₯을 μ œκ³΅ν•©λ‹ˆλ‹€.

  1. μžλ§‰(Transcript) μΆ”μΆœ: YouTube μ˜μƒμ˜ μžλ§‰μ„ κ°€μ Έμ˜΅λ‹ˆλ‹€ (ν•œκ΅­μ–΄/μ˜μ–΄ 지원).
  2. μ˜μƒ 검색: ν‚€μ›Œλ“œλ‘œ μ˜μƒμ„ κ²€μƒ‰ν•˜κ³  쑰회수, μ’‹μ•„μš” 수 λ“± μ„ΈλΆ€ 정보λ₯Ό ν™•μΈν•©λ‹ˆλ‹€.
  3. 채널 정보 뢄석: νŠΉμ • μ˜μƒμ˜ 채널 정보λ₯Ό νŒŒμ•…ν•˜κ³ , ν•΄λ‹Ή μ±„λ„μ˜ 졜근 μ—…λ‘œλ“œ λͺ©λ‘μ„ κ°€μ Έμ˜΅λ‹ˆλ‹€.
  4. λŒ“κΈ€ μˆ˜μ§‘: μ˜μƒμ˜ λŒ“κΈ€μ„ κ΄€λ ¨μ„± λ˜λŠ” μ‹œκ°„μˆœμœΌλ‘œ μˆ˜μ§‘ν•˜μ—¬ 여둠을 νŒŒμ•…ν•©λ‹ˆλ‹€.

기술 μŠ€νƒ (Tech Stack)

  • Python 3.10+
  • FastMCP: MCP μ„œλ²„ ꡬ좕 ν”„λ ˆμž„μ›Œν¬
  • YouTube Data API v3: μ˜μƒ 메타데이터 및 λŒ“κΈ€ 검색
  • youtube-transcript-api: 비곡식 μžλ§‰ μΆ”μΆœ 라이브러리

ν™˜κ²½ λ³€μˆ˜ μ„€μ •

이 μ„œλ²„λ₯Ό μ‹€ν–‰ν•˜κΈ° μœ„ν•΄μ„œλŠ” Google Cloud Platformμ—μ„œ λ°œκΈ‰λ°›μ€ YouTube Data API ν‚€κ°€ ν•„μš”ν•©λ‹ˆλ‹€. FastMCP Cloud의 Secrets 섀정에 λ‹€μŒ λ³€μˆ˜λ₯Ό μΆ”κ°€ν•΄μ£Όμ„Έμš”.

λ³€μˆ˜λͺ… μ„€λͺ…
YOUTUBE_API_KEY (ν•„μˆ˜) Google Cloud Consoleμ—μ„œ λ°œκΈ‰λ°›μ€ YouTube Data API v3 Key

제곡 도ꡬ 상세

1. get_youtube_transcript

유튜브 μ˜μƒμ˜ μžλ§‰ ν…μŠ€νŠΈλ₯Ό μΆ”μΆœν•©λ‹ˆλ‹€. λ‚΄μš©μ„ μš”μ•½ν•˜κ±°λ‚˜ 뢄석할 λ•Œ μœ μš©ν•©λ‹ˆλ‹€.

  • Arguments:
    • url (str): 뢄석할 유튜브 μ˜μƒ URL
    • languages (list[str]): μš°μ„ μˆœμœ„ μ–Έμ–΄ μ½”λ“œ (κΈ°λ³Έκ°’: ['ko', 'en'])

2. search_youtube_videos

ν‚€μ›Œλ“œλ₯Ό μ‚¬μš©ν•˜μ—¬ 유튜브 μ˜μƒμ„ κ²€μƒ‰ν•©λ‹ˆλ‹€.

  • Arguments:
    • query (str): 검색어
    • order (str): μ •λ ¬ κΈ°μ€€ (relevance, date, viewCount, rating, title, videoCount / κΈ°λ³Έκ°’: relevance)
    • max_results (int): λ°˜ν™˜ν•  μ˜μƒ 개수 (κΈ°λ³Έκ°’: 5)

3. get_channel_info

νŠΉμ • μ˜μƒμ΄ μ†ν•œ μ±„λ„μ˜ 정보(κ΅¬λ…μž 수, 총 쑰회수)와 ν•΄λ‹Ή μ±„λ„μ˜ μ΅œμ‹ /인기 μ˜μƒμ„ μ‘°νšŒν•©λ‹ˆλ‹€.

  • Arguments:
    • video_url (str): λŒ€μƒ 유튜브 μ˜μƒ URL (채널 μ‹λ³„μš©)
    • order (str): μ˜μƒ λͺ©λ‘ μ •λ ¬ κΈ°μ€€ (date, viewCount, rating / κΈ°λ³Έκ°’: date)
    • max_results (int): κ°€μ Έμ˜¬ 채널 μ˜μƒ 개수 (κΈ°λ³Έκ°’: 5)

4. get_youtube_comments

μ˜μƒμ˜ λŒ“κΈ€ λ°˜μ‘μ„ μˆ˜μ§‘ν•©λ‹ˆλ‹€.

  • Arguments:
    • video_url (str): λŒ€μƒ 유튜브 μ˜μƒ URL
    • order (str): μ •λ ¬ κΈ°μ€€ (relevance: 인기순, time: μ΅œμ‹ μˆœ / κΈ°λ³Έκ°’: relevance)
    • max_results (int): μˆ˜μ§‘ν•  λŒ“κΈ€ 수 (κΈ°λ³Έκ°’: 10)

배포 및 μ‹€ν–‰

이 ν”„λ‘œμ νŠΈλŠ” FastMCP Cloud에 μ΅œμ ν™”λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

  1. 이 λ ˆν¬μ§€ν† λ¦¬λ₯Ό GitHub에 ν‘Έμ‹œν•©λ‹ˆλ‹€.
  2. FastMCP Cloud λŒ€μ‹œλ³΄λ“œμ—μ„œ λ ˆν¬μ§€ν† λ¦¬λ₯Ό μ—°κ²°ν•©λ‹ˆλ‹€.
  3. YOUTUBE_API_KEY ν™˜κ²½ λ³€μˆ˜λ₯Ό μ„€μ •ν•©λ‹ˆλ‹€.
  4. 배포가 μ™„λ£Œλ˜λ©΄ Claude Desktop λ˜λŠ” μ§€μ›λ˜λŠ” ν΄λΌμ΄μ–ΈνŠΈμ—μ„œ ν•΄λ‹Ή μ„œλ²„λ₯Ό μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

YouTube Data Collector MCP Server

This repository is a YouTube data collection MCP (Model Context Protocol) server built on FastMCP.

It provides 4 core tools that allow LLMs like Claude and ChatGPT to interact with the YouTube API for tasks such as transcript extraction, video search, channel analysis, and comment collection.

Please refer to this repository for the frontent/MCP Client.

Key Features

This MCP server provides the following functionalities:

  1. Transcript Extraction: Retrieves subtitles from YouTube videos (Supports Korean/English).
  2. Video Search: Searches for videos by keyword and retrieves details like view counts and likes.
  3. Channel Analysis: Identifies channel information from a specific video and fetches the channel's recent uploads.
  4. Comment Collection: Collects video comments sorted by relevance or time to analyze public opinion.

πŸ› οΈ Tech Stack

  • Python 3.10+
  • FastMCP: Framework for building MCP servers
  • YouTube Data API v3: For retrieving video metadata and comments
  • youtube-transcript-api: Unofficial library for extracting transcripts

Environment Variables

To run this server, a YouTube Data API key from Google Cloud Platform is required. Please add the following variable to your Secrets configuration in FastMCP Cloud.

Variable Name Description
YOUTUBE_API_KEY (Required) YouTube Data API v3 Key issued from Google Cloud Console

Available Tools

1. get_youtube_transcript

Extracts transcript text from a YouTube video. Useful for content summarization or analysis.

  • Arguments:
    • url (str): The URL of the YouTube video to analyze.
    • languages (list[str]): Priority list of language codes (default: ['ko', 'en']).

2. search_youtube_videos

Searches for YouTube videos using specific keywords.

  • Arguments:
    • query (str): Search keyword.
    • order (str): Sort order (relevance, date, viewCount, rating, title, videoCount / default: relevance).
    • max_results (int): Number of videos to return (default: 5).

3. get_channel_info

Retrieves information (subscribers, total views) for the channel associated with a specific video, along with its recent/popular videos.

  • Arguments:
    • video_url (str): The URL of a video from the target channel (used to identify the channel).
    • order (str): Sort order for the video list (date, viewCount, rating / default: date).
    • max_results (int): Number of channel videos to retrieve (default: 5).

4. get_youtube_comments

Collects comments and reactions from a specific video.

  • Arguments:
    • video_url (str): The URL of the target YouTube video.
    • order (str): Sort order (relevance: top rated, time: newest / default: relevance).
    • max_results (int): Number of comments to collect (default: 10).

Deployment & Usage

This project is optimized for FastMCP Cloud.

  1. Push this repository to GitHub.
  2. Connect the repository in the FastMCP Cloud dashboard.
  3. Set the YOUTUBE_API_KEY environment variable.
  4. Once deployed, the server is available for use in Claude Desktop or other supported clients.

About

πŸŽ₯ YouTube data collection MCP

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages