bash
Execute bash commands on specified instances within the Scrapybara MCP server to manage and control virtual Ubuntu desktops efficiently.
Instructions
Run a bash command in a Scrapybara instance.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | The command to run in the instance shell. | |
| instance_id | Yes | The ID of the instance to run the command on. |
Implementation Reference
- src/index.ts:181-204 (handler)Handler for the 'bash' MCP tool: parses arguments using BashSchema, retrieves the Scrapybara instance, executes the bash command via instance.bash(), and returns the response.case "bash": { const args = BashSchema.parse(request.params.arguments); const instance = await client.get(args.instance_id, { abortSignal: currentController.signal, }); if ("bash" in instance) { const response = await instance.bash( { command: args.command }, { abortSignal: currentController.signal } ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2), } as TextContent, ], }; } else { throw new Error("Instance does not support bash commands"); } }
- src/schemas.ts:18-23 (schema)Zod schema for 'bash' tool input: requires instance_id and command.export const BashSchema = z.object({ instance_id: z .string() .describe("The ID of the instance to run the command on."), command: z.string().describe("The command to run in the instance shell."), });
- src/index.ts:89-92 (registration)Registration of the 'bash' tool in the ListTools response, providing name, description, and input schema.name: "bash", description: "Run a bash command in a Scrapybara instance.", inputSchema: zodToJsonSchema(BashSchema), },