Doubao MCP server

Integrates with ByteDance's Doubao AI model to generate images from text prompts with customizable sizing and watermarking options, plus image compression and format conversion capabilities.
Back to servers
Setup instructions
Provider
mingforpc
Release date
Sep 25, 2025
Language
Go
Stats
2 stars

MCP Doubao Seedream 4.0 is a server that connects to the Doubao Seedream 4.0 text-to-image model using the Model Context Protocol (MCP), allowing you to generate AI images directly from Claude Code with natural language prompts.

Installation

Prerequisites

  • Python 3.11 or higher
  • uv (recommended) or pip
  • Claude Code

Setting Up

Clone the repository and install dependencies:

git clone <your-repo-url>
cd seedream_mcp

# Method 1: Using uv (recommended)
uv sync

# Method 2: Using pip
pip install -r requirements.txt

Configuration

You'll need an API key from the Volcano Ark console. Set it as an environment variable:

export ARK_API_KEY="your-api-key-here"

Connecting to Claude Code

Method 1: Using the Start Script (Recommended)

Add this configuration to Claude Code:

{
  "mcpServers": {
    "mcp-doubao": {
      "type": "stdio",
      "command": "/path/to/your/seedream_mcp/start_mcp_server.sh",
      "env": {
        "ARK_API_KEY": "your-api-key-here"
      }
    }
  }
}

Method 2: Using the uv Command

Run this command in Claude Code:

claude mcp add-json mcp-doubao '{
  "type": "stdio",
  "command": "uv",
  "args": ["run", "python", "-m", "mcp_doubao.server"],
  "cwd": "/path/to/your/seedream_mcp",
  "env": {
    "ARK_API_KEY": "your-api-key-here"
  }
}'

Usage

Basic Usage

In Claude Code, simply ask for an image with natural language:

Please generate an image of cherry blossoms flying in the wind

Advanced Usage

You can specify multiple parameters in your request:

Generate 3 different landscape paintings in various styles, in 4K resolution, save to the artwork folder, without watermarks

Available Parameters

Parameter Type Default Description
prompt string Required Text description of the image
num_images int 1 Number of images to generate (1-3)
size string "2K" Size ("1K"/"2K"/"4K" or specific pixels like "2048x2048")
watermark bool false Whether to add a watermark
output_dir string "." Directory to save images
image_paths array [] Optional list of reference image paths (1-10 images)
sequential_image_generation string "disabled" Group image mode ("auto"/"disabled")
max_images int 3 Maximum number of images in group mode (1-15)

Testing

You can test the server locally:

# Test server startup
uv run python -m mcp_doubao.server

# Test image generation (optional)
uv run python -c "
import asyncio
import sys
sys.path.append('src')
from mcp_doubao.tools import handle_generate_images

async def test():
    result = await handle_generate_images({
        'prompt': 'a cute kitten',
        'output_dir': './test_images'
    })
    print(result[0].text)

asyncio.run(test())
"

Troubleshooting

Common Issues

  1. Import errors: Make sure all dependencies are correctly installed
  2. API errors: Check if your ARK_API_KEY environment variable is correctly set
  3. Permission errors: Ensure the output directory has write permissions
  4. Image overwriting: The system automatically avoids overwriting existing images by generating unique filenames

Debug Mode

Enable verbose logging for troubleshooting:

PYTHONPATH=src uv run python -c "
import logging
logging.basicConfig(level=logging.DEBUG)
# ... your test code
"

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mcp-doubao" '{"type":"stdio","command":"uv","args":["run","python","-m","mcp_doubao.server"],"cwd":"/path/to/your/seedream_mcp","env":{"ARK_API_KEY":"your-api-key-here"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mcp-doubao": {
            "type": "stdio",
            "command": "uv",
            "args": [
                "run",
                "python",
                "-m",
                "mcp_doubao.server"
            ],
            "cwd": "/path/to/your/seedream_mcp",
            "env": {
                "ARK_API_KEY": "your-api-key-here"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mcp-doubao": {
            "type": "stdio",
            "command": "uv",
            "args": [
                "run",
                "python",
                "-m",
                "mcp_doubao.server"
            ],
            "cwd": "/path/to/your/seedream_mcp",
            "env": {
                "ARK_API_KEY": "your-api-key-here"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later