tubemind-secure-mcp
ðŊ Why tubemind-secure-mcp?
Turn Claude into a YouTube growth strategist â without ever handing it your raw OAuth tokens.
⥠Plug-and-play with Claude Desktop â drop one config block, get 18 production tools.
ð Secure by default â tokens encrypted at rest (AES-256-GCM), SSRF guard, rate limiting, audit log, Zod-validated inputs. OWASP Top 10 mapped end-to-end.
ð Real data, not scraping â official YouTube Data API v3 + YouTube Analytics API. Brand Accounts supported.
ð§ Beyond raw API â built-in heuristics for CTR, retention, keyword difficulty, content gaps, hook angles and N-day content calendars.
ðŠķ Tiny footprint â 3 runtime deps (
@modelcontextprotocol/sdk,googleapis,zod). Node âĨ 20.
âĻ Overview
tubemind-secure-mcp is a Model Context Protocol (MCP) server that gives Claude Desktop (and any MCP client) 18 production-grade tools for working with YouTube:
ð Search & SEO â trending topics, keyword stats, tag suggestions
ðš Video & Channel â list videos, read/update metadata, get tags
ð Analytics â channel analytics (views, watch time, retention) via YouTube Analytics API
ð Benchmark â compare your channel against competitors
ð§ Heuristics â keyword difficulty, title patterns, content gaps, hook angles, CTR potential, retention signals, content calendar
ðĩïļ Competitor research â competitor video discovery
Built secure by design: OAuth2 (Brand Account ready), AES-256-GCM token encryption at rest, SSRF guard, rate limiting, audit logging, Zod input validation â mapped to OWASP Top 10.
ðĶ Installation
# Global install
npm install -g tubemind-secure-mcp
# Or run on demand
npx tubemind-secure-mcpRequires Node.js âĨ 20.
ð OAuth Setup (one-time)
YouTube APIs need an OAuth2 token. The package ships with an auth server that walks you through it.
1) Create OAuth credentials in Google Cloud
Go to Google Cloud Console â APIs & Services â Credentials
Enable YouTube Data API v3 and YouTube Analytics API
Create OAuth 2.0 Client ID â Web application
Authorized redirect URI:
http://localhost:4000/oauth/callbackCopy the Client ID and Client Secret
2) Configure environment
Copy .env.example to .env and fill in:
YOUTUBE_CLIENT_ID=your-client-id.apps.googleusercontent.com
YOUTUBE_CLIENT_SECRET=your-client-secret
YOUTUBE_REDIRECT_URI=http://localhost:4000/oauth/callback
# Generate with: openssl rand -hex 32
TOKEN_ENCRYPTION_KEY=your-64-char-hex-key
RATE_LIMIT_PER_MINUTE=60
REQUEST_TIMEOUT_MS=10000
AUDIT_LOG_PATH=./logs/audit.log
NODE_ENV=production3) Run the OAuth flow
pnpm auth
# or: npx tsx --env-file=.env src/auth-server.tsOpen http://localhost:4000, sign in with the Google account that owns the channel (Brand Accounts supported), authorize, and the encrypted token is saved to ./tokens/youtube.token.json.
ðĪ Use with Claude Desktop
Add to claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"tubemind": {
"command": "npx",
"args": ["-y", "tubemind-secure-mcp"],
"env": {
"YOUTUBE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"YOUTUBE_CLIENT_SECRET": "your-client-secret",
"YOUTUBE_REDIRECT_URI": "http://localhost:4000/oauth/callback",
"TOKEN_ENCRYPTION_KEY": "your-64-char-hex-key",
"RATE_LIMIT_PER_MINUTE": "60",
"REQUEST_TIMEOUT_MS": "10000",
"AUDIT_LOG_PATH": "./logs/audit.log",
"NODE_ENV": "production"
}
}
}
}Restart Claude Desktop. The 18 tools will appear automatically.
ð ïļ Tools
Category | Tool | Description |
Search |
| Discover trending topics by region/category |
| Search volume signals for keywords | |
| Tag recommendations from a seed | |
Video |
| Read tags from a video |
| Update title/description/tags (write scope) | |
| Paginate channel uploads | |
Analytics |
| Views, watch time, retention (Analytics API) |
| Best day/hour heatmap to publish | |
Benchmark |
| Compare channel vs. peers |
Heuristics |
| Difficulty score 0â100 |
| Common patterns in top videos | |
| Topics competitors cover that you don't | |
Heuristics+ |
| CTR estimate from title/thumbnail signals |
| Hook angles for a topic | |
| Rising-momentum keywords | |
| Retention-shaping factors | |
| N-day content plan | |
Competitor |
| Top videos from a competitor channel |
All inputs are validated with Zod. All errors return safe messages (stack traces only when NODE_ENV=development).
ð Security
tubemind-secure-mcp is built secure-by-default. See SECURITY.md for the full posture mapped to OWASP Top 10.
Control | Implementation |
A01 â Broken Access Control | OAuth2 scopes least-privilege, audit log per call |
A02 â Cryptographic Failures | AES-256-GCM at rest for tokens, secrets via env only |
A03 â Injection | Zod schemas on every tool input |
A04 â Insecure Design | Rate limit, request timeout, SSRF guard (host whitelist) |
A05 â Misconfiguration |
|
A07 â AuthN Failures | OAuth2 PKCE-style flow, encrypted token storage |
A08 â Software/Data Integrity | Pinned deps, |
A09 â Logging Failures | Audit log of every tool call (timestamp, tool, success) |
A10 â SSRF | Outbound calls restricted to |
Found a vulnerability? Email wleandro.oliveira@gmail.com â 72h response.
ð§° Local development
pnpm install
pnpm dev # tsx watch on src/index.ts
pnpm build # tsc â dist/
pnpm typecheck
pnpm test
pnpm audit:securityð License
MIT ÂĐ Wanderson Leandro de Oliveira / Dewtech