YouTube Info MCP Server

MCP浏览器工具

提供方 Limecooler

浏览器工具 未标注 无需鉴权 社区 / 第三方

Extracts YouTube video metadata and transcripts without requiring API keys, enabling users to retrieve video information, captions, and timestamps through web scraping with built-in caching and error handling.

一句话选型结论

按资料字段整理

YouTube Info MCP Server 属于浏览器工具类 MCP 服务器,传输方式未标注,无需鉴权,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类浏览器工具 传输方式未标注 鉴权无需鉴权 部署方式支持远程部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

浏览器工具
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

安装与配置

未标注 无需鉴权
上游未给出传输方式
  1. 1
    准备运行环境

    确认你的客户端支持远程端点,并拿到服务地址。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
自动操作网页

打开页面、点击、填表,把浏览器动作交给模型执行。

抓取结构化数据

把页面内容整理成表格或 JSON,省掉手工复制粘贴。

关键流程回归

按步骤检查页面是否正常,回归时少漏环节。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注无需鉴权,装好就能连。

先想清楚的地方

  • 远程端点依赖网络与服务方可用性,注意密钥与调用额度。
  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在浏览器工具场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
YouTube Info MCP Server当前 未标注 未标注 支持远程部署 无 2026-05-17
Playwright MCP Server 21 stdio · 本地进程 本地部署 有 2026-05-18
Fetch 9a2682de 1 SSE · 服务端推送 支持远程部署 有 2026-05-18
Browser 738d52bc 未标注 stdio · 本地进程 本地部署 有 2026-05-17
MCP 40600ece 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Skyvern MCP 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

浏览器工具
字段来自项目仓库与公开索引,中文说明由本站标注
提供方Limecooler上游标注的维护方 Limecooler
分类浏览器工具本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式无需鉴权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型支持远程部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

14.7 KB
来自项目仓库与上游目录的原文,未做删改

YouTube Info MCP Server

A lightweight MCP server that extracts YouTube video metadata and transcripts through web scraping, featuring robust error handling, caching, and retry logic without requiring API keys or external dependencies.

Table of Contents

  • 🚀 Quick Start
  • Prerequisites
  • Features
  • How It Works
  • Comparison with Alternatives
  • Installation
  • Claude Desktop Configuration
  • Claude Code Configuration
  • Usage
  • API Reference
  • Response Format
  • Error Handling
  • Development
  • Troubleshooting
  • Environment Variables
  • Performance
  • Security
  • Limitations
  • Contributing
  • Built with Claude Code
  • Changelog
  • License

🚀 Quick Start```bash

npx @limecooler/yt-info-mcp


That's it! No installation required.

## Prerequisites

- **Node.js**: Version 18.0.0 or higher
- **npm**: Version 9.0.0 or higher (for global installation)
- **Operating System**: Windows, macOS, or Linux

## Features

- Fetches video metadata (title, author, duration, views, description)
- Downloads available transcripts/captions
- No API key required
- No external dependencies (like yt-dlp)
- Fast startup time for Claude Desktop integration
- Comprehensive error handling with specific error codes
- Input validation using Zod schemas
- Retry logic with exponential backoff for network resilience
- In-memory caching for improved performance
- Debug logging support (set `MCP_DEBUG=true`)
- TypeScript with full type safety

## How It Works

This MCP server uses YouTube's InnerTube API (the same API used by YouTube's mobile apps) to reliably fetch video data:

1. **Page Fetch**: Retrieves the YouTube video page HTML
2. **API Key Extraction**: Extracts the `INNERTUBE_API_KEY` from the page source
3. **InnerTube Request**: Makes an authenticated POST request to `/youtubei/v1/player`
4. **Android Context**: Uses Android client context (`clientName: "ANDROID"`) for better transcript access
5. **Fallback Strategy**: Falls back to HTML scraping if InnerTube fails

This approach is more reliable than direct caption URL fetching because it mimics how YouTube's official apps retrieve data.

## Comparison with Alternatives

| Feature | yt-info-mcp | yt-dlp | youtube-dl | YouTube API |
|---------|-------------|--------|------------|-------------|
| No API Key Required | ✅ | ✅ | ✅ | ❌ |
| Transcript Support | ✅ | ✅ | ✅ | ✅ |
| Lightweight (<10MB) | ✅ | ❌ | ❌ | ✅ |
| MCP Protocol | ✅ | ❌ | ❌ | ❌ |
| No Python Required | ✅ | ❌ | ❌ | ✅ |
| TypeScript/JavaScript | ✅ | ❌ | ❌ | ✅ |
| Caching Built-in | ✅ | ❌ | ❌ | ❌ |

## Installation

> **Note**: Installation is not necessary if you're using this with Claude Desktop or Claude Code. See Claude Desktop Configuration or Claude Code Configuration below.

### Option 1: Direct Usage with npx (Recommended)

No installation needed! You can run the server directly using npx:```bash
npx @limecooler/yt-info-mcp

Option 2: Install from npm```bash

npm install -g @limecooler/yt-info-mcp


### Option 3: Local Installation

1. Clone this repository:```bash
git clone https://github.com/Limecooler/yt-video-info.git
cd yt-video-info
  1. Install dependencies:```bash
    npm install

3. Build the TypeScript code:```bash
npm run build

Claude Desktop Configuration

Add the following to your Claude Desktop configuration file:

Configuration File Locations

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Option 1: Using npx (Recommended - No Installation Required)```json

{
"mcpServers": {
"youtube-info": {
"command": "npx",
"args": ["-y", "@limecooler/yt-info-mcp@latest"]
}
}
}


### Option 2: Local Installation```json
{
  "mcpServers": {
    "youtube-info": {
      "command": "node",
      "args": ["/absolute/path/to/yt-video-info/dist/index.js"]
    }
  }
}

Claude Code Configuration

To use this MCP server with Claude Code:

Option 1: Quick Setup Using CLI (Recommended)

Simply run this command in your terminal:```bash
claude mcp add yt-info-mcp -s user -- npx -y @limecooler/yt-info-mcp@latest


This automatically adds the YouTube Info MCP server to your global Claude Code configuration.

### Option 2: Manual Global Configuration

Add to your global Claude Code configuration file:

**Configuration File Locations:**
- **macOS/Linux**: `~/.claude/config.json`
- **Windows**: `%USERPROFILE%\.claude\config.json````json
{
  "mcpServers": {
    "youtube-info": {
      "command": "npx",
      "args": ["-y", "@limecooler/yt-info-mcp@latest"]
    }
  }
}

This makes the YouTube Info MCP server available in all your Claude Code sessions.

Option 3: Project-Specific Configuration

Add to your Claude Code project configuration (.claude/project.json):```json
{
"mcpServers": {
"youtube-info": {
"command": "npx",
"args": ["-y", "@limecooler/yt-info-mcp@latest"]
}
}
}


### Option 4: Local Installation

If you've cloned the repository locally:```json
{
  "mcpServers": {
    "youtube-info": {
      "command": "node",
      "args": ["./path/to/yt-video-info/dist/index.js"]
    }
  }
}

Once configured, you can use the tool in Claude Code:```
User: Get information about YouTube video dQw4w9WgXcQ

Claude Code: I'll fetch the video information using the YouTube Info MCP server.
[Uses the MCP tool to retrieve video metadata and transcript]


## Usage

### Using with Claude Desktop

Once configured, you can use the tool in Claude Desktop:```
Please get information from YouTube video dQw4w9WgXcQ

Using from npm (Command Line)

If you installed globally via npm:```bash

Run the MCP server directly

yt-info-mcp

Or use with a tool that supports MCP

npx @modelcontextprotocol/cli connect yt-info-mcp


### Using as a Library```javascript
import { fetchVideoInfo, fetchTranscript } from '@limecooler/yt-info-mcp';

// Get video information
const { metadata, captionTracks } = await fetchVideoInfo('dQw4w9WgXcQ');

// Fetch transcript if available
if (captionTracks.length > 0) {
  const transcript = await fetchTranscript(captionTracks[0]);
}

The tool will return:
- Video metadata (title, author, duration, view count, description)
- Transcript with timestamps (if available)
- Error details if the video is unavailable or has no transcript

API Reference

fetchVideoInfo(videoId: string)

Fetches video metadata and available caption tracks.

Parameters:
- videoId (string): The 11-character YouTube video ID

Returns: Promise<{ metadata: VideoMetadata; captionTracks: CaptionTrack[] }>
- metadata: Object containing video information
- title (string): Video title
- author (string): Channel name
- lengthSeconds (number): Duration in seconds
- viewCount (number): View count
- description (string): Video description
- captionTracks: Array of available caption tracks
- baseUrl (string): URL to fetch the transcript
- languageCode (string): Language code (e.g., "en", "es")

Throws: YouTubeError with specific error codes:
- INVALID_ID: Invalid video ID format
- NOT_FOUND: Video doesn't exist
- PRIVATE: Video is private
- AGE_RESTRICTED: Age-restricted content
- REGION_BLOCKED: Region-blocked content

fetchTranscript(captionTrack: CaptionTrack)

Fetches and parses transcript for a given caption track.

Parameters:
- captionTrack (CaptionTrack): Caption track object from fetchVideoInfo

Returns: Promise
- text (string): Full transcript text
- segments (array): Array of transcript segments
- start (number): Start time in seconds
- text (string): Segment text

Example with Error Handling:```javascript
try {
const { metadata, captionTracks } = await fetchVideoInfo('dQw4w9WgXcQ');

if (captionTracks.length > 0) {
const transcript = await fetchTranscript(captionTracks[0]);
console.log(transcript.text);
}
} catch (error) {
if (error.code === 'PRIVATE') {
console.log('This video is private');
}
}


## Response Format```json
{
  "metadata": {
    "title": "Video Title",
    "author": "Channel Name",
    "lengthSeconds": 215,
    "viewCount": 1234567,
    "description": "Video description..."
  },
  "transcript": {
    "text": "Full transcript text...",
    "segments": [
      {
        "start": 0.0,
        "text": "First segment"
      },
      {
        "start": 2.5,
        "text": "Second segment"
      }
    ]
  },
  "error": "Error message if transcript unavailable"
}

Error Handling

The server handles various error cases:
- Invalid video ID format
- Video not found (404)
- Private or age-restricted videos
- Videos without transcripts
- Network errors

Development

Run in development mode with auto-reload:```bash
npm run dev


### Testing

Run comprehensive tests:```bash
npm test

Test MCP protocol communication:```bash
npm run test:mcp


Enable debug logging:```bash
MCP_DEBUG=true npm start

Troubleshooting

Common Issues

"Command not found" after npm install

Solution: Add npm global bin directory to your PATH or use npx:```bash

Check npm bin location

npm bin -g

Or just use npx

npx @limecooler/yt-info-mcp


#### Empty transcript responses
**Possible causes:**
- Video doesn't have captions enabled
- Video is region-restricted in your area
- YouTube is rate-limiting your requests

**Solution**: Check if the video has the "CC" button on YouTube's website.

#### "INVALID_ID" error
**Solution**: Ensure the video ID is exactly 11 characters. Extract it from the URL:
- ✅ Correct: `dQw4w9WgXcQ`
- ❌ Wrong: `https://youtube.com/watch?v=dQw4w9WgXcQ`

#### Connection refused in Claude Desktop
**Solution**: Make sure the configuration path is absolute, not relative:```json
{
  "mcpServers": {
    "youtube-info": {
      "command": "node",
      "args": ["/Users/username/yt-video-info/dist/index.js"]  // Full path
    }
  }
}

Rate limiting errors

Solution: Implement delays between requests or use the built-in caching:```javascript
// Videos are cached for 1 hour, transcripts for 2 hours
await fetchVideoInfo('video1');
// Second call uses cache
await fetchVideoInfo('video1');


## Environment Variables

| Variable | Description | Default | Example |
|----------|-------------|---------|---------|
| `MCP_DEBUG` | Enable debug logging to stderr | `false` | `MCP_DEBUG=true` |
| `DEBUG` | Alternative debug flag | `false` | `DEBUG=true` |
| `NODE_ENV` | Environment mode | `production` | `NODE_ENV=development` |

## Performance

- **Startup Time**: <500ms (measured on M1 MacBook Air)
- **Memory Usage**: ~50MB idle, ~100MB during active requests
- **Cache TTL**: Video info (1 hour), Transcripts (2 hours)
- **Response Time**:
  - Cached: <100ms
  - Fresh fetch: 2-4s (depends on YouTube's response time)
- **Concurrent Requests**: Limited by Node.js event loop

## Security

### Security Considerations

- **No credentials**: No API keys or authentication tokens required or stored
- **Read-only**: Only performs GET/POST requests to retrieve public data
- **No user data**: Doesn't collect or transmit any user information
- **Content filtering**: Respects YouTube's age restrictions and privacy settings
- **Safe dependencies**: Minimal dependencies, all from trusted sources
- **Input validation**: All inputs validated with Zod schemas

### Best Practices

- Run in isolated environment if processing untrusted video IDs
- Monitor rate limits to avoid IP blocking
- Use environment variables for configuration, not hardcoded values

## Limitations
- Relies on YouTube's web interface structure, which may change
- Cannot transcribe audio - only downloads existing captions
- May be rate-limited by YouTube if used excessively
- Age-restricted or private videos cannot be accessed

## Contributing

We welcome contributions! Here's how you can help:

### Getting Started

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

### Development Guidelines

- Follow existing code style and conventions
- Add tests for new features
- Update documentation as needed
- Keep commits focused and descriptive
- Ensure all tests pass before submitting PR

### Reporting Issues

- Check existing issues before creating new ones
- Include steps to reproduce bugs
- Provide system information (Node.js version, OS)
- Include relevant error messages and logs

## Built with Claude Code

This entire project was developed using Claude Code, Anthropic's AI-powered coding assistant. Claude Code enables rapid development with built-in best practices and comprehensive testing.

### Making Changes with Claude Code

To contribute or modify this repository using Claude Code:

1. **Install Claude Code** (if you haven't already):```bash
   npm install -g @anthropic-ai/claude-code
   ```

2. **Clone and open the repository**:```bash
   git clone https://github.com/Limecooler/yt-video-info.git
   cd yt-video-info
   claude-code
   ```

3. **Ask Claude Code to make changes**:
   - "Add support for playlist extraction"
   - "Improve error handling for rate limiting"
   - "Add unit tests for the scraper module"
   - "Update the InnerTube API implementation"

4. **Claude Code will**:
   - Understand the existing codebase structure
   - Follow the established patterns and conventions
   - Run tests to ensure changes don't break functionality
   - Update documentation as needed
   - Commit changes with descriptive messages

### Why Claude Code?

- **Context-aware**: Understands the entire codebase and maintains consistency
- **Best practices**: Automatically follows TypeScript, MCP, and npm conventions
- **Test-driven**: Ensures changes are tested and documented
- **Efficient**: Reduces development time from hours to minutes

### Example Claude Code Session```
You: "Add a feature to download video thumbnails"

Claude Code: I'll add thumbnail download functionality to the MCP server.
[Claude Code analyzes the codebase, implements the feature, adds tests,
updates types, and creates a commit]

You: "Now add documentation for the new feature"

Claude Code: I'll update the README and add inline documentation.
[Updates all relevant documentation files]

Changelog

See Releases for a detailed version history.

Latest Version: v1.1.1

  • 🔧 Fixed executable permissions for npx compatibility
  • 🐛 Resolved Claude Code connection error (MCP error -32000)
  • 📚 Added simple Claude Code CLI setup command

v1.1.0

  • 🐛 Fixed transcript fetching using YouTube's InnerTube API
  • ✨ Added Android client context for better reliability
  • 📚 Improved documentation with badges and better structure

License

MIT

常见问题

7 问
答案由本站依据条目字段整理,不引用上游原文
YouTube Info MCP Server 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

YouTube Info MCP Server 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

YouTube Info MCP Server 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

YouTube Info MCP Server 需要 API Key 吗?

资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

YouTube Info MCP Server 能提供哪些能力?

资料显示能力标签包括 浏览器自动化、网页抓取、HTML。具体工具清单以官方文档为准。

YouTube Info MCP Server 需要什么运行环境?

属于远程端点,不需要在本地装运行时。

YouTube Info MCP Server 是本地还是远程?

它是远程端点,连服务地址即可。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。