使用说明
YouTube Browser Control - MCP Server
Điều khiển YouTube thông qua trình duyệt Chrome bằng MCP protocol.
Cài đặt
1. Cài Python
- Tải Python 3.8+ từ: https://www.python.org/downloads/
- Khi cài, tick chọn "Add Python to PATH"
2. Cài thư viện
pip install -r requirements.txt
3. Cấu hình Endpoint
- Truy cập https://xiaozhi.me để lấy WebSocket token
- Mở file
client.py, tìm dòngDEFAULT_ENDPOINT(dòng 444) - Thay thế URL bằng endpoint của bạn:
DEFAULT_ENDPOINT = "wss://api.xiaozhi.me/mcp/?token=YOUR_TOKEN_HERE"
4. Chạy chương trình
python client.py
Tools có sẵn
open_youtube- Mở YouTubesearch_video- Tìm kiếm videoplay_first_video- Phát video đầu tiênsearch_and_play- Tìm và phát luônskip_ad- Bỏ qua quảng cáotoggle_fullscreen- Bật/tắt fullscreenget_current_url- Lấy URL hiện tạiclose_browser- Đóng trình duyệt
Chế độ chạy
# WebSocket (mặc định)
python client.py
# Debug mode
python client.py --debug
# Stdio mode
python client.py stdio
Lưu ý: Chrome sẽ tự động mở khi chạy tool lần đầu.