Secure MCP server for YouTube intelligence — 18 tools, OAuth2, OWASP Top 10 controls.
Turn Claude into a YouTube growth strategist — without ever handing it your raw OAuth tokens.
@modelcontextprotocol/sdk, googleapis, zod). Node ≥ 20.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:
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.
# Global install
npm install -g tubemind-secure-mcp
# Or run on demand
npx tubemind-secure-mcp
Requires Node.js ≥ 20.
YouTube APIs need an OAuth2 token. The package ships with an auth server that walks you through it.
http://localhost:4000/oauth/callbackCopy .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=production
pnpm auth
# or: npx tsx --env-file=.env src/auth-server.ts
Open 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.
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.
| Category | Tool | Description |
|---|---|---|
| Search | search_trending_topics | Discover trending topics by region/category |
get_keyword_stats | Search volume signals for keywords | |
suggest_tags | Tag recommendations from a seed | |
| Video | get_video_tags | Read tags from a video |
update_video_metadata | Update title/description/tags (write scope) | |
list_channel_videos | Paginate channel uploads | |
| Analytics | get_channel_analytics | Views, watch time, retention (Analytics API) |
score_best_publish_window | Best day/hour heatmap to publish | |
| Benchmark | benchmark_channel | Compare channel vs. peers |
| Heuristics | estimate_keyword_difficulty | Difficulty score 0–100 |
analyze_title_patterns | Common patterns in top videos | |
detect_content_gaps | Topics competitors cover that you don't | |
| Heuristics+ | estimate_ctr_potential | CTR estimate from title/thumbnail signals |
suggest_hook_angles | Hook angles for a topic | |
find_trending_keywords | Rising-momentum keywords | |
analyze_retention_signals | Retention-shaping factors | |
generate_content_calendar | N-day content plan | |
| Competitor | get_competitor_videos | Top videos from a competitor channel |
All inputs are validated with Zod. All errors return safe messages (stack traces only when NODE_ENV=development).
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 | .env.example template, no defaults that leak |
| A07 — AuthN Failures | OAuth2 PKCE-style flow, encrypted token storage |
| A08 — Software/Data Integrity | Pinned deps, pnpm audit in CI, dependabot |
| A09 — Logging Failures | Audit log of every tool call (timestamp, tool, success) |
| A10 — SSRF | Outbound calls restricted to googleapis.com family |
Found a vulnerability? Email wleandro.oliveira@gmail.com — 72h response.
pnpm install
pnpm dev # tsx watch on src/index.ts
pnpm build # tsc → dist/
pnpm typecheck
pnpm test
pnpm audit:security
MIT © Wanderson Leandro de Oliveira / Dewtech
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
npx -y tubemind-secure-mcpMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-dewtech-technologies-tubemind-secure-mcp": {
"command": "npx",
"args": [
"-y",
"tubemind-secure-mcp"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referencetubemind-secure-mcpnpmio.github.dewtech-technologies/tubemind-secure-mcp works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.