OpenSource-Hub

mcp-for-blender

アプリケーション

ahujasid/mcp-for-blender

任意の大規模言語モデルで Blender を制御できる MCP プラグイン。

概要

コミュニティによって開発された統合ツールで、モデルコンテキストプロトコル(MCP)を介して Blender を任意の大規模言語モデルに接続します。Blender プラグインと Python MCP サーバーを含み、プロンプト支援による 3D モデリング、シーン作成、オブジェクトとマテリアルの操作、コード実行をサポートし、Poly Haven や Sketchfab などのアセットや AI が生成した 3D モデルをインポートすることもできます。

README プレビュー

\n\n# MCP for Blender\n\n**Connect Blender to any LLM**\n\n*formerly `blender-mcp` — the PyPI package is now [`mcp-for-blender`](https://pypi.org/project/mcp-for-blender/).*\n*Existing setups keep working; no config change is required. [Read more](https://github.com/ahujasid/mcp-for-blender/issues/366)*\n\n**Disclaimer:** This is a third-party integration and not made by Blender\n\nPrompt-assisted 3D modeling, scene creation, and manipulation — driven by AI.\n\n[](https://pepy.tech/projects/blender-mcp)\n[](https://pypi.org/project/mcp-for-blender/)\n[](LICENSE)\n[](https://discord.gg/SNqPn4TcKQ)\n\n[**Website**](https://mcp-for-blender.com/) · [**Full Tutorial**](https://www.youtube.com/watch?v=lCyQ717DuzQ) · [**Discord**](https://discord.gg/SNqPn4TcKQ) · [**Sponsor**](https://github.com/sponsors/ahujasid) · [**Buy me a coffee**](https://buymeacoffee.com/ahujasid) · [**Feedback**](https://cal.com/siddharth-ahuja/feedback-call)\n\n\n\n\n\n**Supporters**\n\n[CodeRabbit](https://www.coderabbit.ai/)\n[Kevin Guanche Darias](https://github.com/KevinGuancheDarias)\n[Guillermo Rauch](https://github.com/rauchg)\n\n**All supporters:** [Support this project](https://github.com/sponsors/ahujasid)\n\n\n\n---\n\n## Quickstart\n\n> **Note:** the PyPI package `blender-mcp` is now **`mcp-for-blender`**. Existing setups\n> keep working — `uvx blender-mcp` still runs the server and **no config change is\n> required**. New installs should use `mcp-for-blender`.\n> [What changed and why](https://github.com/ahujasid/mcp-for-blender/issues/366)\n\n**One command** sets up your AI apps and the Blender addon:\n\n**macOS / Linux**\n\n```bash\ncurl -LsSf https://www.mcp-for-blender.com/install.sh | sh\n```\n\n**Windows** (PowerShell)\n\n```powershell\npowershell -ExecutionPolicy ByPass -c "irm https://www.mcp-for-blender.com/install.ps1 | iex"\n```\n\nAlready have uv? Run `uvx mcp-for-blender setup` instead.\n\nIt installs [uv](https://docs.astral.sh/uv/) if needed, finds the MCP clients on y

FAQ (3)

トラブル対応
ドイツ語版/非英語版Windowsで 'uvx mcp-for-blender setup' を実行した際にUnicodeDecodeErrorでクラッシュする問題を修正する方法

クラッシュは blender_is_running() 内で発生します。原因は、tasklist の出力が OEM コードページ (cp850) を使用するのに対し、Python 側が cp1252 でデコードするため、'ü' のような文字で失敗することです。

**修正方法(メンテナー/ソースインストールの場合):** blender_mcp/setup_cli.py の約607行目で、tasklist /FI "IMAGENAME eq blender.exe" /NH を実行している subprocess.run 呼び出しに encoding="oem"(または errors="replace")を渡してください。

**ユーザー向けの回避策:**
1. uvx mcp-for-blender setup を実行する前に、chcp 65001 を実行し、$env:PYTHONUTF8=1 を設定します(PowerShell)。
2. または、失敗する手順をスキップします。クラッシュが起きる前にアドオンファイルはすでにコピーされているため、Blender を開いて Edit > Preferences > Add-ons からアドオンを手動で有効にするだけで済みます。

参照 Issue #380
トラブル対応
blender-mcp が 'Successfully connected to Blender on startup' と表示された後、応答がないままハングするのはなぜですか?

ハングしているのではありません ―― これは正常な動作です。uvx blender-mcp は stdio ベースの MCP サーバーであり、対話型 CLI ではありません。Blender への接続後、MCP クライアント(Claude Desktop、Cursor など)から stdin/stdout に送られてくる MCP プロトコルメッセージを、何も表示せずに待機しています。ターミナルで直接実行した場合は接続の確認ができるだけで、それ以上の出力は表示されません。また、Ctrl+C のトレースバック(asyncio CancelledError)は正常なシャットダウン時のノイズであり、エラーではありません。

実際に使用するには:
1. Blender で: Edit > Preferences > Add-ons から addon.py ファイルをインストールし、「Interface: Blender MCP」を有効にします。3D ビューポートで N キーを押し、BlenderMCP タブを開いて「Connect to Claude」をクリックします(ポート 9876 でソケットサーバーが起動します)。
2. サーバーを手動で実行するのではなく、MCP クライアント側を設定します。Claude Desktop の場合は claude_desktop_config.json を編集します:
{"mcpServers": {"blender": {"command": "uvx", "args": ["blender-mcp"]}}}
Cursor の場合: Settings > MCP > Add new server を開き、コマンドに uvx blender-mcp を指定します。
3. クライアントを再起動し、そこからプロンプトを送信します(例: 「create a cube in Blender」)―― Blender が応答するようになります。

uvx blender-mcp を単独で実行するのは接続テストの場合のみにし、その後は Ctrl+C で終了してください。

参照 Issue #73
トラブル対応
Windowsでuvx経由でblender-mcpを実行した際に発生するpywin32の「os error 32: file being used by another process」エラーを修正する方法

このエラーは、uvx blender-mcp が実行のたびに一時的な環境を作成するため、uv のキャッシュ内でロックされた pywin32 ファイルを置き換えられないことが原因で発生します。代わりに、blender-mcp を永続的な uv ツールとしてインストールすることで修正できます:

1. uv のツールストアにインストールする: uv tool install blender-mcp
2. 強制的に更新する: uv tool upgrade blender-mcp
3. インストールを確認する: uv tool list

MCP の設定はそのままで問題ありません("command": "uvx", "args": ["blender-mcp"])。uvx が一時的な環境を再構築してファイルロックに遭遇する代わりに、すでにインストールされているツールを解決するようになるためです。ロックされたキャッシュディレクトリ(例: C:\Users\<you>\AppData\Local\uv\cache\builds-v0\...)を手動で削除するだけでは修正されません。次回の一時的なインストール時にロックが再発するためです。

参照 Issue #196