sms03/ytch-mcp
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
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable YouTube Data API v3
- Create credentials (API Key)
- 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
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable YouTube Data API v3
- Create credentials (API Key)
- 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_x5XG1OV2P6uZZ5FSM9Ttwhttps://www.youtube.com/c/ChannelNamehttps://www.youtube.com/user/Usernamehttps://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
- Check that the file path in
claude_desktop_config.jsonis correct and absolute - Ensure Python is in your PATH
- Verify all dependencies are installed
- Check Claude Desktop logs for errors
API Key Issues
- Ensure your API key is valid
- Check that YouTube Data API v3 is enabled in Google Cloud Console
- 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
- Extend the
YouTubeAnalyzerclass - Add new metrics to the analysis
- Update the scoring algorithm
- 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.