Metadata-Version: 2.5
Name: mcp-youtube-search
Version: 0.2.0
Summary: MCP server that searches YouTube through SerpApi
Project-URL: Homepage, https://github.com/arjunprabhulal/mcp-youtube-search
Project-URL: Issues, https://github.com/arjunprabhulal/mcp-youtube-search/issues
Author: Arjun Prabhulal
License-Expression: MIT
License-File: LICENSE
Keywords: mcp,model-context-protocol,serpapi,video-search,youtube
Classifier: Development Status :: 4 - Beta
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Requires-Dist: mcp<3,>=2.3
Requires-Dist: pydantic<3,>=2.7
Requires-Dist: python-dotenv<2,>=1.0
Requires-Dist: serpapi<2,>=1.1
Description-Content-Type: text/markdown

# MCP YouTube Search

<!-- mcp-name: io.github.arjunprabhulal/mcp-youtube-search -->

An MCP server that searches YouTube through [SerpApi](https://serpapi.com/youtube-search-api), for Claude, Cursor and other MCP clients: titles, links, channels, views, publish dates, durations and descriptions.

[![CI](https://github.com/arjunprabhulal/mcp-youtube-search/actions/workflows/ci.yml/badge.svg)](https://github.com/arjunprabhulal/mcp-youtube-search/actions/workflows/ci.yml)
[![PyPI](https://img.shields.io/pypi/v/mcp-youtube-search)](https://pypi.org/project/mcp-youtube-search/)

## Requirements

- Python 3.10 or later (or [uv](https://docs.astral.sh/uv/))
- A SerpApi key in `SERP_API_KEY` (serpapi.com has a free tier)

## Use it from an MCP client

```json
{
  "mcpServers": {
    "youtube-search": {
      "command": "uvx",
      "args": ["mcp-youtube-search", "server"],
      "env": { "SERP_API_KEY": "your-serpapi-key" }
    }
  }
}
```

Or `pip install mcp-youtube-search` and use `"command": "mcp-youtube-search", "args": ["server"]`.

## Command line

```bash
export SERP_API_KEY="your-serpapi-key"
mcp-youtube-search search "model context protocol" --max-results 5
mcp-youtube-search server                                      # MCP over stdio
mcp-youtube-search server --connection_type http --port 3002   # Streamable HTTP at http://127.0.0.1:3002/mcp
```

`LOG_LEVEL=DEBUG` shows more detail on stderr. The API key is never logged.

## Tool

| Tool | What it does |
| --- | --- |
| `search_youtube` | Videos for a query. `query`; optional `max_results` (1-50, default 10), `language` (default `en`), `country` (default `us`). Returns structured results: title, link, channel, views, publish date, duration, thumbnail, description. |

## Development

```bash
uv sync
uv run pytest
uv run ruff check .
```

## License

MIT
