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
- Python 3.11+
- SerpAPI key (get one at https://serpapi.com/)
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_youtube_search-0.1.3-py3-none-any.whl.
File metadata
- Download URL: mcp_youtube_search-0.1.3-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d04949bbc42f20583af80e63032d14df6fe83a12216aacd6e40ade7c3ebe142
|
|
| MD5 |
dc412f3c1bd12f1421dbbb384c20e0e5
|
|
| BLAKE2b-256 |
0604e1dca0261de211823bc7c38dcb26c472b58e6ce0a42635f79707d14c178a
|