Client Setup
MCP Image
Cursor async image MCP for /v1/images/tasks
Use Cursor MCP to call SunAPI async image generation. Tool style matches duojie (submit returns immediately, then check).
Tools
| Tool | Purpose |
|---|---|
generate_image | Submit a task and return task_id immediately |
check_image_task | Poll status; save to a local directory when done |
Install
Prepare the MCP server directory on your machine, then install dependencies:
cd /path/to/your-mcp
npm installCursor config
Add this to Cursor MCP settings (args = local entry file path):
"sun-image-async": {
"command": "node",
"args": ["/path/to/your-mcp/src/index.js"],
"env": {
"SUN_IMAGE_BASE_URL": "https://api.sunai.lol/v1",
"SUN_IMAGE_API_KEY": "sk-your-key",
"SUN_IMAGE_MODEL": "gpt-image-2"
}
}Keep the API key only in MCP env. Do not commit it.
Notes
- Only
gpt-image-*(defaultgpt-image-2) - Requires NewAPI async endpoints
/v1/images/tasks - Protocol details: Async Image Generation