Building a Remote MCP Server on Cloudflare (Without Auth)
LocalAbout Building a Remote MCP Server on Cloudflare (Without Auth)
A YouTube MCP server deployed on Cloudflare Workers for creators and channel operators to query analytics, videos, and channel information. It also provides audience insights, competitor analysis, and content suggestions, using Google OAuth for authorization.
Key features
- 01Query channel performance and revenue metrics
- 02Analyze video retention and traffic sources
- 03Review audience demographics and geography
- 04Search videos and retrieve channel information
- 05Analyze competitors and suggest content
Use cases
- 01Review recent channel performance and subscriber growth
- 02Identify top-performing content
- 03Understand audience composition and viewing patterns
- 04Compare competitor channels and find content opportunities
MCP support
The server provides MCP clients with YouTube analytics, content strategy, and data-query tools. It runs on Cloudflare Workers and uses Google OAuth to access relevant APIs.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project README🎬 YouTube MCP Server: Remote MCP on Cloudflare Workers
A powerful Model Context Protocol (MCP) server that provides AI assistants with comprehensive YouTube analytics and channel management capabilities. Built with TypeScript, deployed on Cloudflare Workers, and secured with Google OAuth.
✨ Features
📊 YouTube Analytics
- Channel Performance: Revenue, views, subscriber growth, engagement metrics
- Video Analytics: Deep performance analysis with retention rates and traffic sources
- Audience Insights: Demographics, geography, device usage, and viewing patterns
- Top Content: Identify best-performing videos by views, revenue, or engagement
🎯 Content Strategy Tools
- Trending Analysis: AI-powered content suggestions based on current trends
- Competitor Intelligence: Analyze competitor channels and identify content gaps
- Performance Optimization: Recommendations based on your channel's data
🔍 YouTube Data Access
- Video Search: Find videos across YouTube with advanced filtering
- Channel Information: Get detailed channel stats and recent uploads
- Video Details: Comprehensive metadata, stats, and engagement data
🛠️ Quick Start
Prerequisites
- YouTube channel with uploaded content
- Google Cloud Console project with YouTube APIs enabled
- Cloudflare Workers account
1. Clone and Install
git clone https://github.com/lauragift21/youtube-mcp-server.git
cd youtube-mcp-server
npm install
2. Configure OAuth
-
Create Google OAuth Credentials:
- Go to Google Cloud Console
- Enable YouTube Data API v3 and YouTube Analytics API
- Create OAuth 2.0 credentials (Web Application)
- Add redirect URI:
https://your-worker.workers.dev/callback
-
Set Environment Variables:
npx wrangler secret put GOOGLE_OAUTH_CLIENT_ID npx wrangler secret put GOOGLE_OAUTH_CLIENT_SECRET npx wrangler secret put COOKIE_ENCRYPTION_KEY
You can generate a random string for COOKIE_ENCRYPTION_KEY
3. Deploy
npx wrangler deploy
Connect to Claude Desktop
Add to your Claude Desktop configuration:
{
"mcpServers": {
"youtube-mcp-server": {
"command": "npx",
"args": [
"mcp-remote",
"https://your-deployment.workers.dev/sse"
]
}
}
}
Connect to Cloudflare AI Playground
You can connect your MCP server from the Cloudflare AI Playground, which is a remote MCP client:
- Go to https://playground.ai.cloudflare.com/
- Enter your deployed MCP server URL (remote-mcp-server-authless..workers.dev/sse)
- You can now use your MCP tools directly from the playground!
🔧 Available Tools
Analytics Tools
youtube_getChannelAnalytics- Get channel performance metricsyoutube_analyzeVideoPerformance- Deep dive into video performanceyoutube_getTopVideos- Find your best-performing contentyoutube_getAudienceDemographics- Understand your viewers
Content Strategy Tools
youtube_suggestContentIdeas- AI-powered topic suggestionsyoutube_analyzeCompetitors- Competitive analysis and benchmarking
Data Tools
youtube_searchVideos- Search YouTube with advanced filtersyoutube_getVideoDetails- Get comprehensive video informationyoutube_getChannelInfo- Channel overview and statisticsyoutube_getChannelVideos- Recent uploads from any channel
💡 Example Queries
Try these questions with Claude Desktop:
📈 Channel Analytics
"Show me my YouTube channel performance for the past 30 days"
🎯 Content Strategy
"What should I make a video about next in the AI/tech space?"
"Analyze my competitors and show me content opportunities I'm missing"
👥 Audience Insights
"Who are my viewers? Show me demographics and geography data"
🏗️ Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Claude Desktop │────│ MCP Server │────│ YouTube APIs │
│ (MCP Client) │ │ (Cloudflare) │ │ (Google) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
┌──────────────────┐
│ OAuth Provider │
│ (Google Auth) │
└──────────────────┘
Key Components
- MCP Server: Handles tool requests and API communication
- OAuth Provider: Manages Google authentication and token refresh
- YouTube Data API: Public video and channel information
- YouTube Analytics API: Private channel analytics and revenue data
🔗 Links
- Model Context Protocol - Learn about MCP
- YouTube Data API - YouTube API documentation
- Cloudflare Workers - Serverless deployment platform
- Claude Desktop - AI assistant with MCP support
Built with ❤️ by Gift Egwuenu | Powered by MCP & Cloudflare Workers
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.