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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for mcp_youtube_search-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3d04949bbc42f20583af80e63032d14df6fe83a12216aacd6e40ade7c3ebe142
MD5 dc412f3c1bd12f1421dbbb384c20e0e5
BLAKE2b-256 0604e1dca0261de211823bc7c38dcb26c472b58e6ce0a42635f79707d14c178a

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