Skip to content

LOPs + MCP (Model Context Protocol)

The Model Context Protocol (MCP) is an open standard designed to let AI models (like those used by the Agent LOP) interact with external tools, data sources (resources), and predefined prompts. It uses a client-server architecture:

  • MCP Servers: Separate applications that provide specific capabilities (e.g., accessing files, querying databases, searching the web, running code).
  • MCP Client: An application (like this LOPS component) that connects to one or more MCP servers, discovers their capabilities, and brokers interactions between the AI model and the servers.

This MCP Client LOP acts as the central hub within TouchDesigner for managing connections to MCP servers. Its goal is to enable LOPS Agents to leverage external tools and information seamlessly.

Communication typically happens via JSON-RPC messages over standard input/output (stdio) of server processes launched by the client.

Once fully integrated, the workflow will be:

  1. Configuration: You configure which MCP servers the client should connect to using a mcp_servers.json file.
  2. Connection: The MCP Client LOP connects to the configured servers.
  3. Tool Discovery: The Agent LOP (or other LOPS operators) will query this MCP Client LOP to get a list of available tools from all connected servers.
  4. AI Interaction: The Agent will inform the underlying AI model about the available tools (name, description, expected inputs).
  5. Tool Invocation: When the AI model decides to use a tool, the Agent will instruct this MCP Client LOP to execute the tool call on the appropriate connected server.
  6. Result Handling: The MCP Client LOP receives the result from the server and passes it back to the Agent, which then feeds it back into the AI model’s context to continue the conversation.

This will allow you to extend the capabilities of the Agent LOP significantly by connecting it to file systems, web search, code execution environments, custom databases, and more, simply by running the corresponding MCP servers.

Connections to MCP servers are managed through a JSON configuration file. You specify the path to this file in the Config File Path parameter and then use the Load Config pulse.

The JSON file should contain a list under the servers key. Each entry defines a server to connect to.

Example mcp_servers.json:

{
"servers": [
{
"name": "FileSystem",
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"./MCP/data"
],
"id": "filesystem_1",
"always_allow": true,
"transport": "stdio"
},
{
"name": "SequentialThinking",
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-sequentialthinking"
],
"id": "seq_think_1",
"always_allow": true,
"transport": "stdio"
}
// Add more server configurations here
]
}
  • name: A user-friendly name for the server.
  • type: Usually stdio for servers launched as local processes.
  • command: The executable to run (e.g., npx, python, path to binary).
  • args: A list of arguments to pass to the command. Note the use of -y with npx to auto-install server packages if needed. The last argument for server-filesystem is the directory it should manage.
  • id: (Optional) A unique identifier for the server connection.
  • always_allow: (Not currently used by this client) Intended for auto-approving tool calls.
  • transport: Specifies the communication method, typically stdio.

After editing the JSON file, pulse the Load Config parameter on the Connection page to update the list of available servers shown in the sessions table inside the component.

  1. Define Servers: Add server definitions to your mcp_servers.json file.
  2. Load Config: Pulse the Load Config parameter. The defined servers will appear in the internal sessions table with a status of saved.
  3. Connect: Use the ConnectByName method in the extension (or potentially future UI elements) to initiate a connection to a specific server listed in the sessions table. The client will attempt to launch the server process as defined in the config.

Alternatively, for specific built-in or common servers:

  • File Server: Pulse Connect to File Server on the Debug page to directly launch and connect to the official @modelcontextprotocol/server-filesystem, using the path specified in File System Directory. This is useful for quick testing without editing the JSON config.
  • MCP Inspector: Use Launch Web Inspector to open the Inspector’s web UI and Connect Inspector to establish a test connection to the Inspector running in server mode (useful for debugging MCP interactions). Requires npm install -g @modelcontextprotocol/inspector.)
  • Status: The Connected toggle indicates if any MCP server session is active. The NumServers, NumTools, NumResources, and NumPrompts parameters show the total count across all connected sessions.
  • Sessions Table: The internal sessions table lists all configured and connected servers, their status (saved, connecting, connected, failed, disconnected), command, args, and capability counts.
  • Tools/Resources/Prompts Tables: The internal tools, resources, and prompts tables provide detailed listings of all capabilities discovered from connected servers.
  • Logs: Operations, connections, errors, and communication details are logged. Use the Show Logs parameter to filter the view and Open Log / Clear Log for management.
Load Config (Loadconfig) op('mcp').par.Loadconfig Pulse
Default:
None
Config File Path (Configfile) op('mcp').par.Configfile File
Default:
D:/TD-tox/LOPS_tox/GITsync/MCP/config/mcp_servers.json
Edit Config File (Editconfig) op('mcp').par.Editconfig Pulse
Default:
None
Disconnect from MCP (Disconnect) op('mcp').par.Disconnect Pulse
Default:
None
Refresh MCP Data (Refreshmcp) op('mcp').par.Refreshmcp Pulse
Default:
None
Connected (Connected) op('mcp').par.Connected Toggle
Default:
off
Num Servers (Numservers) op('mcp').par.Numservers Int
Default:
0
Available Tools (Numtools) op('mcp').par.Numtools Int
Default:
0
Available Resources (Numresources) op('mcp').par.Numresources Int
Default:
0
Available Prompts (Numprompts) op('mcp').par.Numprompts Int
Default:
0
Default Tool Strategy (Defaulttoolstrategy) op('mcp').par.Defaulttoolstrategy Menu
Default:
All
Options:
All, Selected, None
Selected Tools (Selectedtools) op('mcp').par.Selectedtools StrMenu
Default:
read_file,list_directory
Menu Options:
  • name1 (name1)
  • name2 (name2)
  • name3 (name3)
Open Log (Openlog) op('mcp').par.Openlog Pulse
Default:
None
Show Logs (Showlogs) op('mcp').par.Showlogs Menu
Default:
All Logs
Options:
Basic, All Logs, Errors Only
Clear Log (Clearlog) op('mcp').par.Clearlog Pulse
Default:
None
Launch Web Inspector (Launchwebinspector) op('mcp').par.Launchwebinspector Pulse
Default:
None
MCP Inspector Server (Connectinspector) op('mcp').par.Connectinspector Pulse
Default:
None
Connect to File Server (Connectfileserver) op('mcp').par.Connectfileserver Pulse
Default:
None
File System Directory (Filesystemdirectory) op('mcp').par.Filesystemdirectory Folder
Default:
C:/Users/DotSimulate/Downloads/test_repo/dotBOT
Connection Timeout (s) (Connectiontimeout) op('mcp').par.Connectiontimeout Int
Default:
30
Tool Call Timeout (s) (Tooltimeout) op('mcp').par.Tooltimeout Int
Default:
60
Bypass (Bypass) op('mcp').par.Bypass Toggle
Default:
off
Show Built-in Parameters (Showbuiltin) op('mcp').par.Showbuiltin Toggle
Default:
off
Version (Version) op('mcp').par.Version Str
Default:
0.0.11
Last Updated (Lastupdated) op('mcp').par.Lastupdated Str
Default:
2025-05-05
Creator (Creator) op('mcp').par.Creator Str
Default:
dotsimulate
Website (Website) op('mcp').par.Website Str
Default:
https://dotsimulate.com
ChatTD Operator (Chattd) op('mcp').par.Chattd OP
Default:
/dot_lops/ChatTD