クライアント設定

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

ToolPurpose
generate_imageSubmit a task and return task_id immediately
check_image_taskPoll 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 install

Cursor 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-* (default gpt-image-2)
  • Requires NewAPI async endpoints /v1/images/tasks
  • Protocol details: Async Image Generation

このページの内容