From c55dbb3669f11c88324a9a1727ee68ec14f28f35 Mon Sep 17 00:00:00 2001 From: Guillaume ARM Date: Mon, 15 Jun 2026 23:07:09 +0200 Subject: [PATCH] feat: mcp run-file tool available in tools/trap-sandbox --- tools/trap-sandbox/src/modules/mcp/tools.ts | 57 ++++++++++++++++++- .../lua/mcp-server-client.lua | 12 +++- .../trap-sandbox/test-integration/mcp.test.ts | 6 +- tools/trap-sandbox/test/mcp.test.ts | 23 +++++++- 4 files changed, 93 insertions(+), 5 deletions(-) diff --git a/tools/trap-sandbox/src/modules/mcp/tools.ts b/tools/trap-sandbox/src/modules/mcp/tools.ts index bf5043b..188fbf1 100644 --- a/tools/trap-sandbox/src/modules/mcp/tools.ts +++ b/tools/trap-sandbox/src/modules/mcp/tools.ts @@ -9,7 +9,7 @@ import type { GatewayRegistry } from "../trapos-cloud-gateway/registry.js"; export type McpDeps = { registry: GatewayRegistry; accountId: string; - // Default deadline for exec-lua / write-file when the caller omits timeoutMs. + // Default deadline for exec-lua / run-file / write-file when the caller omits timeoutMs. defaultTimeoutMs: number; // Hard ceiling applied to any caller-supplied timeoutMs. maxTimeoutMs: number; @@ -46,6 +46,20 @@ const TOOLS = [ additionalProperties: false, }, }, + { + name: "run-file", + description: "Run a Lua file on a connected TrapOS computer and capture its output.", + inputSchema: { + type: "object", + properties: { + traposId: { type: "string", description: 'Target traposId (":