Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:8beeeaaat Touchdesigner mcp TouchDesignerServer

From Leeroopedia
Knowledge Sources
Domains MCP_Server, Dependency_Injection
Last Updated 2026-10-28 00:00 GMT

Overview

Concrete tool for creating MCP server instances that register all TouchDesigner tools and prompts with a dependency-injected client and logger.

Description

The TouchDesignerServer class wraps the SDK v2 McpServer with TouchDesigner-specific feature registration. Its constructor creates an McpServer with the "TouchDesigner" name and version, a ConsoleLogger, a TouchDesignerClient (injectable), and a ConnectionManager. It then calls registerAllFeatures which registers all MCP prompts and tools against the server. The static create factory returns the inner McpServer instance ready for connection to a transport — used per-request in HTTP mode and per-connection in stdio mode.

Usage

Use TouchDesignerServer.create() as the server factory passed to serveStdio or ExpressHttpManager. Inject a custom tdClient when you need to share a single client across requests (HTTP mode).

Code Reference

Source Location

Signature

export class TouchDesignerServer {
  readonly server: McpServer;
  readonly logger: ILogger;
  readonly tdClient: TouchDesignerClient;

  constructor(params?: TouchDesignerServerParams);

  static create(params?: TouchDesignerServerParams): McpServer;

  async connect(transport: Transport): Promise<Result<void, Error>>;
  async disconnect(): Promise<Result<void, Error>>;
  isConnectedToMCP(): boolean;
}

Import

import { TouchDesignerServer } from "./server/touchDesignerServer.js";

I/O Contract

Inputs

Name Type Required Description
tdClient TouchDesignerClient No Injected client (defaults to createTouchDesignerClient)

Outputs

Name Type Description
server McpServer SDK server with tools+prompts registered
connect() Result<void, Error> Connects to a Transport via ConnectionManager

Usage Examples

Stdio mode factory

import { serveStdio } from "@modelcontextprotocol/server/stdio";
import { TouchDesignerServer } from "./server/touchDesignerServer.js";

// Each connection gets a fresh server instance.
serveStdio(() => TouchDesignerServer.create());

HTTP mode with shared client

import { TouchDesignerServer } from "./server/touchDesignerServer.js";
import { createTouchDesignerClient } from "./tdClient/index.js";
import { ConsoleLogger } from "./core/logger.js";

const logger = new ConsoleLogger();
const tdClient = createTouchDesignerClient({ logger });

// Reuse one tdClient (with cached compatibility) across requests.
const factory = () => TouchDesignerServer.create({ tdClient });

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment