npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

pentestic-youtube

v0.2.2

Published

MCP server with YouTube transcripts, FREE multi-language translation, and AgentFold analysis

Downloads

9

Readme

Pentestic YouTube - MCP Server

A Model Context Protocol (MCP) server that enables retrieval of transcripts from YouTube videos. This server provides direct access to video captions and subtitles through a simple interface.

Features

  • 🎥 Extract transcripts from YouTube videos
  • 🌍 Multi-language support
  • 🔗 Support for multiple URL formats (youtube.com, youtu.be, direct video ID)
  • 📊 Detailed metadata in responses
  • ⚡ Built with TypeScript for type safety
  • 🛡️ Robust error handling

Prerequisites

  • Node.js 18 or higher
  • npm or yarn

Installation

Local Development

  1. Navigate to the project:
cd /home/pentestic/CascadeProjects/pentestic-youtube
  1. Install dependencies:
npm install
  1. Build the server:
npm run build

For Development with Auto-rebuild

npm run watch

Configuration

Claude Desktop

To use with Claude Desktop, add this server configuration to your claude_desktop_config.json:

{
  "mcpServers": {
    "pentestic-youtube": {
      "command": "node",
      "args": ["/home/pentestic/CascadeProjects/pentestic-youtube/dist/index.js"]
    }
  }
}

Tools

get_transcript

Extract transcripts from YouTube videos.

Parameters:

  • url (string, required): YouTube video URL or video ID
    • Supports: https://www.youtube.com/watch?v=VIDEO_ID
    • Supports: https://youtu.be/VIDEO_ID
    • Supports: Direct video ID (11 characters)
  • lang (string, optional, default: "en"): Language code for transcript
    • Examples: 'en', 'ko', 'es', 'fr', 'de', 'ja', etc.

Response:

  • Transcript text
  • Metadata:
    • videoId: Extracted video ID
    • language: Language code used
    • timestamp: ISO timestamp of extraction
    • charCount: Character count of transcript

Usage Examples

Example 1: Get English transcript by URL

await server.callTool("get_transcript", {
  url: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  lang: "en"
});

Example 2: Get Korean transcript by video ID

await server.callTool("get_transcript", {
  url: "dQw4w9WgXcQ",
  lang: "ko"
});

Example 3: Using with Claude Desktop

Extract subtitles from https://youtu.be/dQw4w9WgXcQ

Development

Project Structure

pentestic-youtube/
├── src/
│   └── index.ts          # Main server implementation
├── dist/                 # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
└── README.md

Testing with MCP Inspector

npm run inspector

The MCP Inspector provides a web interface for testing your MCP server during development.

Error Handling

The server implements comprehensive error handling for:

  • ❌ Invalid video URLs or IDs
  • ❌ Unavailable transcripts
  • ❌ Language availability issues
  • ❌ Network errors
  • ❌ Invalid parameters

All errors include descriptive messages to help with troubleshooting.

Security Considerations

  • ✅ Validates all input parameters
  • ✅ Handles YouTube API errors gracefully
  • ✅ Provides detailed error messages
  • ✅ No API keys required (uses public captions)

Architecture

Components

  1. YouTubeTranscriptExtractor

    • Extracts video IDs from various URL formats
    • Retrieves transcripts using youtube-captions-scraper
    • Formats transcript data
  2. TranscriptServer

    • Implements MCP server protocol
    • Handles tool registration and execution
    • Manages error handling and lifecycle

Technology Stack

  • Runtime: Node.js 18+
  • Language: TypeScript 5.6+
  • Framework: Model Context Protocol SDK 0.6.0
  • Library: youtube-captions-scraper 2.0.3

Troubleshooting

Common Issues

Issue: "Failed to retrieve transcript"

  • Solution: Check if the video has captions available
  • Solution: Try a different language code

Issue: "Invalid YouTube video ID"

  • Solution: Ensure the URL is correct and the video exists
  • Solution: Check if the video is public

Issue: Server not responding

  • Solution: Check if the server is built (npm run build)
  • Solution: Verify Node.js version (18+)

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

Based on the original work by kimtaeyoon83/mcp-server-youtube-transcript