Description
To realise Expert Insights on a remote instance, support must be present over the existing MQTT connection.
The proposal is to extend the device-agent's MQTT command channel with three new commands that relay MCP calls to MCP servers hosted inside the device's Node-RED instance:
mcp:get-features - discover capabilities, tools, resources, resource templates and prompts across one or more MCP endpoints.
mcp:call-tool - invoke a named tool on a given endpoint with arguments.
mcp:read-resource - read a named resource from a given endpoint.
I propose a new MCP helper class (packages/device-agent/lib/mcp.js) wraps the functionality of the @modelcontextprotocol/sdk Client and StreamableHTTPClientTransport such that the MQTT handler simply calls this.mcp.getFeatures(msg.payload?.mcpEndPoints)
Additionally, to minimise timeouts, I also propose device agent also supports a new command get-liveState - this provides parity with the instance models liveState() function and will prevent unnecessary calls (and subsequent timeouts) when the mcp:get-features request is made.
NOTE: Coupled with the centrally bridged MQTT Broker for Expert, this will provide a path enabling Insights on self hosted devices too.
Epic/Story
No response
Description
To realise Expert Insights on a remote instance, support must be present over the existing MQTT connection.
The proposal is to extend the device-agent's MQTT command channel with three new commands that relay MCP calls to MCP servers hosted inside the device's Node-RED instance:
mcp:get-features- discover capabilities, tools, resources, resource templates and prompts across one or more MCP endpoints.mcp:call-tool- invoke a named tool on a given endpoint with arguments.mcp:read-resource- read a named resource from a given endpoint.I propose a new MCP helper class (packages/device-agent/lib/mcp.js) wraps the functionality of the @modelcontextprotocol/sdk Client and StreamableHTTPClientTransport such that the MQTT handler simply calls
this.mcp.getFeatures(msg.payload?.mcpEndPoints)Additionally, to minimise timeouts, I also propose device agent also supports a new command
get-liveState- this provides parity with the instance modelsliveState()function and will prevent unnecessary calls (and subsequent timeouts) when the mcp:get-features request is made.NOTE: Coupled with the centrally bridged MQTT Broker for Expert, this will provide a path enabling Insights on self hosted devices too.
Epic/Story
No response