list_allowed_commands
Discover which Windows command-line operations are permitted by the secure MCP server to ensure safe and controlled system interactions.
Instructions
List all commands that are allowed to be executed by this server. This helps understand what operations are permitted.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- index.ts:400-442 (handler)Handler implementation for list_allowed_commands tool. Returns a markdown-formatted list of allowed commands based on the operating system (Windows-specific powershell.exe and cmd.exe, or Unix equivalents). Includes platform detection and error handling.async () => { try { if (isWindows) { return { content: [ { type: "text", text: "The following commands are allowed to be executed by this server:\n\n" + "- powershell.exe: Used for most system operations\n" + "- cmd.exe: Used for simple command execution\n\n" + "Note: All commands are executed with the same privileges as the user running this server." }, ], }; } else { return { content: [ { type: "text", text: "Running on non-Windows platform: " + platform() + "\n\n" + "Standard Unix/Linux commands are available, but Windows-specific commands like powershell.exe and cmd.exe are not available in this environment.\n\n" + "The following commands should work:\n" + "- ls: List directory contents\n" + "- ps: List processes\n" + "- uname: Print system information\n" + "- ip: Show network information\n\n" + "Note: All commands are executed with the same privileges as the user running this server." }, ], }; } } catch (error) { return { isError: true, content: [ { type: "text", text: `Error listing allowed commands: ${error}`, }, ], }; } }
- index.ts:396-443 (registration)Registration of the list_allowed_commands tool using server.tool(), including name, description, empty input schema, and inline handler function.server.tool( "list_allowed_commands", "List all commands that are allowed to be executed by this server. This helps understand what operations are permitted.", {}, async () => { try { if (isWindows) { return { content: [ { type: "text", text: "The following commands are allowed to be executed by this server:\n\n" + "- powershell.exe: Used for most system operations\n" + "- cmd.exe: Used for simple command execution\n\n" + "Note: All commands are executed with the same privileges as the user running this server." }, ], }; } else { return { content: [ { type: "text", text: "Running on non-Windows platform: " + platform() + "\n\n" + "Standard Unix/Linux commands are available, but Windows-specific commands like powershell.exe and cmd.exe are not available in this environment.\n\n" + "The following commands should work:\n" + "- ls: List directory contents\n" + "- ps: List processes\n" + "- uname: Print system information\n" + "- ip: Show network information\n\n" + "Note: All commands are executed with the same privileges as the user running this server." }, ], }; } } catch (error) { return { isError: true, content: [ { type: "text", text: `Error listing allowed commands: ${error}`, }, ], }; } } );
- index.ts:399-399 (schema)Input schema for list_allowed_commands: empty object, indicating no parameters are required.{},