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.
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
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"
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"
}
}
}
}
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"
}
}'
In Claude Code, simply ask for an image with natural language:
Please generate an image of cherry blossoms flying in the wind
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
| 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) |
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())
"
ARK_API_KEY environment variable is correctly setEnable verbose logging for troubleshooting:
PYTHONPATH=src uv run python -c "
import logging
logging.basicConfig(level=logging.DEBUG)
# ... your test 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.
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.
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"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. 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