ytch-mcp

sms03/ytch-mcp

3.1

If you are the rightful owner of ytch-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The YouTube Channel Analyzer MCP Server is a tool designed to evaluate the activity and engagement metrics of YouTube channels using the YouTube Data API v3.

YouTube Channel Analyzer MCP Server

šŸ“ Project File Structure

youtube-channel-analyzer/
ā”œā”€ā”€ src/
│   └── server.py                     # Main MCP server code
ā”œā”€ā”€ requirements.txt                   # Python dependencies
ā”œā”€ā”€ README.md                         # Project documentation
ā”œā”€ā”€ .env.example                      # Environment variables example
└── setup.py                         # Package setup (optional)

šŸš€ Setup Instructions

1. Create Project Directory

mkdir youtube-channel-analyzer
cd youtube-channel-analyzer

2. Create Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Get YouTube API Key

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Enable YouTube Data API v3
  4. Create credentials (API Key)
  5. Restrict the API key to YouTube Data API v3 (recommended)

5. Create Environment File (Optional)

# Create .env file
echo "YOUTUBE_API_KEY=your_api_key_here" > .env

YouTube Channel Analyzer MCP Server

šŸ“ Project File Structure

youtube-channel-analyzer/
ā”œā”€ā”€ src/
│   └── server.py                     # Main MCP server code
ā”œā”€ā”€ requirements.txt                   # Python dependencies
ā”œā”€ā”€ README.md                         # Project documentation
ā”œā”€ā”€ .env.example                      # Environment variables example
ā”œā”€ā”€ claude_desktop_config.json        # Claude Desktop configuration
└── setup.py                         # Package setup (optional)

šŸš€ Claude Desktop Setup Instructions

1. Create Project Directory

mkdir youtube-channel-analyzer
cd youtube-channel-analyzer
mkdir src

2. Create Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install mcp httpx python-dateutil

4. Get YouTube API Key

  1. Go to Google Cloud Console
  2. Create a new project or select existing one
  3. Enable YouTube Data API v3
  4. Create credentials (API Key)
  5. Restrict the API key to YouTube Data API v3 (recommended)

5. Save the Server Code

Copy the main server code and save it as src/server.py

6. Configure Claude Desktop

Create or edit your Claude Desktop configuration file:

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%\Claude\claude_desktop_config.json

Add this configuration:

{
  "mcpServers": {
    "youtube-analyzer": {
      "command": "python",
      "args": ["/full/path/to/your/youtube-channel-analyzer/src/server.py"],
      "env": {
        "YOUTUBE_API_KEY": "your_youtube_api_key_here"
      }
    }
  }
}

Important: Replace /full/path/to/your/youtube-channel-analyzer/ with the actual absolute path to your project directory.

7. Restart Claude Desktop

Close and reopen Claude Desktop for the configuration to take effect.

šŸ”§ Using the Tool in Claude Desktop

Once configured, you can use the tool directly in Claude Desktop conversations:

Example usage:

Analyze this YouTube channel: https://www.youtube.com/@MrBeast

or

Can you check if this channel is still active? https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw

Supported URL formats:

  • https://www.youtube.com/channel/UC_x5XG1OV2P6uZZ5FSM9Ttw
  • https://www.youtube.com/c/ChannelName
  • https://www.youtube.com/user/Username
  • https://www.youtube.com/@Handle

šŸ”§ Manual API Key Usage

If you prefer not to set the API key in the environment, you can provide it directly:

Analyze this channel with API key: https://www.youtube.com/@channel_name
API Key: your_api_key_here

šŸ› Troubleshooting

Server Not Showing Up

  1. Check that the file path in claude_desktop_config.json is correct and absolute
  2. Ensure Python is in your PATH
  3. Verify all dependencies are installed
  4. Check Claude Desktop logs for errors

API Key Issues

  1. Ensure your API key is valid
  2. Check that YouTube Data API v3 is enabled in Google Cloud Console
  3. Verify API quotas haven't been exceeded

Path Issues on Windows

Use forward slashes or double backslashes in the config:

"args": ["C:/path/to/your/project/src/server.py"]

or

"args": ["C:\\path\\to\\your\\project\\src\\server.py"]

šŸ“Š Analysis Metrics

The server analyzes channels based on:

1. Recent Activity (40% weight)

  • Uploads in last 30 days
  • Days since last video
  • Upload frequency patterns

2. Engagement Metrics (30% weight)

  • Average views per video
  • Median views
  • View consistency

3. Subscriber Base (20% weight)

  • Total subscriber count
  • Channel reach potential

4. Content Volume (10% weight)

  • Total video count
  • Content library size

šŸŽÆ Verdict Scale

  • 🟢 VERY ALIVE (70-100 points): Highly active channel
  • 🟔 ALIVE (50-69 points): Regularly active channel
  • 🟠 DECLINING (30-49 points): Reduced activity
  • šŸ”“ NEARLY DEAD (15-29 points): Minimal activity
  • šŸ’€ DEAD (0-14 points): Inactive channel

šŸ“‹ Sample Output

# YouTube Channel Analysis Report

## šŸ“Š Channel Overview
**Name:** MrBeast
**Subscribers:** 123,456,789
**Total Videos:** 234
**Total Views:** 12,345,678,901
**Created:** 2012-02-20

## šŸŽÆ Verdict: 🟢 VERY ALIVE
**Health Score:** 85/100

### Analysis Factors:
• Very active uploads (4+ videos/month)
• High average views (10K+)
• Large subscriber base (100K+)
• Substantial content library (100+ videos)

## šŸ“ˆ Recent Activity Metrics
**Videos Analyzed:** 50 recent videos
**Upload Frequency:** Very Active (15+ videos/month)
**Uploads Last 30 Days:** 8
**Average Days Between Uploads:** 3.5

## šŸ‘ļø View Metrics
**Average Views:** 50,123,456
**Median Views:** 45,678,901
**Total Views (Recent Videos):** 2,506,172,800

## šŸ“ŗ Content Activity
**Videos in Last Year:** 45

## šŸŽ¬ Latest Video
**Title:** I Gave Away $1,000,000
**Published:** 2024-05-25
**Views:** 75,432,109

šŸ”§ Advanced Configuration

Custom Scoring Weights

You can modify the scoring weights in the analyze_channel_health method:

# Current weights:
# Recent activity: 40%
# Engagement: 30%
# Subscribers: 20%
# Content volume: 10%

Analysis Parameters

  • Recent videos analyzed: 50 (configurable)
  • Time period for "recent": 30 days
  • Year analysis: Last 365 days

šŸ› ļø Development

Adding New Features

  1. Extend the YouTubeAnalyzer class
  2. Add new metrics to the analysis
  3. Update the scoring algorithm
  4. Modify the report format

Error Handling

The server includes comprehensive error handling for:

  • Invalid YouTube URLs
  • API rate limits
  • Missing channels
  • Network issues

šŸ“„ License

This project is open-source and available under the MIT License.