remove_from_whitelist
Remove a specified command from the whitelist on the Mac Shell MCP Server to restrict its execution, ensuring secure terminal command management.
Instructions
Remove a command from the whitelist
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | The command to remove from whitelist |
Input Schema (JSON Schema)
{
"properties": {
"command": {
"description": "The command to remove from whitelist",
"type": "string"
}
},
"required": [
"command"
],
"type": "object"
}
Implementation Reference
- src/index.ts:393-410 (handler)The MCP tool handler for 'remove_from_whitelist'. Parses input arguments using Zod, calls CommandService.removeFromWhitelist(command), and returns a success message.private async handleRemoveFromWhitelist(args: unknown) { const schema = z.object({ command: z.string(), }); const { command } = schema.parse(args); this.commandService.removeFromWhitelist(command); return { content: [ { type: 'text', text: `Command '${command}' removed from whitelist`, }, ], }; }
- src/index.ts:161-174 (registration)Tool registration in the ListTools response, defining name, description, and input schema for 'remove_from_whitelist'.{ name: 'remove_from_whitelist', description: 'Remove a command from the whitelist', inputSchema: { type: 'object', properties: { command: { type: 'string', description: 'The command to remove from whitelist', }, }, required: ['command'], }, },
- src/index.ts:394-396 (schema)Zod schema for input validation in the handler.const schema = z.object({ command: z.string(), });
- Core implementation that removes the command from the internal whitelist Map.public removeFromWhitelist(command: string): void { this.whitelist.delete(command); }