> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Qwen Image MCP Integration Guide

> qwen_image MCP server integration

Qwen Image MCP provides text-to-image generation and reference image editing. You can generate multiple candidate images from a description, or give the assistant an existing image together with editing instructions.

## Connect to the Hosted Service

Add a **Streamable HTTP** server in a client that supports remote MCP, using the URL `https://qwen-image.mcp.acedata.cloud/mcp`. When using OAuth, choose to sign in to Ace Data Cloud and confirm authorization in your browser.

| Client | How to connect |
| - | - |
| Claude / Claude Desktop | Add a custom connector under “Customize → Connectors”, enter the hosted URL, and sign in. |
| Claude Code | Run `claude mcp add --transport http --scope user qwen-image https://qwen-image.mcp.acedata.cloud/mcp`, open `/mcp` in the session, select the server, and complete authorization. |
| Cursor | Create an HTTP server in the MCP settings, enter the hosted URL, and follow the prompts to sign in when connecting. |
| VS Code | Run **MCP: Add Server** from the Command Palette, select HTTP and enter the hosted URL, then use **MCP: List Servers** to confirm the status. |

In Codex CLI, you can run the following commands, then enter `/mcp` in the session to view the server.

```bash theme={null}
codex mcp add qwen-image --url https://qwen-image.mcp.acedata.cloud/mcp
codex mcp login qwen-image
```

To use fixed credentials, add the request header `Authorization: Bearer <application API Key>` in the client’s private settings, and confirm that the application is authorized to call the selected API. You can create or copy a key in the console under “Applications → General Applications → Key Management”. [Application Console](https://platform.acedata.cloud/console/applications)

### Use an Application Key in Gemini CLI and OpenCode

First, save the application API Key as the client environment variable `ACEDATACLOUD_API_TOKEN`. The following commands use macOS or Linux shell quoting.

| Client | How to connect |
| - | - |
| Gemini CLI | Run `gemini mcp add --scope user --transport http qwen-image https://qwen-image.mcp.acedata.cloud/mcp --header 'Authorization: Bearer ${ACEDATACLOUD_API_TOKEN}'`, and check with `gemini mcp list`. |
| OpenCode 2.x | Run `opencode mcp add qwen-image --global --url https://qwen-image.mcp.acedata.cloud/mcp --header 'Authorization=Bearer {env:ACEDATACLOUD_API_TOKEN}'`, then run `opencode reload` and `opencode mcp list`. |

In OpenCode 1.x, you can set `type: "remote"`, the hosted URL, and `oauth: false` for this service in the `mcp` object of your personal `opencode.json`, and set the `Authorization` request header to `Bearer {env:ACEDATACLOUD_API_TOKEN}`. [OpenCode 1.x Configuration](https://opencode.ai/v1/docs/mcp-servers/)

## Local stdio Integration

After installing [uv](https://docs.astral.sh/uv/getting-started/installation/), local clients can start the MCP process using standard input and output, and Qwen Image requests are sent to Ace Data Cloud by that process.

Claude Desktop users can open the local MCP configuration from the developer settings, merge the server entry below, replace the placeholder with the application API Key itself in their personal configuration, and then restart the client. Clients that support private environment variables can also inject `ACEDATACLOUD_API_TOKEN` from a credential manager.

```json theme={null}
{
  "mcpServers": {
    "qwen-image": {
      "command": "uvx",
      "args": [
        "mcp-qwen-image"
      ],
      "env": {
        "ACEDATACLOUD_API_TOKEN": "YOUR_API_KEY"
      }
    }
  }
}
```

[mcp-qwen-image package](https://pypi.org/project/mcp-qwen-image/)

## Initial Verification

After connecting, tell the assistant: “Please call only `qwen_image_list_models` and tell me which models are currently available for generation and editing.”

## Tools and Usage Examples

| Operation | Tools and parameters |
| - | - |
| Text-to-image | `qwen_image_generate` requires `prompt`; use `n` to select 1 to 6 images to generate. |
| Reference image editing | `qwen_image_edit` accepts `prompt` and `image_urls`; you can provide 1 to 3 images accessible to the service. |
| Query results | `qwen_image_get_task` queries a single generation or editing task; `qwen_image_get_tasks_batch` queries tasks in batches. |

To change a product image to a white background, you can tell the assistant: “Use the product image I provided as a reference, preserve the product outline, packaging text, and original colors, change the background to pure white, and generate only one image.” The assistant should use `qwen_image_edit` and put the image URL in `image_urls`. If a `task_id` is returned, use it to call `qwen_image_get_task`, and return the image link after the task is complete.

For parameter and result formats, see the API documentation. [Image Generation and Editing](https://platform.acedata.cloud/documents/qwen-image-images), [Task Query](https://platform.acedata.cloud/documents/qwen-image-tasks).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.