doubao-mcp
MCP server providing zero-cost visual analysis and Q&A through Doubao web (web.doubao.com), using Playwright/CDP to control Chrome and extract AI responses.
README
doubao-mcp
豆包 MCP Server — 通过网页版豆包(web.doubao.com)提供零 API 成本的视觉与问答能力。
基于 CDP + Playwright 接管独立 profile 的 Chrome,在豆包网页版上传图片提问、抓取 AI 回复返回,不需要豆包 API Key。
能力
| 工具 | 说明 |
|---|---|
vision_analyze |
图片识别/分析(上传图片到豆包网页版提问并取回复) |
video_analyze |
视频分析(下载/本地 → 抽帧烧时间戳 → 拼图分块 → 豆包识别,可选本地转写) |
ask_doubao |
纯文本问答(复用豆包会话,支持多轮上下文) |
daemon_start |
启动 Chrome daemon(独立 profile,端口 9223,幂等) |
daemon_status |
检查 daemon 运行状态 |
daemon_stop |
关闭 Chrome daemon |
工作原理
Claude Code ──MCP stdio──> server.py ──> doubao_vision.py ──CDP──> Chrome (独立 profile)
video_analyze.py │
web.doubao.com(网页版)
- Chrome 以
--remote-debugging-port=9223启动独立 profile,登录态持久化 - 图片通过 filechooser 事件上传,回复通过 DOM 特征(
data-streaming等)等待生成完成后提取 - 纯网页操作,无 API 成本,仅需可登录豆包的 Chrome
环境要求
- Python 3.10+
- Chrome(自动探测
CHROME_PATH环境变量或常见安装路径) - 可选:
ffmpeg/ffprobe(视频抽帧)、yt-dlp(在线视频下载)、faster-whisper(音频转写)
安装
pip install fastmcp playwright websocket-client
# 可选功能依赖
pip install pillow # 视频帧时间戳烧录
pip install faster-whisper # 音频转写
使用
1. 作为 MCP server(Claude Code 等)
{
"mcpServers": {
"doubao-mcp": {
"command": "python",
"args": ["/path/to/doubao-mcp/server.py"]
}
}
}
2. HTTP 模式(调试)
python server.py --port 8080
3. 直接 CLI 调用(不含 MCP)
# 启动 Chrome daemon(首次需手动登录豆包一次,登录态持久化)
python doubao_mcp/doubao_vision.py --start
# 图片识别
python doubao_mcp/doubao_vision.py --image photo.jpg --question "请描述这张图片"
# 视频分析(本地文件或 URL)
python doubao_mcp/video_analyze.py --video demo.mp4
配置
- Chrome 路径:设置环境变量
CHROME_PATH指定 Chrome 可执行文件 - CDP 端口:默认
9223,见doubao_vision.py中的CDP_PORT - 登录态:独立 profile 位于
~/.claude/doubao-vision-profile,首次使用daemon_start后手动登录一次即可
常见问题
- 退出码 1(CDP 不可达):daemon 未启动,先运行
daemon_start - 退出码 2(未登录):打开豆包页面手动登录一次
- 退出码 5(超时):豆包生成较慢,增大
--timeout - 退出码 6(安全过滤):回复为空,可能是风控或内容被过滤
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.