autodoubao

autodoubao

MCP server that lets AI agents like Codex, Hermes, and LobsterAI automatically generate images via the logged-in Doubao web UI and download the original images to local storage, using a Chrome extension and a queue.

Category
访问服务器

README

AutoDoubao

让 Codex、Hermes Agent 和 LobsterAI 自动调用已登录的豆包网页生图,并把豆包返回的原图下载到本地。

AutoDoubao 是一个 Windows 本地 MCP 桥接服务:Agent 负责提示词和图片验收,豆包网页负责实际生图,Chrome 扩展负责可靠提交和捕获原图,MCP 服务负责任务队列、下载和文件交付。

它不调用火山方舟付费生图 API,不读取账号密码,不绕过豆包登录、验证码、安全验证或免费额度限制。

项目特点

  • 一套 MCP 服务同时供 Codex、Hermes Agent、LobsterAI 使用。
  • 支持 Streamable HTTP;旧版 Hermes 也支持 stdio 兼容代理。
  • 复用用户已经登录的豆包网页和网页免费额度,不需要购买图像 API。
  • 自动填写并提交提示词,检测“文字写入但没有发送”的情况并重试。
  • 监听豆包生成响应中的 image_ori_raw / image_raw,下载真实原图。
  • 不从页面 <img>srcsrcset 猜原图,避免拿到 384×216 缩略图。
  • SQLite 持久化任务状态,三个客户端共用单任务浏览器锁。
  • 提供可迁移的 Windows ZIP 发行包,不携带 Token、Cookie、数据库或生成图片。

项目简介

Codex / Hermes / LobsterAI
              |
              v
   Streamable HTTP MCP :8878
              |
       SQLite 单任务队列
              |
       WebSocket 桥接 :8879
              |
       Chrome 扩展 0.2.0
          |             |
          v             v
     提交提示词     监听豆包生成响应
                        |
                        v
              image_ori_raw / image_raw
                        |
                        v
                 下载原图到本地

豆包页面上的 <img width="2848" height="1600"> 可能仍然指向 384×216 的展示缩略图。AutoDoubao 读取的是生成接口返回的原图字段,而不是页面展示地址,这是项目稳定工作的关键。

Architecture

Codex -----------\
LobsterAI --------+--> Streamable HTTP MCP (127.0.0.1:8878)
Hermes --> stdio proxy -----------/                 |
                                  +--> SQLite single-job queue
                                  |
Dedicated Chrome profile --> Doubao-scoped extension --> Doubao web UI

What is included

  • One shared MCP service; HTTP for Codex/LobsterAI and an stdio compatibility proxy for older Hermes installations.
  • Persistent SQLite jobs and a single browser-work lock.
  • A generated token for the extension-to-service WebSocket.
  • A Chrome Manifest V3 extension that temporarily attaches the debugger Network domain to the selected Doubao tab while a job is active. It extracts the original image_ori_raw / image_raw URL from the generation response.
  • Safe output subdirectories below one configured root.
  • Terminal handling for login, captcha, account verification, quota, and rate limits.
  • Client configuration examples and Windows setup/start scripts.

Initial setup on Windows

  1. Install Python 3.11+ and uv if they are not already available.

  2. Run:

    powershell -ExecutionPolicy Bypass -File .\scripts\setup.ps1
    
  3. Create a dedicated Chrome profile for AutoDoubao.

  4. In that profile, open chrome://extensions, enable Developer mode, choose Load unpacked, and select this repository's extension directory.

  5. The options page opens. Paste the token printed by the setup script and save.

  6. Open https://www.doubao.com/chat/ and sign in manually.

  7. Start the service:

    powershell -ExecutionPolicy Bypass -File .\scripts\start.ps1
    

    Or keep it running in a hidden background process:

    powershell -ExecutionPolicy Bypass -File .\scripts\start-background.ps1
    # Later: powershell -ExecutionPolicy Bypass -File .\scripts\stop-background.ps1
    
  8. Configure clients using docs/CLIENTS.md.

MCP tools

  • doubao_status: service, extension, page, queue, and output status.
  • doubao_generate: queue one prompt and return a job ID.
  • doubao_job_status: poll status and retrieve downloaded paths.
  • doubao_cancel: cancel a job owned by the calling agent.
  • doubao_list_jobs: list recent jobs without returning prompt text.
  • doubao_usage: local job/image counts; it never guesses remaining free quota.
  • doubao_setup_guide: setup instructions available to every MCP client.

Example agent sequence:

doubao_status()
doubao_generate(prompt="...", ratio="1:1", candidate_count=2,
                output_subdir="my-game/icons", agent_id="codex")
doubao_job_status(job_id="job_...")

Configuration

Copy config.example.yaml to config.yaml. Important settings:

  • output_root: every generated image is copied below this directory.
  • max_candidates_per_job: maximum requested results per job.
  • max_jobs_per_hour: local safety limit shared by all agents.
  • job_timeout_seconds: upper bound for one browser job.

The generated extension token is stored in data/extension-token.txt. Do not commit config.yaml, data/, downloaded output, or the token.

Browser integration

Prompt submission is isolated in extension/content.js. Image acquisition does not scrape the rendered <img> element because Doubao can display a small preview behind large DOM width/height attributes. extension/background.js listens to the generation response and downloads the original URL returned by Doubao. Chrome may show a debugging notification while a job is running; the extension detaches when the job completes, fails, times out, or is cancelled.

See docs/SECURITY.md before enabling the extension.

For the complete Chinese design record, failed-version retrospective, pitfalls, three-client configuration, and copy-ready agent prompts, see docs/AUTODOUBAO_IMPLEMENTATION_ZH.md.

To build or install the portable Windows MCP bundle for another machine, see docs/PORTABLE_PACKAGE_ZH.md.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选