YouTube Watch Later MCP Server

by rados10

Recommended
4 stars
1 downloads
Not rated
GitHub

About

Enables secure access to your YouTube Watch Later playlist, allowing retrieval of video URLs added within a specified timeframe through a simple interface using OAuth2 authentication.

Details

Author
rados10
Repository
rados10/youtube-watchlater-mcp
GitHub stars
4
Downloads
1
License
MIT License
Categories
Media, Developer Tools

- Get URLs of videos added to a custom playlist within a configurable number of days
- Simple interface that returns just the video URLs
- OAuth2 authentication for secure access to your YouTube data

Setting up with Highlight

Follow these steps to add this server as a custom Highlight plugin:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name YouTube Watch Later MCP Server
    Command (node, npx, python, etc.) node
    Arguments
    • Argument 1 /path/to/youtube-watchlater/build/index.js
    Environment
    • OAUTH_CLIENT_ID your_client_id
    • OAUTH_CLIENT_SECRET your_client_secret
    • OAUTH_REFRESH_TOKEN your_refresh_token

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

The server provides a single tool get_watch_later_urls that accepts an optional daysBack parameter:

// Get videos added in the last day (default)
{ "daysBack": 1 }

// Get videos added in the last week
{ "daysBack": 7 }

The server will return an array of YouTube URLs for the matching videos:

[
  "https://youtube.com/watch?v=video1",
  "https://youtube.com/watch?v=video2",
  ...
]

To install YouTube Watch Later for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install youtube-watchlater --client claude

1. Clone this repository:

git clone https://github.com/rados10/youtube-watchlater-mcp.git
cd youtube-watchlater

2. Install dependencies:

npm install

3. Build the project:

npm run build

Add the server configuration to your MCP settings file:

For VSCode (Claude Dev Extension):
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

For Claude Desktop App:
~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "youtube-watchlater": {
      "command": "node",
      "args": ["/path/to/youtube-watchlater/build/index.js"],
      "env": {
        "OAUTH_CLIENT_ID": "your_client_id",
        "OAUTH_CLIENT_SECRET": "your_client_secret",
        "OAUTH_REFRESH_TOKEN": "your_refresh_token"
      }
    }
  }
}

get_watch_later_urls

Retrieve URLs of videos added to the specified playlist within a configurable number of days. Parameters: daysBack (optional integer, default is 1).

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "youtube watch later mcp server": {
            "env": {
                "OAUTH_CLIENT_ID": "your_client_id",
                "OAUTH_CLIENT_SECRET": "your_client_secret",
                "OAUTH_REFRESH_TOKEN": "your_refresh_token"
            },
            "args": [
                "/path/to/youtube-watchlater/build/index.js"
            ],
            "command": "node"
        }
    }
}

Linux

{
    "env": {
        "OAUTH_CLIENT_ID": "your_client_id",
        "OAUTH_CLIENT_SECRET": "your_client_secret",
        "OAUTH_REFRESH_TOKEN": "your_refresh_token"
    },
    "args": [
        "/path/to/youtube-watchlater/build/index.js"
    ],
    "command": "node"
}

Macos

{
    "env": {
        "OAUTH_CLIENT_ID": "your_client_id",
        "OAUTH_CLIENT_SECRET": "your_client_secret",
        "OAUTH_REFRESH_TOKEN": "your_refresh_token"
    },
    "args": [
        "/path/to/youtube-watchlater/build/index.js"
    ],
    "command": "node"
}

Windows

{
    "env": {
        "OAUTH_CLIENT_ID": "your_client_id",
        "OAUTH_CLIENT_SECRET": "your_client_secret",
        "OAUTH_REFRESH_TOKEN": "your_refresh_token"
    },
    "args": [
        "/path/to/youtube-watchlater/build/index.js"
    ],
    "command": "node"
}

YouTube Watch Later MCP Server

smithery badge

A Model Context Protocol (MCP) server that provides access to a custom YouTube playlist. The server exposes a simple tool to retrieve URLs of videos added to the specified playlist within a specified timeframe.

Features

- Get URLs of videos added to a custom playlist within a configurable number of days
- Simple interface that returns just the video URLs
- OAuth2 authentication for secure access to your YouTube data

Installation

Installing via Smithery

To install YouTube Watch Later for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install youtube-watchlater --client claude

Manual Installation

1. Clone this repository:
git clone https://github.com/rados10/youtube-watchlater-mcp.git
cd youtube-watchlater

2. Install dependencies:

npm install

3. Build the project:

npm run build

Setup

1. Create Google Cloud Project

1. Go to Google Cloud Console
2. Create a new project or select an existing one
3. Enable the YouTube Data API v3
4. Go to Credentials → Create Credentials → OAuth 2.0 Client ID
5. Set Application Type to "Web application"
6. Add "http://localhost:3000/oauth2callback" to Authorized redirect URIs
7. Copy your Client ID and Client Secret

2. Get Refresh Token

Run the provided script with your Google Cloud credentials:

OAUTH_CLIENT_ID="your_client_id" OAUTH_CLIENT_SECRET="your_client_secret" node get-refresh-token.js

The script will:
- Open your default browser to the Google authorization page
- Ask you to sign in and authorize the application
- Display your refresh token in the terminal

3. Configure MCP Settings

Add the server configuration to your MCP settings file:

For VSCode (Claude Dev Extension):
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json

For Claude Desktop App:
~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "youtube-watchlater": {
      "command": "node",
      "args": ["/path/to/youtube-watchlater/build/index.js"],
      "env": {
        "OAUTH_CLIENT_ID": "your_client_id",
        "OAUTH_CLIENT_SECRET": "your_client_secret",
        "OAUTH_REFRESH_TOKEN": "your_refresh_token"
      }
    }
  }
}

Usage

The server provides a single tool get_watch_later_urls that accepts an optional daysBack parameter:

// Get videos added in the last day (default)
{ "daysBack": 1 }

// Get videos added in the last week
{ "daysBack": 7 }

The server will return an array of YouTube URLs for the matching videos:

[
  "https://youtube.com/watch?v=video1",
  "https://youtube.com/watch?v=video2",
  ...
]

Token Refresh

The refresh token doesn't expire unless you explicitly revoke access. You only need to get a new one if you:
- Revoke the application's access in your Google Account settings
- Reset your Google account's security settings
- The token becomes invalid for any other reason

To get a new refresh token, simply run the get-refresh-token.js script again as described in the Setup section.

Development

The server is built with:
- TypeScript
- @modelcontextprotocol/sdk
- googleapis (YouTube Data API v3)

To modify the server:
1. Make your changes in src/index.ts
2. Run npm run build to compile
3. Restart the MCP server to apply changes

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.