TouchDesigner MCP

Integrations

  • Required for code generation during development, used to generate API client/server schemas for the TouchDesigner integration.

  • Required runtime environment for the TouchDesigner MCP server, enabling the bridge between AI models and TouchDesigner.

  • Used within TouchDesigner for scripting and controlling nodes, allowing AI agents to execute Python code to manipulate TouchDesigner projects.

タッチデザイナーMCP

これはTouchDesigner用のMCP(Model Context Protocol)サーバーの実装です。AIエージェントがTouchDesignerプロジェクトを制御・操作できるようにすることを目的としています。

英語/日本語

概要

TouchDesigner MCP は、AI モデルと TouchDesigner WebServer DAT 間のブリッジとして機能し、AI エージェントが次のことを実行できるようにします。

  • ノードの作成、変更、削除
  • クエリノードのプロパティとプロジェクト構造
  • PythonスクリプトでTouchDesignerをプログラム的に制御する

使用法

Node.jsのインストールが必要です

1. touchdesigner-mcp-serverパッケージをインストールする

mkdir some && cd ./some (必要な場合) npm install touchdesigner-mcp-server

2. TouchDesignerに接続する

TouchDesignerにmcp_webserver_base.toxを配置する

TouchDesignerを起動し、 td/mcp_webserver_base.toxコンポーネントをTouchDesignerプロジェクトの直下にインポートします。例: /project1/mcp_webserver_baseに配置します。

tox をインポートすると、API サーバー コントローラーなどのモジュールをロードするtd/import_modules.pyスクリプトがトリガーされます。

TouchDesigner メニューから Textport を開くと、ブート ログを確認できます。

3. TouchDesigner MCPサーバーを構成する

TouchDesigner を実行している状態で、AI エージェント (Claude Desktop、Cursor、VSCode CopilotChat など) を MCP サーバーに接続するように構成します。

例: クロードデスクトップ

{ "mcpServers": { "touchdesigner": { "args": [ "/path/to/your/node_modules/touchdesigner-mcp-server/dist/index.js", // <-- Replace with the absolute path to node_modules/touchdesigner-mcp-server/dist/index.js "--stdio" ], "command": "node", "transportType": "stdio" } } }

Windows システムの場合は、C: などのドライブ文字を含めてください (例: C:\\path\\to\\your\\node_modules\\touchdesigner-mcp-server\\dist\\index.js

MCPサーバーが認識されればセットアップは完了です。認識されない場合はエージェントを再起動してください。起動時にエラーが表示される場合は、TouchDesignerを起動した後にエージェントを再度起動してみてください。TouchDesignerでAPIサーバーが動作している場合、エージェントは付属のツールを介してTouchDesignerを利用できます。

MCP サーバーの機能

このサーバーは、モデル コンテキスト プロトコル (MCP) を介して TouchDesigner での操作を可能にし、さまざまな実装ドキュメントへの参照を提供します。

ツール

ツールを使用すると、AI エージェントは TouchDesigner でアクションを実行できます。

ツール名説明
create_td_node新しいノードを作成します。
delete_td_node既存のノードを削除します。
exec_node_methodノード上で Python メソッドを呼び出します。
execute_python_scriptTD で任意の Python スクリプトを実行します。
get_td_class_detailsTD Python クラス/モジュールの詳細を取得します。
get_td_classesTouchDesigner Python クラスのリストを取得します。
get_td_infoTD サーバー環境に関する情報を取得します。
get_td_node_parameters特定のノードのパラメータを取得します。
get_td_nodes親パスの下のノードを取得します (オプションでフィルタリング可能)。
update_td_node_parameters特定のノードのパラメータを更新します。

プロンプト

プロンプトは、AI エージェントに TouchDesigner で特定のアクションを実行するための指示を提供します。

プロンプト名説明
Search nodeノードをあいまい検索し、名前、ファミリ、タイプに基づいて情報を取得します。
Node connectionTouchDesigner 内でノードを接続するための手順を提供します。
Check node errors指定されたノードのエラーをチェックし、子ノードがある場合は再帰的にチェックします。

リソース

実装されていません

開発者向け

MCP サーバーコードの構築

  1. リポジトリをクローンする
git clone https://github.com/8beeeaaat/touchdesigner-mcp.git
  1. 依存関係をインストールする
cd touchdesigner-mcp npm install
  1. 環境ファイルの設定とビルド
# Copy the template and adjust TD_WEB_SERVER_URL as needed cp dotenv .env # Build the project (generates API client/server schemas and compiles MCP resources) # Make sure the Docker daemon is running before executing this command npm run build

TouchDesignerのセットアップ

1.コード生成:

npm run build実行して次のコードを生成します。

  • MCP サーバーコード
  • TouchDesigner WebServer DAT の API サーバー コード
2. MCP サーバーの WebServer を TouchDesigner にインポートします。

TouchDesignerを起動し、 td/mcp_webserver_base.toxコンポーネントをプロジェクトの直下にインポートします。toxをインポートすると、 td/import_modules.pyスクリプトが起動し、APIサーバーコントローラーなどのモジュールが読み込まれます。

3. API サーバーの動作を確認します。

td/modulesディレクトリ内の Python モジュールがmcp_webserver_baseコンポーネントからアクセスできることを確認してくださいnpm run testを実行して、MCP サーバーコードと TouchDesigner 接続の単体テストと統合テストを実行してください。通信ログは、TouchDesigner メニューから Textport を開くことで確認できます。

npm run devを使用して @modelcontextprotocol/inspector でデバッグできます。

TIPS mcp_webserver_base.toxには、MCPサーバーとTouchDesignerをリンクするように設定されたWebServer DATが含まれています。このDATがアクティブで、 .envファイルのTD_WEB_SERVER_URLで指定されたポート(デフォルト: 9981 )で実行されていることを確認してください。ポートを変更するには、以下の手順を実行してください。

  1. .envTD_WEB_SERVER_PORT変更する
  2. npm run buildを再実行します。
  3. mcp_webserver_base (WebServer DAT) のポート番号を変更し、DAT を再起動します。

MCP対応AIエージェントとの接続

TouchDesigner を実行している状態で、AI エージェント (Cursor、Claude Desktop、VSCode CopilotChat など) を MCP サーバーに接続するように構成します。

例: クロードデスクトップ
{ "mcpServers": { "dev_touchdesigner": { "args": [ "/path/to/your/touchdesigner-mcp/dist/index.js", // <-- Replace with the absolute path to /dist/index.js after build "--stdio" ], "command": "node", "transportType": "stdio" } } }

Windows システムの場合は、C: などのドライブ文字を含めてください (例: C:\\path\\to\\your\\touchdesigner-mcp\\dist\\index.js

セットアップ後のプロジェクト構造

├── src/ # MCP server source code │ ├── api/ # OpenAPI spec for TD WebServer │ ├── core/ # Core utilities (logger, error handling) │ ├── features/ # MCP feature implementations │ │ ├── prompts/ # Prompt handlers │ │ ├── resources/ # Resource handlers │ │ └── tools/ # Tool handlers (e.g., tdTools.ts) │ ├── gen/ # Code generated from OpenAPI schema for MCP server │ ├── server/ # MCP server logic (connections, main server class) │ ├── tdClient/ # TD connection API client │ ├── index.ts # Main entry point for Node.js server │ └── ... ├── td/ # TouchDesigner related files │ ├── modules/ # Python modules for TouchDesigner │ │ ├── mcp/ # Core logic for handling MCP requests in TD │ │ │ ├── controllers/ # API request controllers (api_controller.py, generated_handlers.py) │ │ │ └── services/ # Business logic (api_service.py) │ │ ├── td_server/ # Python model code generated from OpenAPI schema │ │ └── utils/ # Shared Python utilities │ ├── templates/ # Mustache templates for Python code generation │ ├── genHandlers.js # Node.js script for generating generated_handlers.py │ ├── import_modules.py # Helper script to import API server modules into TD │ └── mcp_webserver_base.tox # Main TouchDesigner component ├── tests/ # Test code │ ├── integration/ │ └── unit/ ├── .env # Local environment variables (git ignored) ├── dotenv # Template for .env └── orval.config.ts # Orval config (TS client generation)

APIコード生成ワークフロー

このプロジェクトでは、OpenAPI ベースのコード生成ツール (Orval / openapi-generator-cli) を使用します。

API 定義: Node.js MCP サーバーと TouchDesigner 内で実行される Python サーバー間の API 契約はsrc/api/index.ymlで定義されます。

  1. Python サーバー生成 ( npm run gen:webserver ):
    • Docker 経由でopenapi-generator-cliを使用します。
    • src/api/index.ymlを読み取ります。
    • API定義に基づいてPythonサーバーのスケルトン( td/modules/td_server/ )を生成します。このコードはWebServer DATを介してTouchDesigner内で実行されます。
    • Docker がインストールされ、実行されている必要があります。
  2. Python ハンドラー生成 ( npm run gen:handlers ):
    • カスタム Node.js スクリプト ( td/genHandlers.js ) と Mustache テンプレート ( td/templates/ ) を使用します。
    • 生成された Python サーバー コードまたは OpenAPI 仕様を読み取ります。
    • td/modules/mcp/services/api_service.py``td/modules/mcp/controllers/generated_handlers.py ) を生成します。
  3. TypeScript クライアントの生成 ( npm run gen:mcp ):
    • Orvalを使用して、 openapi-generator-cliによってバンドルされたスキーマ YAML から、ツール検証用の API クライアント コードと Zod スキーマを生成します。
    • Node.js サーバーが WebServer DAT にリクエストを行うために使用する、型指定された TypeScript クライアント ( src/tdClient/ ) を生成します。

ビルド プロセス ( npm run build ) では、必要なすべての生成ステップ ( npm run gen ) が実行され、その後に TypeScript コンパイル ( tsc ) が実行されます。

貢献

皆様のご協力をお待ちしております!

  1. リポジトリをフォークする
  2. 機能ブランチを作成する ( git checkout -b feature/amazing-feature )
  3. 変更を加える
  4. テストを追加してすべてが機能することを確認する( npm test
  5. 変更をコミットします ( git commit -m 'Add some amazing feature' )
  6. ブランチにプッシュします ( git push origin feature/amazing-feature )
  7. プルリクエストを開く

実装を変更するときは、常に適切なテストを含めてください。

ライセンス

マサチューセッツ工科大学

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

AI エージェントがノードとプロジェクト構造の作成、変更、クエリを通じて TouchDesigner プロジェクトを制御および操作できるようにするモデル コンテキスト プロトコル サーバー。

  1. 概要
    1. 使用法
      1. 1. touchdesigner-mcp-serverパッケージをインストールする
      2. 2. TouchDesignerに接続する
      3. 3. TouchDesigner MCPサーバーを構成する
    2. MCP サーバーの機能
      1. ツール
      2. プロンプト
      3. リソース
    3. 開発者向け
      1. MCP サーバーコードの構築
      2. TouchDesignerのセットアップ
      3. MCP対応AIエージェントとの接続
      4. セットアップ後のプロジェクト構造
      5. APIコード生成ワークフロー
    4. 貢献
      1. ライセンス

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          A Model Context Protocol server that allows AI assistants to interact with Appwrite's API, providing tools to manage databases, users, functions, teams, and other resources within Appwrite projects.
          Last updated -
          84
          36
          Python
          MIT License
          • Linux
          • Apple
        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol server that enables AI agents to interact with ClickUp workspaces, allowing task creation, management, and workspace organization through natural language commands.
          Last updated -
          203
          MIT License
        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol server that enables AI assistants to interact with Fingertip's site management capabilities, allowing them to list, view details of, and create websites.
          Last updated -
          1
          TypeScript
          MIT License
        • -
          security
          -
          license
          -
          quality
          A Model Context Protocol server implementation that enables AI assistants to interact with Linear project management systems, allowing them to create, retrieve, and modify data related to issues, projects, teams, and users.
          Last updated -
          20
          2
          TypeScript

        View all related MCP servers

        ID: llzbz83vrf