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-generator-mcp

v1.0.3

Published

MCP Server for generating images using Doubao Seedream 3.0

Readme

豆包Seedream 3.0 图像生成 MCP 插件

这是一个基于Model Context Protocol (MCP)的豆包Seedream 3.0图像生成插件,可以让AI助手直接调用豆包的图像生成能力。

功能特性

  • 🎨 文本到图像生成: 支持中文提示词,生成高质量图像
  • 🔧 MCP集成: 完全兼容MCP协议,可与支持MCP的AI助手集成
  • 📱 多尺寸支持: 支持1024x1024、1792x1024、1024x1792等尺寸
  • 🎯 质量选项: 支持standard和hd两种质量模式
  • 📊 批量生成: 支持一次生成1-4张图像

安装和配置

1. 安装依赖

npm install

2. 设置API密钥

设置环境变量 ARK_API_KEY

Windows (PowerShell):

$env:ARK_API_KEY="your_api_key_here"

Windows (CMD):

set ARK_API_KEY=your_api_key_here

Linux/Mac:

export ARK_API_KEY="your_api_key_here"

3. 配置模型ID

config.js 文件中修改你的实际接入点ID:

modelId: 'doubao-seedream-3-0-t2i-YOUR_ID_HERE'

使用方法

启动MCP服务器

npm start

可用的MCP工具

1. 图像生成 (generate_image)

{
  "name": "generate_image",
  "arguments": {
    "prompt": "一只可爱的小猫咪,坐在花园里,阳光明媚",
    "size": "1024x1024",
    "format": "url",
    "quality": "standard",
    "n": 1
  }
}

参数说明:

  • prompt (必需): 图像生成提示词
  • size: 图像尺寸,可选值: 1024x1024, 1792x1024, 1024x1792
  • format: 输出格式,可选值: url, b64_json
  • quality: 图像质量,可选值: standard, hd
  • n: 生成图像数量,范围: 1-4

测试

使用Python脚本测试

运行提供的测试脚本:

python test_image_generation.py

使用MCP客户端测试

如果你有支持MCP的客户端,可以直接调用工具:

# 示例:生成图像
curl -X POST "http://localhost:3000/tools/generate_image" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "未来科技城市,霓虹灯闪烁",
    "size": "1024x1024"
  }'

配置选项

环境变量

  • ARK_API_KEY: 豆包API密钥 (必需)
  • ARK_TIMEOUT: API请求超时时间,默认30秒

配置文件

config.js 包含以下配置:

  • API基础URL
  • 模型ID
  • 默认参数
  • 支持的选项

错误处理

插件包含完善的错误处理:

  • API密钥验证
  • 网络请求超时
  • 参数验证
  • 错误信息返回

注意事项

  1. API密钥安全: 请妥善保管你的API密钥,不要提交到代码仓库
  2. 请求限制: 注意豆包API的请求频率限制
  3. 模型ID: 确保使用正确的接入点ID
  4. 网络环境: 确保能够访问豆包API服务器

故障排除

常见问题

  1. API密钥错误

    • 检查环境变量是否正确设置
    • 确认API密钥是否有效
  2. 网络连接问题

    • 检查网络连接
    • 确认防火墙设置
  3. 模型ID错误

    • 检查config.js中的模型ID
    • 确认接入点是否已开通

日志查看

MCP服务器会在控制台输出错误信息,包括:

  • API请求状态
  • 错误详情
  • 调试信息

许可证

MIT License

贡献

欢迎提交Issue和Pull Request来改进这个插件!

更新日志

v1.0.1

  • 添加豆包Seedream 3.0图像生成功能
  • 集成MCP协议支持
  • 添加Python代码执行功能
  • 完善错误处理和配置管理