Skip to content

Conversation

@MarsZDF
Copy link
Contributor

@MarsZDF MarsZDF commented Oct 11, 2025

Summary

  • Add comprehensive YouTube Data API v3 MCP connector with 7 essential tools
  • Support for video search, channel management, playlist operations, and trending content
  • Robust TypeScript interfaces and comprehensive test coverage

Key Features

  • Search capabilities: Advanced video and channel search with filtering options
  • Content details: Retrieve detailed information for videos, channels, and playlists
  • Trending content: Access region-specific popular videos
  • Playlist management: Browse playlist contents with pagination support
  • Rate limiting awareness: Built-in understanding of YouTube API quotas (10,000 units/day)

Tools Included

  1. SEARCH_VIDEOS - Advanced video search with filters (order, date range, region, etc.)
  2. SEARCH_CHANNELS - Channel discovery and search
  3. GET_VIDEO_DETAILS - Detailed video information including statistics
  4. GET_CHANNEL_DETAILS - Channel information and statistics
  5. GET_PLAYLIST_DETAILS - Playlist metadata and information
  6. GET_PLAYLIST_ITEMS - Browse playlist contents with pagination
  7. GET_POPULAR_VIDEOS - Region-specific trending videos

Technical Implementation

  • Authentication: Simple API key-based auth (no OAuth complexity)
  • Type Safety: Comprehensive TypeScript interfaces for all API responses
  • Error Handling: Robust error handling following repository patterns
  • Testing: 19 comprehensive tests with MSW mocking (100% passing)
  • Code Quality: Passes all lint checks, follows repository style guide

Test Plan

  • All 19 tests passing with comprehensive MSW mocking
  • TypeScript compilation successful
  • Biome lint checks passing
  • Code formatting consistent with repository standards
  • Proper integration in index.ts exports

🤖 Generated with Claude Code


Summary by cubic

Adds a YouTube Data API v3 MCP connector with seven tools for search, details, playlists, and trending videos. This enables YouTube queries via MCP with strong typing, pagination, and robust error handling.

  • New Features

    • 7 tools: search videos/channels; get video/channel/playlist details; list playlist items; get most popular videos
    • Advanced filters (order, duration, definition, dates, region) and pagination support
    • Comprehensive TypeScript interfaces and consistent error handling
    • Added YouTubeConnectorConfig to connectors registry and exports
    • 19 MSW-backed tests; TS and lint pass
  • Migration

    • Provide a YouTube Data API v3 key in connector credentials (apiKey) to enable the tools

- Add comprehensive YouTube connector with 7 tools covering major use cases
- Support video/channel search, detailed info, playlists, and trending content
- Implement proper rate limiting awareness (10,000 units/day quota)
- Include robust TypeScript interfaces for all YouTube API responses
- Add comprehensive test suite with MSW mocking (19 tests)
- Follow repository patterns for error handling and credential management

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="packages/mcp-connectors/src/connectors/youtube.ts">

<violation number="1" location="packages/mcp-connectors/src/connectors/youtube.ts:505">
The schema for GET_CHANNEL_DETAILS allows both `channelIds` and `username` to be omitted, but the YouTube API requires at least one identifier; this can cause guaranteed runtime API errors.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

description: 'Get detailed information about specific channels',
schema: z.object({
channelIds: z.array(z.string()).optional().describe('Array of channel IDs'),
username: z.string().optional().describe('Channel username (alternative to IDs)'),
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The schema for GET_CHANNEL_DETAILS allows both channelIds and username to be omitted, but the YouTube API requires at least one identifier; this can cause guaranteed runtime API errors.

Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/youtube.ts at line 505:

<comment>The schema for GET_CHANNEL_DETAILS allows both `channelIds` and `username` to be omitted, but the YouTube API requires at least one identifier; this can cause guaranteed runtime API errors.</comment>

<file context>
@@ -0,0 +1,606 @@
+      description: &#39;Get detailed information about specific channels&#39;,
+      schema: z.object({
+        channelIds: z.array(z.string()).optional().describe(&#39;Array of channel IDs&#39;),
+        username: z.string().optional().describe(&#39;Channel username (alternative to IDs)&#39;),
+        includeParts: z
+          .array(z.enum([&#39;snippet&#39;, &#39;statistics&#39;, &#39;contentDetails&#39;, &#39;brandingSettings&#39;]))
</file context>
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant