doubao-web-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@doubao-web-mcp用豆包生成一张赛博朋克城市夜景,保存到下载目录"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
doubao-web-mcp
豆包网页版能力接入 MCP —— 让 AI 助手直接调用你的豆包网页账号:对话 / 文生图 / 图生视频 / 多账号轮换。
参考 web-ai-mcp(DeepSeek 网页版接入)的思路,零服务依赖、token 级配置、开箱即用。
✨ 能力
工具 | 功能 | 传输方式 |
| 文本对话 / 写稿 / 审片 / 起标题(支持深度思考) | 纯 HTTP,免签名 |
| 文生图 / 图生图,自动落盘 | 纯 HTTP,免签名 |
| 文生视频 / 图生视频,自动落盘 mp4 | HTTP + X-Bogus 签名 |
| 账号池管理(list / switch 多账号切换) | — |
| 链路自检(登录态 + IP 风控状态) | — |
Related MCP server: AI Image Generation MCP Server
🏗 架构
MCP 工具层
│
├─ 对话 / 图片 ──→ 纯 HTTP 直连 doubao.com(免签名,快)
│
└─ 视频 ──→ X-Bogus 签名器(headless 浏览器页面 evaluate
window.bdms.frontierSign,毫秒级)──→ HTTP 提交任务
│
轮询 async/stream
│
下载 mp4 落盘浏览器只当"签名器"(仅视频需要,常驻一个 headless 页面),不作为请求通道。 对话/图片全程零浏览器。
🚀 配置
依赖 Python 3.10+。安装依赖:
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python -m playwright install chromium步骤一:扫码登录拿凭证(本项目自带,不依赖任何外部服务)
.venv/bin/python login.py # 无 GUI 环境:截二维码到 /tmp,手机扫
.venv/bin/python login.py --headed # 在自己终端跑:可见浏览器窗口扫码
.venv/bin/python login.py --name 主号登录成功后凭证写入 ~/.doubao-mcp/accounts.json(权限 600)。
多账号就多跑几次,--name 区分,凭证会累积进同一个账号池。
login.py 会自动完成:点开登录弹窗 → 勾选用户协议 → 清掉「下载电脑版」推广弹窗
→ 截取二维码(2 倍分辨率)→ 轮询 sessionid 落地。
步骤二:注册 MCP
{
"mcpServers": {
"doubao-web": {
"command": "/path/to/.venv/bin/python",
"args": ["/path/to/direct_server.py"],
"env": {
"DOUBAO_OUT_DIR": "/Users/you/Downloads/豆包输出"
}
}
}
}凭证默认从 ~/.doubao-mcp/accounts.json 读,无需其他配置。
浏览器登录 doubao.com → F12 → Application → Cookies → 复制 sessionid(必需)
和 ttwid / passport_csrf_token(可选,带上更稳),然后:
"env": {
"DOUBAO_ACCOUNTS": "主号:sessionid=xxx,ttwid=yyy;小号:sessionid=zzz"
}多账号用 ; 分隔。环境变量优先级高于账号池文件。
额度耗尽或风控时用 doubao_accounts(action="switch", name="小号") 热切换。
📦 文件
文件 | 说明 |
| MCP 服务(5 个工具 + 账号池) |
| 豆包网页版协议客户端(vendored 自 doubao2api,修复了 |
| 扫码登录 → 抓 |
🔓 独立性
本项目运行时零外部依赖:不启动任何本地服务、不依赖 doubao2api 或 Playwright 常驻的 请求通道(浏览器仅在视频签名时临时拉起)、不需要 API Key。
doubao_client.py 中的 doubao2api 仅出现在代码来源署名(见 NOTICE),
运行期不再读取它的任何文件或端口。从 doubao2api 迁来的旧账号池文件默认也不读,
确需读取时显式设 DOUBAO_LEGACY_ACCOUNTS=1。
⚠️ 已知限制
IP 风控:视频端点(skill 17)风控阈值最高。触发
710022002/710022004时: 等待冷却(约 30 分钟,期间别开豆包网页版)/ 换网络(手机热点最快)/ 在浏览器手动过一次滑块验证。对话端点基本不受影响。生成的图片带豆包官方水印(服务端 CDN 渲染,无法去除)。
视频生成受豆包账号每日免费额度限制。
签名器依赖 Playwright + Chromium;仅视频功能需要,对话/图片不受影响。
抖音的 aBogus 纯 Python 算法与豆包 frontierSign 不同源(输出格式不同),无法移植; 签名必须走浏览器页面 evaluate(已验证
X-Bogus参数名 + 16 位短签名)。
📄 协议要点(逆向笔记)
对话:
POST /chat/completion(新版端点,免签名),payload 为client_meta/messages[].content_block[{block_type:10000,text_block}]/option/ext结构,必须带Agw-Js-Conv: str头。上传图片:
POST /samantha/pages/upload_image→ 拿 uri →POST /alice/message/get_file_url换 CDN 链接。文生图:
/samantha/chat/completion+content_type:2009+skill_type:3(免签名)。图生视频:
/samantha/chat/completion+content_type:2020+skill_type:17+X-Bogus签名, 响应 SSE 提取fin_reason.async_task.id→ 轮询/samantha/chat/async/stream。凭证:
sessionidCookie(登录态);msToken假值会触发 710022002,留空最安全。响应头
x-ms-token可用于 msToken 轮换(当前未启用)。
📜 开源许可与致谢
本项目以 Apache License 2.0 发布(见 LICENSE)。
doubao_client.py 是从 doubao2api
(Apache 2.0)的 client.py vendored 并改造而来 —— 修复了 upload_image 的 NameError、
内联了相对导入、新增 X-Bogus 签名器。逐条改动见 NOTICE。
思路参考 web-ai-mcp(DeepSeek 网页版接入 MCP)。 豆包网页版协议为逆向所得,仅供个人学习研究。
免责声明
仅供个人学习研究使用。豆包网页版协议随时可能变更,接口失效时以官方为准。 请勿用于商业营利或高并发滥用。
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Image and video AI tools and your own pipelines, run from any AI assistant.
AI LLM with Gemini, MiniMax, Replicate, OpenRouter. Vision, search, code review. USDC on Base.
Related MCP Servers
- FlicenseNot gradedqualityFmaintenanceEnables AI image generation using Doubao's Seedream 4.0 model through natural language prompts. Automatically downloads generated images to local directories with configurable parameters like resolution, watermarks, and batch generation.8-
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered image generation using Volcengine's Doubao model with customizable aspect ratios (1:1, 4:3, 16:9, 3:4, 9:16) and file management. Supports high-quality text-to-image generation with automatic retry, error handling, and flexible save path configuration.20-
- AlicenseNot gradedqualityDmaintenanceEnables automated Douyin video uploads and account management using Playwright for browser simulation. It supports QR code login, cookie persistence, and automated metadata handling for publishing videos through natural language or API commands.38 npm7MIT
- AlicenseAqualityDmaintenanceEnables terminal AI coding assistants to interact with web AI chat services through browser automation, supporting multiple platforms like Doubao and ChatGPT.311 npmMIT