0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Blender MCP を使って Claude Desktop と連携!

Last updated at Posted at 2025-03-23

1. はじめに

  • 背景・モチベーション

    • 「Blender と Claude AI を連携して 3D モデリングを自動化したい!」
    • 「MCP (Model Context Protocol) を試してみた」
  • 今回のゴール

    • Claude Desktop と Blender を連携し、Claude からコマンドを送って Blender 内でオブジェクト作成やスクリプト実行を可能にする
    • WSL 環境での試行錯誤を経て、最終的に Windows ネイティブで動かすに至ったストーリー

2. 全体構成

  • Claude Desktop
    • Anthropic Claude のデスクトップ版(Cursor などの MCP 対応エディタでも可)
  • MCP サーバー
    • blender-mcp リポジトリを使い、Blender と通信するサーバー
  • Blender
    • Windows にインストールした Blender(今回 4.4 版など)

3. WSL での試行錯誤

  1. WSL に Blender を入れようとしたが GUI が面倒

    • X サーバーを起動したり、OpenGL の設定が必要だったりとハードルが高い
  2. Windows 側の Blender.exe を WSL から呼び出す方針

    • /mnt/c/Program Files/Blender Foundation/Blender 4.4/blender.exe のようにパスを指定すれば一応実行は可能
  3. MCP サーバー(uvx blender-mcp)も WSL で動かす

    • しかし Connection refused やファイアウォール周りの問題が発生
    • localhostForwarding=true などを .wslconfig に設定しても通信がうまくいかず、ブリッジが大変

4. Windows ネイティブに移行

  1. uv のインストール (Windows)

    # 実行ポリシーを変更
    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
    
    # uv インストールスクリプト
    powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
    
    # uvx が PATH に通っていなければ PATH に追加
    
  2. uvx blender-mcp の実行

    • PowerShell 上で uvx blender-mcp → 「BlenderMCP server starting up」「Connected to Blender at localhost:9876」などが表示される
  3. Blender の実行ファイルパスを確認

    • C:\Program Files\Blender Foundation\Blender 4.4\blender.exe を PATH に追加、またはエイリアスを作る
  4. Claude Desktop の設定ファイル

    {
      "mcpServers": {
        "blender": {
          "command": "uvx",
          "args": [
            "blender-mcp"
          ]
        }
      }
    }
    
    • Claude Desktop 再起動後、「blender」サーバーを呼び出すと Windows 上で uvx blender-mcp が起動

5. Blender MCP アドオン設定

  1. Blender アドオンのインストール

    • addon.py をダウンロード → Blender の「Edit > Preferences > Add-ons > Install...」から追加
  2. Blender サイドバー(Nキー)に「BlenderMCP」タブ

    • 「Running on port 9876」と表示されていれば成功
  3. Claude からオブジェクト作成コマンドを送るテスト

    • 「Create a cube in Blender」 → Blender 内にオブジェクト生成 → ログに create_object が通った表示が出る

6. トラブルシュートメモ

  • Connection refused

    • ポート 9876 がブロックされていないか
    • Blender アドオンが「Start MCP Server」になっていないか
  • WSL ↔ Windows 間の通信

    • .wslconfiglocalhostForwarding=true を設定しても難航したので Windows ネイティブに移行
  • uv のインストール先 (C:\Users\<ユーザー名>\.local\bin) が PATH に含まれていない

    • where uvx で確認し、PATH に追加

7. まとめ・所感

  • WSL での運用はネットワーク設定が難しい

    • Blender.exe が Windows ネイティブの GUI アプリ → WSL とのブリッジに問題が起きやすい
  • Windows ネイティブに移行してシンプル化

    • uvx blender-mcp も Windows で動かす → 同じ OS 内で通信 → エラーが大幅に減った
  • 今後の発展

    • Claude からの自動スクリプト実行で 3D モデリングワークフローを高速化
    • Cursor や他の MCP 対応エディタと連携する可能性も

8. 作業工程と所要時間(試行錯誤の記録)

今回の取り組みでは、以下の工程に分けて作業しました。
あくまで筆者(私)の試行錯誤ベースの時間なので、慣れていればもっと短く済む可能性があります。

  1. MCP サーバーの選定

    • blender-mcp を選ぶまでに、ほかの MCP サーバーを調査
    • 約 40 分
  2. WSL環境での試行錯誤 + ファイアウォール & WSL設定

    • Connection refused 対策で .wslconfig やファイアウォールを調整
    • 結局安定せず、Windows ネイティブに移行
    • 約 1 時間
  3. Windows ネイティブへの移行検討

    • WSL でのブリッジに手こずり、Windows で直接 uvx を動かす方針へ
    • 約40 分
  4. Windows 環境での uv インストール & 実行ポリシー変更

    • Set-ExecutionPolicy RemoteSignedpowershell -c "irm https://astral.sh/uv/install.ps1 | iex"
    • エラーを回避しつつ uvx.exe を導入
    • 約 1 時間
  5. PATH 設定 & ファイアウォール再確認

    • C:\Users\<ユーザー名>\.local\bin を PATH に追加し where uvx で認識させる
    • ファイアウォール例外も調整
    • 約 1 時間
  6. MCP サーバー起動成功 & Claude Desktop 設定

    • uvx blender-mcp が「Connected to Blender at localhost:9876」
    • Claude Desktop の mcpServers"command": "uvx" を設定
    • 約 30 分

合計:およそ 5 時間程度 の試行錯誤。
もちろん実際には、空白時間やチャット外の調査などもあって前後します。


9. 参考リンク

0
2
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
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?