npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

doubao-image-mcp-server

v1.3.0

Published

MCP server for Doubao image generation and editing capabilities

Readme

Doubao Image MCP Server

一个用于豆包图片生成和编辑功能的 MCP (Model Context Protocol) 服务器,支持在 Cherry Studio 和 Cursor 中使用。

功能特性

  • 文本生成图片: 根据文本提示生成高质量图片
  • 图片到图片: 基于参考图片和提示词生成新图片
  • 多尺寸支持: 支持 1K、2K、4K 分辨率
  • 批量生成: 支持一次生成多张图片(最多3张)
  • 水印控制: 可选择是否添加水印

安装和设置

1. 安装依赖

npm install

2. 环境变量配置

创建 .env 文件或设置环境变量:

# 必需:豆包 API 密钥
export DOUBAO_API_KEY="your-doubao-api-key"

# 可选:豆包 API URL (默认: https://ark.cn-beijing.volces.com/api/v3)
export DOUBAO_API_URL="https://ark.cn-beijing.volces.com/api/v3"

# 可选:豆包模型 (默认: doubao-seedream-4-0-250828)
export DOUBAO_MODEL="doubao-seedream-4-0-250828"

3. 启动服务器

npm start

Cherry Studio 配置

在 Cherry Studio 中添加 MCP 服务器:

  1. 打开 Cherry Studio 设置
  2. 进入 "MCP Servers" 配置页面
  3. 添加新的服务器配置:
{
  "name": "doubao-image",
  "command": "node",
  "args": ["/path/to/doubao-image-mcp-server/index.js"],
  "env": {
    "DOUBAO_API_KEY": "your-api-key",
    "DOUBAO_API_URL": "your-api-url"
  }
}

Claude Desktop 配置

在 Claude Desktop 中配置 MCP 服务器:

方法一:直接指向本地文件

编辑 Claude Desktop 配置文件(通常在 %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "doubao-image": {
      "command": "node",
      "args": ["D:/AI/mcp/index.js"],
      "env": {
        "DOUBAO_API_KEY": "your-api-key",
        "DOUBAO_API_URL": "https://ark.cn-beijing.volces.com/api/v3",
        "DOUBAO_MODEL": "doubao-seedream-4-0-250828"
      }
    }
  }
}

方法二:通过 npx 使用(推荐)

如果你将此包发布到 npm,可以使用:

{
  "mcpServers": {
    "doubao-image": {
      "command": "npx",
      "args": ["doubao-image-mcp-server"],
      "env": {
        "DOUBAO_API_KEY": "your-api-key",
        "DOUBAO_API_URL": "https://ark.cn-beijing.volces.com/api/v3",
        "DOUBAO_MODEL": "doubao-seedream-4-0-250828"
      }
    }
  }
}

Cursor 配置

在 Cursor 中配置 MCP 服务器:

  1. 打开 Cursor 设置 (Cmd/Ctrl + ,)
  2. 搜索 "MCP" 或进入 "Extensions" -> "MCP"
  3. 添加服务器配置:
{
  "mcpServers": {
    "doubao-image": {
      "command": "node",
      "args": ["/path/to/doubao-image-mcp-server/index.js"],
      "env": {
        "DOUBAO_API_KEY": "your-api-key",
        "DOUBAO_API_URL": "your-api-url"
      }
    }
  }
}

可用工具

generate_image

文本生成图片工具

参数:

  • prompt (必需): 描述要生成图片的文本提示
  • size (可选): 图片尺寸 (1K, 2K, 4K),默认 1K
  • reference_images (可选): 参考图片URL数组,用于图片到图片生成
  • max_images (可选): 生成图片数量 (1-3),默认 1
  • watermark (可选): 是否添加水印,默认 true
  • model (可选): 使用的模型,默认 doubao-seedream-4-0-250828

示例:

生成一张2K分辨率的猫咪图片

image_to_image

图片到图片生成工具

参数:

  • prompt (必需): 描述要生成图片的文本提示
  • reference_images (必需): 参考图片URL数组
  • size (可选): 图片尺寸 (1K, 2K, 4K),默认 1K
  • max_images (可选): 生成图片数量 (1-3),默认 1
  • watermark (可选): 是否添加水印,默认 true
  • model (可选): 使用的模型,默认 doubao-seedream-4-0-250828

示例:

基于提供的图片,生成3张女孩和奶牛玩偶在游乐园开心地坐过山车的图片,涵盖早晨、中午、晚上

API 兼容性

本服务器设计为兼容豆包的图片生成和编辑 API。如果 API 端点或格式有变化,可能需要调整 index.js 中的相应代码。

故障排除

  1. API Key 错误: 确保 DOUBAO_API_KEY 环境变量设置正确
  2. 网络连接: 检查网络连接和 API URL 是否正确
  3. 权限问题: 确保有足够的权限访问豆包 API

开发

# 开发模式 (文件监听)
npm run dev

许可证

MIT