MCP Server
v2.0.0
What's new
See LOPs 0.1.1 Full changelog →
MCP Server v2.0.0 [ September 2, 2025 ]
- MCP Config integration with centralized server management
- Load/Save server UI with Current Server dropdown
- Auto-start functionality for configuration loading
- Connection settings persistence and port management
- Built-in server protection preventing disk saves
- Improved dependency detection with importlib.metadata
- Surgical venv path insertion resolving sys.path conflicts
The MCP Server LOP acts as a server that exposes Python functions from a DAT as “tools” that can be called by AI agents and other external applications using the Model Context Protocol (MCP). This allows you to create custom, remotely-callable APIs directly within your TouchDesigner project.
It leverages the fastmcp library to handle the server logic, simplifying the process of creating MCP-compatible tools. It can communicate over stdio or streamable-http, making your TouchDesigner functions accessible to a wide range of MCP clients.
Requirements
Section titled “Requirements”- Python Packages:
fastmcp: The core library for the MCP server.aiohttp: Required for thestreamable-httptransport mode.
- ChatTD Operator: Required for dependency management (installing packages) and asynchronous operations.
Parameters
Section titled “Parameters”Page: MCP Server
Section titled “Page: MCP Server” Status (Status)
op('mcp_server').par.Status - Default:
"" (Empty String)
Start Server (Startserver)
op('mcp_server').par.Startserver - Default:
None
Stop Server (Stopserver)
op('mcp_server').par.Stopserver - Default:
None
Restart Server (Restartserver)
op('mcp_server').par.Restartserver - Default:
None
Running (Running)
op('mcp_server').par.Running - Default:
false
Transport (Transport)
op('mcp_server').par.Transport - Default:
streamable-http
Host (Host)
op('mcp_server').par.Host - Default:
0.0.0.0
Port (Port)
op('mcp_server').par.Port - Default:
18555
Server Code DAT (Serverdat)
op('mcp_server').par.Serverdat - Default:
None
Edit (open external) (Editserverdat)
op('mcp_server').par.Editserverdat - Default:
None
View (View)
op('mcp_server').par.View - Default:
docked
Copy Config (Copyconfig)
op('mcp_server').par.Copyconfig - Default:
None
Page: Config
Section titled “Page: Config” Current Server (Currentserver)
op('mcp_server').par.Currentserver - Default:
Basic
Load Server (Loadserver)
op('mcp_server').par.Loadserver - Default:
None
Auto Start on Load (Autostart)
op('mcp_server').par.Autostart - Default:
True
Save Server (Saveserver)
op('mcp_server').par.Saveserver - Default:
None
Page: Install / Debug
Section titled “Page: Install / Debug” Status (Status2)
op('mcp_server').par.Status2 - Default:
"" (Empty String)
Install Dependencies (Installdeps)
op('mcp_server').par.Installdeps - Default:
None
Check Dependencies (Checkdeps)
op('mcp_server').par.Checkdeps - Default:
None
Page: About
Section titled “Page: About” Bypass (Bypass)
op('mcp_server').par.Bypass - Default:
false
Show Built-in Parameters (Showbuiltin)
op('mcp_server').par.Showbuiltin - Default:
false
Version (Version)
op('mcp_server').par.Version - Default:
"" (Empty String)
Last Updated (Lastupdated)
op('mcp_server').par.Lastupdated - Default:
"" (Empty String)
Creator (Creator)
op('mcp_server').par.Creator - Default:
"" (Empty String)
Website (Website)
op('mcp_server').par.Website - Default:
"" (Empty String)
ChatTD Operator (Chattd)
op('mcp_server').par.Chattd - Default:
None
Usage Examples
Section titled “Usage Examples”Basic Server Setup
Section titled “Basic Server Setup”- Create an
mcp_serveroperator. - On the
Install / Debugpage, pulse theInstall Dependenciesparameter to installfastmcpandaiohttp. - On the
MCP Serverpage, pulse theStart Serverparameter. - The
Statusparameter should change to indicate that the server is running.
Creating a Custom Tool
Section titled “Creating a Custom Tool”- On the
MCP Serverpage, pulse theEdit (open external)parameter to open theserver_codeDAT. - In the
server_codeDAT, define a Python function that will be your tool. - Use the
@mcp.tool()decorator to expose the function as a tool. - Restart the server by pulsing the
Restart Serverparameter.
from fastmcp import Mcp, Tool, tool
mcp = Mcp()
@mcp.tool()def get_operator_info(name: str) -> str: """Get information about a TouchDesigner operator.""" op = op(name) if op: return f"Operator {name} is a {op.OPType} at {op.path}" else: return f"Operator {name} not found"Connecting an Agent to the Server
Section titled “Connecting an Agent to the Server”- Create an
agentoperator. - On the
Toolspage of theagent, enableUse LOP Tools. - Connect the
mcp_serveroperator to theExternal Op Toolsparameter on theagent. - Start a conversation with the
agentand ask it to use the tool you created (e.g., “Get information about the operator /project1/noise1”).