Integrating OpenCode with Seedream MCP
📘 Overview: OpenCode MCP Overview →
Seedream has consistently performed well at understanding Chinese prompts and creating product images and posters, especially when “editing existing images based on descriptions,” where the results are nearly ready to hand over directly to designers. After connecting the Seedream MCP Server in OpenCode, you can describe the image you want directly in Chinese, or have AI modify an existing image you paste in.
Seedream MCP is suitable for e-commerce product images, event posters, social media graphics, and “secondary editing” scenarios such as changing text on posters and adjusting visual elements.
¶ Get an API Token
Before using the Seedream MCP Server, you need an Ace Data Cloud API Token. OpenCode and Claude Code use the same set of Tokens, and the process for obtaining one is the same:
- Open the Ace Data Cloud Console - Application List and obtain your API Token for later use.
- If you have not logged in or registered, you will be automatically redirected to the login page; after logging in or registering, you will automatically return to the current page.
- Confirm that the key is authorized to access the required APIs, and check your balance and limits in the console.

A general-purpose application's API Key can be reused within its authorized scope. In documentation and screenshots, it is recommended to show only a masked form, such as YOUR_ACEDATACLOUD_API_KEY; do not paste the full Token into public repositories, issues, screenshots, or chat logs.
Want to use Claude Desktop / the Claude.ai web version with one-click OAuth authorization? See the Seedream MCP Claude.ai / Desktop tutorial.
¶ Configure OpenCode
First, run opencode --version. OpenCode 2.x users should set ACEDATACLOUD_API_KEY in the terminal, then run the following commands.
opencode mcp add seedream --global --url https://seedream.mcp.acedata.cloud/mcp --header 'Authorization=Bearer {env:ACEDATACLOUD_API_KEY}'
opencode reload
opencode mcp list
¶ OpenCode 1.x Configuration
OpenCode uses an opencode.json file to describe all MCP Servers. The file can be placed in either of two locations; choose one based on the “scope” below. The field structures are identical in both locations; the only difference is priority.
It is strongly recommended to put the Token in an environment variable first:
export ACEDATACLOUD_API_KEY="替换为你的真实 Token"
Then reference it in opencode.json using the {env:ACEDATACLOUD_API_KEY} placeholder to avoid writing the real Token into the file.
¶ Global: Shared Across All Projects
File location: ~/.config/opencode/opencode.json, suitable for “my own machine, configured once and usable across all projects.”
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"seedream": {
"type": "remote",
"url": "https://seedream.mcp.acedata.cloud/mcp",
"enabled": true,
"oauth": false,
"headers": { "Authorization": "Bearer {env:ACEDATACLOUD_API_KEY}" }
}
}
}
A Bearer API Key is used here.
"oauth": falsetells OpenCode to send the request header according to this configuration.
¶ Project-Level: Applies Only to the Current Project
File location: opencode.json in the current project's root directory. For services with the same name, the definition in the project takes priority. Suitable for team sharing, single-repository customization, or temporarily enabling an MCP only in a particular project.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"seedream": {
"type": "remote",
"url": "https://seedream.mcp.acedata.cloud/mcp",
"enabled": true,
"oauth": false,
"headers": { "Authorization": "Bearer {env:ACEDATACLOUD_API_KEY}" }
}
}
}
If the project-level opencode.json will be committed to Git, make sure to use the {env:ACEDATACLOUD_API_KEY} placeholder instead of the real Token to avoid leaks.
Please launch OpenCode from a terminal where the environment variable has been set and exported.
¶ Verify the Connection
After configuration, run:
opencode mcp list
Seeing seedream connected means the handshake was successful. If it fails, check whether ACEDATACLOUD_API_KEY has been exported, the hosted address, and whether Authorization includes the Bearer prefix. Models and tool Schemas change continuously, so please select a model that supports native tool calling from the current catalog.
¶ Typical Scenarios
Once configured, you can call it directly using natural language in an OpenCode session, without first switching to /mcp:
Generate an image with a single Chinese sentence
生成一张春节促销海报:红色背景、金色福字、奶茶店产品,正方形
Edit text in an existing image
把这张海报上的「v1.0」改成「v2.0」,其他不变
Generate a product image with a white background
生成一张白底的产品图:极简风格的台灯,俯视 45 度角
¶ Tool List
The table below lists commonly used tools. For the full names, see the hosted service's live tool list.
| Tool | Description |
|---|---|
| seedream_generate_image | Generate images from text |
| seedream_edit_image | Edit existing images (change text or elements) |
