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.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for mcp_youtube_search-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51731235639ff3a92aa8e5f9a7fd16a1802fac3d38022df1cde6a6a34dc57986
MD5 db810cd927c8d4a1c34a673874ef64fa
BLAKE2b-256 b9e67cfd9e80a755a11202e37caa61bfff33f4abe5ae66e3555fc22fcd7fd97c

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