指南 / MCP

透過 MCP 從 Claude Code 端到端執行廣告活動

你不需要開啟編輯器。你告訴 Claude Code 廣告活動的需求,它會呼叫 NOLGIA 工具,創意素材就會進入一個你可以在網站上開啟的專案。

  • 閱讀時間 8 分鐘
  • 更新於

本文由英文自動翻譯。閱讀原文

主視覺圖創意素材專案

依序列出你製作的內容。點一下即可跳到對應步驟。

你可以透過將 Claude Code 連接到 NOLGIA 的 MCP 伺服器,並用簡單的文字描述廣告活動,從 Claude Code 執行小型廣告活動。Claude Code 會建立專案、開啟你核准的主視覺圖、使用圖生圖工具從該主視覺圖製作每個創意素材、以你指定的尺寸渲染所有創意素材,並將結果歸檔到專案中。你可以在專案頁面或媒體庫中檢視圖片,整個流程都不需要開啟合成器。

以下內容是一次針對虛構產品(帶有橙色光環的霧面黑色耳機)的真實工作階段。工具呼叫顯示為 Claude Code 實際執行的方式,圖片是回傳的結果,價格則取自頁面載入時的即時目錄。連線設定請參考 使用 MCP 從 Claude Code 或 Cursor 生成;本指南從那之後開始。

常見錯誤與修正方法

錯誤影響修正
在一行中要求生成所有六張圖片代理程式在產品確認前就生成,導致你為六張錯誤圖片付費先核准主視覺圖,再展開生成
為每個創意素材重新描述產品每次描述都會產生偏差,導致產品形狀改變使用圖生圖功能,從已核准的主視覺製作創意素材,讓參考圖保持一致
跳過專案六個素材散落在媒體庫中,彼此之間沒有關聯先建立專案,並在每次生成時傳入其 id
將錢包餘額當作收據來讀取在他人共用的帳戶上,餘額會因工作階段以外的原因變動,因此從中推斷的價格可能會高出數倍事先告知代理程式預算上限與單張圖片費率,並讀取帳務明細,而非餘額
重試逾時的呼叫第一次呼叫通常已在伺服器端完成;盲目重試會產生第二張圖片在 5 分鐘內重試相同請求會收到 409 錯誤,且不會重複計費;請使用 assets 工具尋找結果

開始之前

  • 按照 MCP 指南,使用個人存取權杖將 Claude Code 連線至 NOLGIA。
  • 儲值餘額中有點數:權杖僅消耗儲值點數。
  • 媒體庫中有一張已核准的產品主視覺圖。我們使用的是虛構產品,由 GPT Image 2.5 Flare 製作。
  • 一份簡短的任務說明,包含模型、尺寸與點數上限。我們的設定:三個創意素材,1:1 與 9:16,最多八十點,並註明每張圖片的費率。
一副霧面黑色耳罩式耳機,每個耳罩上有一圈細長的發光橙色環,放置在午後窗邊光線下的舊橡木桌上。
已核准的主視覺圖。 使用 GPT Image 2.5 Flare 在會話前製作。以下所有創意素材皆由此衍生。

向 Claude Code 提供任務說明

一則訊息涵蓋整個任務:產品、主視覺圖的資產 ID、模型、三個創意素材、兩種尺寸、檔案歸檔規則、含每張圖片費率的上限,以及可同時執行的呼叫次數。我們也告知它該使用哪些工具,並不要動到模型清單,因為我們自行指定了模型。

發出的任務說明
You are running a small ad campaign for me on NOLGIA through the nolgia MCP tools. Work only with those tools; do not run shell commands and do not call nolgia_list_models (I am telling you the model).

The product is fictional: matte black over-ear headphones with a thin glowing orange light ring on each ear cup. The approved hero image already exists in my library as asset 74391fde-9c67-44aa-a298-aa090f8d7949.

Do this, in order, and tell me each tool call you make and what came back (ids, sizes, credits):
1. Create a project named "Orange Ring campaign 2" with a one-line description.
2. Open the hero asset with nolgia_get_asset so you know what it looks like, and file it into the project.
3. Make three creatives from the hero with nolgia_image_to_image on the model gpt-image-2.5-flare, using the hero as the reference image so the product stays the same, each in two sizes, aspect ratio 1:1 and 9:16, so six images in total, every one filed into the project by passing the project id:
   Creative A "Morning desk": the headphones on a worn oak desk in a shaft of morning window light, dust drifting in the beam, soft shadows, premium ad look.
   Creative B "Night rain": the headphones in close-up with fine rain droplets on the matte shells and warm amber streetlight reflections, soft city bokeh behind, music-video look.
   Creative C "Silhouette": a young dancer in a long dark coat seen from behind wearing the headphones, under one warm practical lamp in a dark rehearsal room with haze, the orange rings glowing, fashion-film look, no face visible.
4. Spend at most eighty credits in total; each image on this model bills eight credits. Run at most three image calls at once. If a call fails, report it and continue with the next; do not retry more than once.
5. Finish with a short table: creative, size, asset id, and the project id.

提示:指定模型與參考圖. nolgia_list_models 會回傳完整目錄,遠超過單一會話所需。請在任務說明中直接指定模型 ID。主視覺圖作為參考圖,套用於每一次圖生圖呼叫,這能確保產品在所有創意素材中保持一致。

會話記錄,逐字呈現

Claude Code 載入了所需的四個工具,建立了專案,開啟了主視覺並進行歸檔,接著分三批製作了六張圖片,每次不超過三個呼叫,並在每批之後報告其執行中的花費。簽名 URL 會縮短,JSON 結果以鍵值對行顯示,且每個提示詞共用的開頭部分只會印出一次;其他內容不會進行編輯。

工具、專案與主視覺(參數與結果以鍵值對行顯示)
CALL ToolSearch
  query: select:mcp__nolgia__nolgia_create_project,mcp__nolgia__nolgia_get_asset,mcp__nolgia__nolgia_add_project_assets,mcp__nolgia__nolgia_image_to_image
  max_results: 4

CALL nolgia_create_project
  name: Orange Ring campaign 2
  description: Ad creatives for matte black over-ear headphones with glowing orange light rings, built from the approved hero image.
CALL nolgia_get_asset
  asset_id: 74391fde-9c67-44aa-a298-aa090f8d7949
RESULT id: b73d2c7d-4a86-4785-8fb5-ddfb98da7b9d, name: Orange Ring campaign 2, asset_count: 0
RESULT status: ready, kind: image, name: Premium product photograph of fictional, asset_id: 74391fde-..., mime_type: image/png, model: gpt-image-2.5-flare, url: (signed url)

CALL nolgia_add_project_assets
  project_id: b73d2c7d-4a86-4785-8fb5-ddfb98da7b9d
  asset_ids: 74391fde-9c67-44aa-a298-aa090f8d7949
RESULT added: true
分三批製作的六張圖片(點數數字以文字寫出)
CALL nolgia_image_to_image
  model: gpt-image-2.5-flare
  aspect_ratio: 1:1
  project_id: b73d2c7d-...
  image_url: (signed url of the hero)
  prompt: Keep the exact same headphones from the reference image: matte black over-ear headphones with a thin glowing orange light ring on each ear cup, identical shape and details. Scene: the headphones resting on a worn oak desk in a shaft of morning window light, fine dust drifting visibly in the light beam, soft shadows, cool-to-warm morning tones, shallow depth of field, premium advertising product photography, photoreal. No text, no letters, no logos, no brand names, no watermark.
CALL nolgia_image_to_image
  (the same, with "vertical composition" added) aspect_ratio: 9:16
RESULT status: ready, kind: image, asset_id: fa93b7aa-cba8-427f-8920-38281358a39c
RESULT status: ready, kind: image, asset_id: 96429e72-73a9-4e00-b7c5-297cd426883a
TEXT: Sixteen credits spent so far. Next I'll run Creative B in both sizes and Creative C at 1:1, which is three calls at once.

CALL nolgia_image_to_image
  model: gpt-image-2.5-flare, aspect_ratio: 1:1, project_id: b73d2c7d-..., image_url: (signed url of the hero)
  prompt: Keep the exact same headphones from the reference image: (as above). Scene: night close-up of the headphones with fine rain droplets beaded on the matte shells, warm amber streetlight reflections gliding across the surfaces, the orange rings glowing, soft out-of-focus city bokeh behind, moody cinematic music-video look, photoreal. No text, no letters, no logos, no brand names, no watermark.
CALL nolgia_image_to_image
  (the same, with "vertical composition" added) aspect_ratio: 9:16
CALL nolgia_image_to_image
  model: gpt-image-2.5-flare, aspect_ratio: 1:1, project_id: b73d2c7d-..., image_url: (signed url of the hero)
  prompt: Keep the exact same headphones from the reference image: (as above). Scene: a young dancer in a long dark coat seen from behind, wearing the headphones, standing in a dark rehearsal room filled with light haze, lit by a single warm practical lamp, the orange rings glowing clearly, face not visible, fashion-film look, cinematic, photoreal. No text, no letters, no logos, no brand names, no watermark.
RESULT status: ready, kind: image, asset_id: 067eb5f3-76fd-4bb7-a513-44936650ed79
RESULT status: ready, kind: image, asset_id: 24b9247e-ce62-41fc-869b-a954c814e599
RESULT status: ready, kind: image, asset_id: 38521354-d302-4b3f-9081-3fe3ad253c52
TEXT: Forty credits spent so far. One image left.

CALL nolgia_image_to_image
  (Creative C again, with "vertical full-figure composition" added) aspect_ratio: 9:16
RESULT status: ready, kind: image, asset_id: e34a8f78-1872-4d3b-b6a4-dd9d4ab1e9d9

執行過程順利:六張圖片,四十八點數,在我們設定的八十點數之內,沒有停止、沒有逾時也沒有重試。因為簡報中說明了每張圖片的費率,它自行計算花費,而不是讀取錢包餘額。

其結束訊息(點數數字以文字寫出)
All six images were made and filed into the project, for forty-eight credits in total (under your eighty limit). No calls failed and none were retried.

Tool calls, in order
1. nolgia_create_project with the name "Orange Ring campaign 2" and the description "Ad creatives for matte black over-ear headphones with glowing orange light rings, built from the approved hero image." It returned project b73d2c7d-4a86-4785-8fb5-ddfb98da7b9d, with 0 assets.
2. nolgia_get_asset on 74391fde-9c67-44aa-a298-aa090f8d7949 returned a ready PNG image made with gpt-image-2.5-flare. I didn't see the picture itself, only its details and the prompt it was made from. The prompt describes the headphones on a worn oak desk by a window in late-afternoon daylight, with a long warm shadow and shallow depth of field. I used its signed link as the reference image in every call below.
3. nolgia_add_project_assets filed the hero into the project and returned added: true.
4. nolgia_image_to_image ran six times on gpt-image-2.5-flare, with the hero as the reference and the project id passed each time. Every prompt starts by telling the model to keep the exact same headphones, and every one includes "no text, no logos, no watermark":
   - First batch (2 calls at once): Creative A at 1:1 and 9:16. Both came back ready, eight credits each, sixteen so far.
   - Second batch (3 calls at once): Creative B at 1:1 and 9:16, and Creative C at 1:1. All came back ready, eight credits each, forty so far.
   - Third batch (1 call): Creative C at 9:16. It came back ready for eight credits, forty-eight in total.

Results
Creative | Size | Asset id | Project id
A "Morning desk" | 1:1 | fa93b7aa-cba8-427f-8920-38281358a39c | b73d2c7d-4a86-4785-8fb5-ddfb98da7b9d
A "Morning desk" | 9:16 | 96429e72-73a9-4e00-b7c5-297cd426883a | b73d2c7d-...
B "Night rain" | 1:1 | 067eb5f3-76fd-4bb7-a513-44936650ed79 | b73d2c7d-...
B "Night rain" | 9:16 | 24b9247e-ce62-41fc-869b-a954c814e599 | b73d2c7d-...
C "Silhouette" | 1:1 | 38521354-d302-4b3f-9081-3fe3ad253c52 | b73d2c7d-...
C "Silhouette" | 9:16 | e34a8f78-1872-4d3b-b6a4-dd9d4ab1e9d9 | b73d2c7d-...

The project now holds 7 assets: the hero plus the six new images. I haven't looked at any of the new images. Before you use them, check that the headphones match the hero and that no face shows in the Silhouette images.

它從未看到圖片,只看到圖片的細節,這就是為什麼它最後幾行要求你檢查它們:開啟專案並查看每張圖片的完整尺寸。每個提示詞中的「無文字、無字母、無標誌、無品牌名稱、無浮水印」這一行是 Claude Code 自己加上的;簡報並未要求這樣做。如果你想在創意素材中加入標誌或你的 Logo,請在簡報中明確指出或附上確切的 Logo 圖片,如果生成的文字出現亂碼,請重新生成。

廣告活動

六張圖片,全部來自同一個主視覺,全部使用 GPT Image 2.5 Flare,每張均按該模型的費率計費。產品在每張圖片中都是同一個物件,因為主視覺在每次呼叫中都是參考圖。

耳機放在橡木桌上,沐浴在清晨窗戶透進的一束光線中,灰塵在光束中飄浮,正方形。
創意素材 A,1:1。 清晨桌面。
耳機放在橡木桌上,沐浴在清晨窗戶透進的一束光線中,灰塵在光束中飄浮,直式。
創意素材 A,9:16。
耳機特寫,佈滿雨珠,背景有琥珀色路燈反射和城市散景,正方形。
創意素材 B,1:1。 夜雨,雨珠中映出溫暖的路燈。
耳機特寫,佈滿雨珠,背景有琥珀色路燈反射和城市散景,直式。
創意 B,9:16。
一位年輕舞者身穿長款深色外套,背對鏡頭,在霧氣繚繞的排練室中戴著耳機,一盞暖燈,橙色光環發亮,正方形。
創意 C,1:1。 一盞暖燈下的剪影。
一位年輕舞者身穿長款深色外套,背對鏡頭,在霧氣繚繞的排練室中戴著耳機,一盞暖燈,橙色光環發亮,直式。
創意 C,9:16。

它在網站上的位置

開啟 專案 和該廣告活動的專案。主視覺和六個創意素材位於其媒體中,如果下一輪需要固定演員、地點或你的調色盤與標誌,專案的演員陣容、地點和品牌套件欄位已準備就緒。從這裡你可以下載整套素材,或在 Studio 中開啟任何圖片。

Orange Ring campaign 2 的專案媒體網格:主視覺和六個創意素材,正方形和直式,並顯示其尺寸
專案的媒體。 七個素材,依工作階段歸檔。

同一個工作階段可以在 廣告活動 頁面使用 nolgia_run_preset 執行廣告活動預設集:四種尺寸的海報,將你的文字設定為真實文字、靜態廣告包、看板廣告和發布影片。我們在這裡使用原始圖片工具,以便記錄顯示每個參數。

三種執行方式

路徑方法適用情境
最快每個格式使用一個預設集,透過 Claude Code 執行 nolgia_run_preset,或在網站的 Campaigns 中執行你想要經過驗證的版面配置,以及海報上實際的文字設定
全自動在聊天中向 NOLGIA Agent 提供簡報;它會處理各種格式並歸檔檔案你不在終端機前
最高控制權使用 Claude Code 搭配原始影像工具,如本指南所示你想要指導每個創意並保留參考資料

不在工作階段內處理的事項

  • 發布。 NOLGIA 不會將內容發布到廣告平台或安排排程。你需要下載整套素材,並上傳到執行廣告活動的地方。
  • 影像上的文字。 原始影像工具不會設定實際文字;海報預設集會。
  • 影片創意。 同一個工作階段可以呼叫 nolgia_text_to_video 和 nolgia_image_to_video;本指南僅專注於靜態影像。
  • 結果中的價格。 影像結果會回傳素材,而非所消耗的點數。你的 帳單頁面 上的帳務記錄會顯示每張影像的費用。
  • ChatGPT。 在 MCP 頁面上標記為即將推出;本指南僅適用於 Claude Code。

費用說明

閱讀是免費的:列出模型、建立專案、開啟資產以及歸檔資產都不花費任何費用。每張圖片會按其模型的費率計費。本指南中模型的即時費率以及「活動」頁面執行的預設集:

  • GPT Image 2.5 FlareEvery plan

    Per image

    Native 8 點 · 2K 21 點 · 4K 58 點

頁面載入時從目錄即時讀取。 所有價格都會在生成前顯示。 查看所有費率.

親自試試看

主視覺與簡報

  • 耳機主視覺,2048x2048 WebPWebP 圖片 · 2048x2048 · 233 KB下載
將主視覺上傳到你的媒體庫,把它的資產 id 填入上方簡報中取代我們的,然後在連接 NOLGIA 的情況下將簡報傳給 Claude Code。同時允許 jobs 工具。你的創意素材會與我們的不同;產品應該保持一致,因為主視覺是每次呼叫的參考依據。

檢查清單

  1. Token 已連接;nolgia_get_account 有回應。
  2. 在任何創意素材之前先核准主視覺;其資產 id 在簡報中。
  3. 專案已建立;其 id 用於每次生成。
  4. 簡報中指定了模型;模型清單保持不變。
  5. 簡報中包含上限和每張圖片的費率;允許使用 jobs 工具。
  6. 檢查逾時,而不是盲目重試。
  7. 在網站上開啟專案,並以全尺寸檢視每張圖片。

常見問題

Claude Code 能一次完成整個活動嗎?
它可以串聯呼叫,但請先核准主視覺:每個創意素材都是從它生成的,所以錯誤的主視覺會導致六張錯誤的圖片。
這次會話花費多少?
僅計費生成內容。建立專案、開啟與歸檔素材皆免費;每張圖片按其模型公布的費率計費。圖片呼叫的結果不包含價格資訊,請查閱帳務紀錄。
呼叫逾時。我被重複扣款了嗎?
不會。五分鐘內的相同請求會回傳 409 錯誤並指出既有任務,僅首次請求計費。請使用 jobs 或 assets 工具尋找該圖片。
它能將我的標題加到創意素材上嗎?
原生圖片工具無法做到。Social 與海報包以及靜態廣告預設集會將你的文字設為真實文字;請使用 nolgia_run_preset 或從 Campaigns 頁面執行。
這能在 ChatGPT 中使用嗎?
尚未支援。MCP 頁面將 ChatGPT 標示為 Soon。目前 Claude Code 和 Cursor 可用。

從終端機執行你的第一個廣告活動

連線 Claude Code

MCP

透過 MCP 從 Claude Code 或 Cursor 生成

只需一個權杖和一個指令或設定項目,即可將 NOLGIA 連接到 Claude Code 或 Cursor,然後用自然語言要求生成圖片、影片和音訊。

· 閱讀時間 5 分鐘

商品影片

不用拍攝就能做產品影片:選擇格式

七種產品影片格式,從教學短片、開箱影片到僅展示手部動作的影片,每種都附有實際範例、用途說明以及選擇時機。

· 閱讀時間 8 分鐘