DN

dughogan/nuke_mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

40 stars 5 forks 品質 59 トレンド 12

NukeのMCPサーバーとツールコード

概要

モデルコンテキストプロトコル(MCP)を用いたファウンドリーのNukeとAIシステム間のブリッジ。 Nuke-MCP は、AI アシスタントが、ソケット接続を介して Nuke とやり取りできるようにします。 - Nukeスクリプトに関する情報を入手 - ノードの作成、変更、および削除 - ノードグラフのポジションノード - ノードを一緒に接続 - 再生とレンダリングの制御 - Nukeで任意のPythonコードを実行 1. (nuke mcp addon.py): Nuke 2. (nuke mcp server.py): Nuke アドオンに接続し、AI システム 3 にツールを公開する Python サーバー (main.py): MCP サーバーを起動する簡単なスクリプト - Foundry's Nuke (最新バージョンが動作するはずです) - Python 3.7 + - FastMCP パッケージ - Claude デスクトップ 1。 このリポジトリをクローンまたはダウンロードします。 2。 nuke mcp addon.pyをNukeスクリプトフォルダにコピーするか、Nuke Pythonパスの場所 1. : - nuke mcp addon を取る.

概要(AI 翻訳)

モデルコンテキストプロトコル(MCP)を用いたファウンドリーのNukeとAIシステム間のブリッジ。

概要

Nuke-MCP は、AI アシスタントが、ソケット接続を介して Nuke とやり取りできるようにします。

  • Nukeスクリプトに関する情報を入手
  • ノードの作成、変更、削除
  • ノードグラフ内の位置ノード
  • ノードを一緒に接続
  • 再生およびレンダリングを制御する
  • Nuke で任意の Python コードを実行

コンポーネント

1.Nuke Addon ([nuke_mcp_addon.py)): Nuke 内のソケットサーバーを作成する Nuke スクリプト 2.MCP サーバー ([nuke_mcp_server.py)): Nukeアドオンに接続し、AIシステムにツールを公開するPythonサーバー 3.エントリーポイント([main.py)): MCP サーバーを起動する簡単なスクリプト

インストール

前提条件

  • Foundry’s Nuke(最新バージョンが動作するべき)
  • Python 3.7 +
  • FastMCPパッケージ
  • クロードデスクトップ

FastMCP パッケージのインストール

##Nuke-MCPのインストール

  1. 本リポジトリのクローンまたはダウンロード
  2. NukeスクリプトフォルダまたはNuke Pythonパスの場所に[[nuke_mcp_addon.pyをコピーする

使用法

##Nuke Addonのインストール

1.Addon Fileをコピーする:

  • `nuke mcp addon を取る.

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Nuke-MCP

A bridge between The Foundry’s Nuke and AI systems using the Model Context Protocol (MCP).

Overview

Nuke-MCP allows AI assistants to interact with Nuke through a socket connection, enabling them to:

  • Get information about Nuke scripts
  • Create, modify, and delete nodes
  • Position nodes in the node graph
  • Connect nodes together
  • Control playback and rendering
  • Execute arbitrary Python code in Nuke

Components

  1. Nuke Addon (nuke_mcp_addon.py): A Nuke script that creates a socket server within Nuke
  2. MCP Server (nuke_mcp_server.py): A Python server that connects to the Nuke addon and exposes tools to AI systems
  3. Entry Point (main.py): A simple script to start the MCP server

Installation

Prerequisites

  • The Foundry’s Nuke (any recent version should work)
  • Python 3.7+
  • FastMCP package
  • Claude Desktop

Installing the FastMCP package

pip install fastmcp

Installing Nuke-MCP

  1. Clone or download this repository
  2. Copy nuke_mcp_addon.py to your Nuke scripts folder or a location in your Nuke Python path

Usage

Installing the Nuke Addon

  1. Copy the Addon File:

    • Take the nuke_mcp_addon.py file and place it in a location where Nuke can find it:
      • Copy it to your Nuke scripts folder (usually in ~/.nuke/python on Linux/Mac or in your home directory on Windows)
      • Or place it in a folder that’s in your Nuke Python path
  2. Create a Startup Script (Recommended):

    • Create or edit an existing init.py file in your .nuke directory
    • Add the following line to automatically load the addon when Nuke starts and making sure you’re pointing to the python subfolder where the MCP tools live:
      nuke.pluginAddPath("./python")
      
      import nuke_mcp_addon
      
  3. Manual Loading (Alternative):

    • If you don’t want to load it automatically, you can manually load it each time by:
      • Opening Nuke
      • Make sure you have a python subfolder setup in the init.py where the MCP tools live
      • Going to the Script Editor panel
      • Running import nuke_mcp_addon

Docking the NukeMCP Panel

By default, the NukeMCP panel opens as a floating window. If you prefer to have it docked in Nuke’s interface, you can modify the NukeMCPPanel class in nuke_mcp_addon.py:

# Find the NukeMCPPanel class definition (around line 380)
class NukeMCPPanel(nukescripts.PythonPanel):
    def __init__(self):
        nukescripts.PythonPanel.__init__(self, 'Nuke MCP', 'com.example.NukeMCP')
        # ... existing code ...

# Add this method to enable docking
    def addToPane(self):
        pane = nuke.getPaneFor('Properties.1')
        if not pane:
            pane = nuke.getPaneFor('Viewer.1')
        self.setMinimumSize(300, 200)  # Set a reasonable minimum size
        return pane.addPermanentAsQWidget(self)

# Modify the show_panel function to use docking
def show_panel():
    """Show the NukeMCP panel"""
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "nuke": { "command": "python", "args": [ "/path/to/your/nuke-mcp/main.py" ], "trusted": true } } }