get_whitelist
Retrieve the list of approved macOS terminal commands that can be securely executed through the Mac Shell MCP Server's whitelisting system.
Instructions
Get the list of whitelisted commands
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:310-321 (handler)The handler function for the 'get_whitelist' MCP tool call. It retrieves the whitelist from the CommandService and returns it as a JSON-formatted text content block.private async handleGetWhitelist() { const whitelist = this.commandService.getWhitelist(); return { content: [ { type: 'text', text: JSON.stringify(whitelist, null, 2), }, ], }; }
- src/index.ts:111-118 (registration)Registration of the 'get_whitelist' tool in the MCP server's listTools response, including name, description, and empty input schema.{ name: 'get_whitelist', description: 'Get the list of whitelisted commands', inputSchema: { type: 'object', properties: {}, }, },
- Type definition for CommandWhitelistEntry, which represents the structure of whitelist entries returned by get_whitelist.export interface CommandWhitelistEntry { /** The command path or name */ command: string; /** Security level of the command */ securityLevel: CommandSecurityLevel; /** Allowed arguments (string for exact match, RegExp for pattern match) */ allowedArgs?: Array<string | RegExp>; /** Description of the command for documentation */ description?: string; }
- The getWhitelist method in CommandService that returns the array of all whitelisted commands from the internal Map.public getWhitelist(): CommandWhitelistEntry[] { return Array.from(this.whitelist.values()); }