Skip to main content

A YouTube search MCP server for AI agents

Project description

MCP YouTube Server

A YouTube search server for AI agents using Google's Agent Development Kit (ADK) and Model Control Protocol (MCP).

Installation

pip install mcp-youtube-search

Usage

Running the server

# Set your SerpAPI key as an environment variable
export SERP_API_KEY="your-serp-api-key"

# Start the server
mcp-youtube-search

Or provide the API key directly:

mcp-youtube-search --api-key "your-serp-api-key"

Using with MCP clients

import asyncio
import os
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioServerParameters

async def main():
    # Connect to the MCP server
    tools, exit_stack = await MCPToolset.from_server(
        connection_params=StdioServerParameters(
            command="mcp-youtube-search",
            env={"SERP_API_KEY": os.getenv("SERP_API_KEY")}
        )
    )
    
    try:
        # Use the first tool (should be search_youtube)
        youtube_tool = tools[0]
        results = await youtube_tool.run_async(
            args={"search_query": "Python tutorials", "max_results": 5},
            tool_context=None
        )
        print(results)
    finally:
        await exit_stack.aclose()

asyncio.run(main())

Requirements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_youtube_search-0.1.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_youtube_search-0.1.4-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file mcp_youtube_search-0.1.4.tar.gz.

File metadata

  • Download URL: mcp_youtube_search-0.1.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.11

File hashes

Hashes for mcp_youtube_search-0.1.4.tar.gz
Algorithm Hash digest
SHA256 d6bd7ed9ec32347174ddd3389b5205eff32db460dc9ba194c4dd7e893f4845ed
MD5 cfad1c86278d31cf3d18a290fdf2f830
BLAKE2b-256 d77f0df15a11ecbeafe6c141876dfd5e31bc110c1eef3e265f28181d39bf05c9

See more details on using hashes here.

File details

Details for the file mcp_youtube_search-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_youtube_search-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 28268c0a4ca087267a1ede6e27ca60909ee1319e8de969fac93eddb3a4c85e00
MD5 3ce9eee5b08101078bffad8bf0327a9f
BLAKE2b-256 1ee79c855add8d7a808a04843454b970fd3dfce40beee3f10d987a2ec8438355

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page