Labsco
kyong0612 logo

YouTube Transcript MCP Server

β˜… 4

from kyong0612

A high-performance MCP server for fetching YouTube video transcripts, with support for caching, rate limiting, and proxy rotation.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

YouTube Transcript MCP Server

Go Version License: MIT CI

A high-performance Model Context Protocol (MCP) server for fetching YouTube video transcripts, implemented in Go.

🎬 Demo

Demo GIF coming soon. A short screen recording showing transcript fetching from an MCP client will be added here.

πŸ“¦ MCP Registry & Distribution

  • Registries: This server is being prepared for discovery via MCP registries such as the MCP Registry and Smithery. The registry manifest is added in a separate PR.
  • Prebuilt binaries & Docker image: Cross-platform binaries and a container image will be published after the first GitHub release is tagged. Until then, install via go install (above) or build from source (see the Installation section below).

πŸš€ Features

  • MCP Protocol 2024-11-05 Compliant: Full implementation of the Model Context Protocol
  • 5 Powerful Tools:
    • get_transcript: Fetch transcript for a single video
    • get_multiple_transcripts: Batch process multiple videos
    • translate_transcript: Fetch captions in the specified language (including YouTube's auto-translated captions when available). This does not machine-translate arbitrary text.
    • format_transcript: Format transcripts (plain text, SRT, VTT, etc.)
    • list_available_languages: List available subtitle languages
  • High Performance: Built with Go for speed and efficiency
  • Caching: In-memory cache implemented (Redis is planned/not yet implemented; CACHE_TYPE=redis currently falls back to the memory cache)
  • Rate Limiting: Protect against YouTube API limits
  • Proxy Support: Rotate through multiple proxies
  • Docker Ready: Easy deployment with Docker Compose
  • Monitoring: Built-in health checks (Prometheus metrics are planned/not yet implemented)

πŸ§ͺ Development

Running Tests

# Run all tests
make test

# Run with coverage
make test-coverage

# Run benchmarks
make benchmark

Code Quality

# Format code
make fmt

# Run linter
make lint

# Security scan
make security

Hot Reload Development

# Install air for hot reload
go install github.com/air-verse/air@latest

# Run with hot reload
make dev

πŸ“Š Monitoring

Health Check

curl http://localhost:8080/health

Readiness Check

curl http://localhost:8080/ready

Metrics

Note: Prometheus metrics are planned/not yet implemented. The /metrics endpoint currently returns a placeholder (# TODO: Implement Prometheus metrics) along with basic request stats.

curl http://localhost:9090/metrics

πŸ”’ Security

  • API Key Authentication: Set SECURITY_ENABLE_AUTH=true and configure API keys
  • Rate Limiting: Configurable per-IP rate limiting
  • IP Whitelisting/Blacklisting: Control access by IP address
  • CORS: Configurable CORS policies

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

⚠️ Disclaimer

This tool is for educational and research purposes. Please respect YouTube's Terms of Service and copyright laws when using transcripts.