MCP client for Douyin Scanner with integrated scanning capabilities
Project description
Douyin Scanner MCP
抖音账号扫描 MCP 客户端,集成了账号数据扫描功能,不再需要单独的 HTTP 服务器。
功能特点
- 基于 Playwright 的浏览器自动化,支持抖音账号数据扫描
- 无需额外配置和启动 HTTP 服务器
- 支持 MCP 标准通信协议
- 缓存扫描结果,提高效率
- 新增:URL标准化功能,自动处理和标准化用户输入的抖音链接
安装
开发模式安装
# 克隆仓库
git clone https://your-repository-url/douyin-scanner.git
cd douyin-scanner/account_scan/client
# 安装依赖
pip install -e .
# 初始化 Playwright (首次安装需要)
playwright install
从 PyPI 安装 (一旦发布)
pip install douyin-scanner-mcp==0.1.2
# 初始化 Playwright (首次安装需要)
playwright install
使用方法
作为 Cursor MCP 工具使用
在 Cursor 的 MCP 配置文件中添加以下配置:
{
"mcpServers": {
"douyin-scanner": {
"command": "uvx",
"args": [
"douyin-scanner-mcp"
],
"env": {
"BROWSER_TYPE": "chromium",
"BROWSER_HEADLESS": "1"
}
}
}
}
环境变量配置说明:
| 环境变量 | 说明 | 默认值 |
|---|---|---|
| BROWSER_TYPE | 浏览器类型 (chromium, firefox, webkit) | chromium |
| BROWSER_HEADLESS | 无头模式 (1: 启用, 0: 禁用) | 1 |
| BROWSER_TIMEOUT | 浏览器超时时间 (毫秒) | 60000 |
| DOUYIN_SCAN_MAX_VIDEOS | 最大扫描视频数 | 100 |
| CONCURRENT_LIMIT | 并发扫描限制 | 3 |
| LOG_LEVEL | 日志级别 | INFO |
命令行使用
# 使用 stdio 通信方式运行
douyin-scanner-mcp
# 使用其他通信方式
douyin-scanner-mcp --transport tcp --host 127.0.0.1 --port 9000
# 启用调试模式
douyin-scanner-mcp --debug
工具列表
该 MCP 客户端提供以下工具:
scan_douyin_account- 扫描单个抖音账号scan_multiple_accounts- 批量扫描多个抖音账号get_server_info- 获取服务信息get_last_result- 获取最后一次扫描结果normalize_douyin_url- 新增的URL标准化功能
发布到 PyPI
- 更新版本号
__version__indouyin_scanner_mcp/__init__.py - 构建包:
python -m build
- 上传到 PyPI:
python -m twine upload dist/*
贡献
欢迎提交 Issue 和 Pull Request。
许可证
MIT
配置文件
在 mcp.json 中添加以下配置以启用 TOTP 验证:
{
"totp_key": "YOUR_TOTP_KEY_HERE",
"app_identifier": "DouyinScanner"
}
确保 totp_key 是通过 generate_totp_key.py 生成的,并且 app_identifier 与应用程序中使用的标识符匹配。
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 Distribution
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 douyin_scanner_mcp-0.1.3.tar.gz.
File metadata
- Download URL: douyin_scanner_mcp-0.1.3.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e43fea71e8b9b36829f4514b794b5ef60e59ba3b96a588144c6a261b05cbd99
|
|
| MD5 |
a2bfb896029ec5c4404b2709a0536647
|
|
| BLAKE2b-256 |
87a596e71af925e8b70b7d49a2ad50e66a28a4c45a87753287437ac46c9c5b05
|
File details
Details for the file douyin_scanner_mcp-0.1.3-py3-none-any.whl.
File metadata
- Download URL: douyin_scanner_mcp-0.1.3-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17408d87b96edbe7433088e8f04674f6d49cc37c7f039a3b740e65c6bc191fe9
|
|
| MD5 |
92b28f8fdbfc52bd675fc41b40f4f74e
|
|
| BLAKE2b-256 |
81716e6f705218979221635bea870f7ded390685fe2cc4e183437819dbf8a3bc
|