Skip to content

Environment variables

All configuration is through environment variables (no config file), so it works cleanly in CI, Docker and MCP-client config. Every variable is optional and has a sensible default. Set them in your MCP client's server config (the env block), your shell, or the Claude Desktop extension settings.

Server

VariableDefaultDescription
TDMCP_TD_HOST127.0.0.1TouchDesigner bridge host.
TDMCP_TD_PORT9980Web Server DAT port.
TDMCP_TRANSPORTstdioMCP transport: stdio (default) or http (Streamable HTTP).
TDMCP_HTTP_PORT3939Port for the HTTP transport (when TDMCP_TRANSPORT=http).
TDMCP_EVENTSonSubscribe to TD WebSocket events and forward them as MCP logging notifications (on/off).
TDMCP_RAW_PYTHONonWhether to expose the two raw-Python escape-hatch tools (execute_python_script, exec_node_method). Set to off to lock them out for restricted setups. This removes only those two client-authored-code tools — many higher-level tools still send their own templated Python to the bridge, so off is not "no code runs in TD". To actually disable code execution, set TDMCP_BRIDGE_ALLOW_EXEC=0 in TouchDesigner's environment (below).
TDMCP_BRIDGE_TOKEN(unset)Optional shared bearer token. When set, the server sends it and the bridge requires it — set the same value in TouchDesigner's environment to turn auth on.
TDMCP_LOG_LEVELinfodebug / info / warn / error / silent (logged to stderr).
TDMCP_REQUEST_TIMEOUT_MS10000Per-request timeout to the bridge, in milliseconds.
TDMCP_VAULT_PATH(unset)Absolute path to an Obsidian vault (a folder of Markdown notes). Enables the vault tools; a leading ~/ is expanded. Leave unset to disable them.

Local copilot (tdmcp chat)

These configure the local LLM copilot.

VariableDefaultDescription
TDMCP_LLM_BASE_URLhttp://127.0.0.1:11434/v1OpenAI-compatible chat endpoint. Defaults to local Ollama; point it at LM Studio, a cloud GPU or a paid API.
TDMCP_LLM_MODELqwen2.5:3bModel id the copilot requests (must be pulled in the backend, e.g. ollama pull qwen2.5:3b). Bump to qwen2.5:7b for more headroom.
TDMCP_LLM_API_KEY(unset)Optional bearer token for the LLM endpoint (ignored by local Ollama; needed for paid/cloud APIs).
TDMCP_CHAT_PORT4141Loopback port the tdmcp chat web UI binds to.

TouchDesigner side

Set these in TouchDesigner's environment (not the server's) for defense in depth — they are enforced bridge-side, even for direct network callers. See Security.

VariableDefaultDescription
TDMCP_BRIDGE_ALLOW_EXEC1Set to 0/false/off to make the bridge refuse the arbitrary-code endpoints (/api/exec, node method). The structured endpoints keep working.
TDMCP_BRIDGE_TOKEN(unset)Shared bearer token; must match the server's value to authorize requests.

Example: MCP client config

json
{
  "mcpServers": {
    "tdmcp": {
      "command": "node",
      "args": ["/abs/path/to/tdmcp/dist/index.js"],
      "env": {
        "TDMCP_TD_PORT": "9980",
        "TDMCP_VAULT_PATH": "~/Documents/MyVault"
      }
    }
  }
}