1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ClaudeでDALL-E 3の画像を生成する(MCPの試運転)

1
Last updated at Posted at 2025-05-24

ClaudeでDALL-E 3の画像を生成する(MCPの試運転)

今のところclaudeでは、ChatGPT 4oなどのような画像生成の機能はありませんが、MCPを使ってClaudeからも画像を生成できます。
この記事は前記事の

MCPお試し最短手順 ~僕の名前は「ブラッド・ピット」です~ https://qiita.com/quittardis/items/a3ba1cc395bcb1c29570 

での設定が前提となります。

適当なディレクトリに移動(たとえば、Documents)し、以下のコマンドを実行します。

git clone https://github.com/Garoth/dalle-mcp.git

これで、Documents下に

dalle-mcp

というフォルダができますので、次にこのフォルダに移動し

npm install

を実行します。以下はそのプロセスの表示です。
最後のほうで、 npm audit fix を実行します。

 npm install
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

> dalle-mcp-server@1.0.0 prepare
> npm run build


> dalle-mcp-server@1.0.0 build
> tsc && node -e "require('fs').chmodSync('build/index.js', '755')"


added 319 packages, and audited 320 packages in 14s

39 packages are looking for funding
  run `npm fund` for details

2 vulnerabilities (1 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
PS C:\Users\hakub\Documents\dalle-mcp>  npm audit fix

changed 8 packages, and audited 320 packages in 4s

39 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

次に、Claudeの "claude_desktop_config.json"を編集します。
#userのところに自分のuser名を
sk-....................のところにOpenAIのAPIキーに入れ替えてください。

前記事の設定ファイルに

 "dalle-mcp": {
      "command": "node",
      "args": [ "C:/Users/#user/Documents/dalle-mcp/build/index.js" ],
      "env": {
        "OPENAI_API_KEY": "sk-....................",
        "SAVE_DIR": "C:/Users/#user/Documents"
      }

を追加しただけです、

{
  "globalShortcut": "",
  "mcpServers": {
    "mcp-installer": {
      "command": "npx",
      "args": [
        "@anaisbetts/mcp-installer"
      ]
    },
    "blender-mcp": {
      "command": "uvx",
      "args": [
        "blender-mcp"
      ]
    },
    "filesystem": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-filesystem",
        "/Users/#user/Desktop",
        "/Users/#user/Downloads"
      ]
    },
    "mcp-browser-use": {
      "command": "uvx",
      "args": [
        "mcp-browser-use"
      ]
    },
     "dalle-mcp": {
      "command": "node",
      "args": [ "C:/Users/#user/Documents/dalle-mcp/build/index.js" ],
      "env": {
        "OPENAI_API_KEY": "sk-....................",
        "SAVE_DIR": "C:/Users/#user/Documents"
      }
    }
  }
}

設定が終わったら、Claude Desktopを終了し、
再起動します。

MCPのdalleで、美しい富士山をフォトリアリスティックに描いてください。

と、Claudeに指示すると、Documents下に↓の画像が生成されました。
dalle-1748055286657.png

↓ Claude -> MCP Dall-E 3で生成した4コマ漫画

4koma_cooking_ai.png

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?