get_whitelist
Retrieve the list of approved shell commands that can be executed securely across Windows, macOS, and Linux systems.
Instructions
Get the list of whitelisted commands
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:422-433 (handler)The MCP tool handler for 'get_whitelist' that fetches the whitelist from CommandService and returns it as formatted JSON.private async handleGetWhitelist() { const whitelist = this.commandService.getWhitelist(); return { content: [ { type: 'text', text: JSON.stringify(whitelist, null, 2), }, ], }; }
- src/index.ts:170-177 (registration)Registration of the 'get_whitelist' tool in the ListToolsRequestSchema handler, defining its name, description, and empty input schema.{ name: 'get_whitelist', description: 'Get the list of whitelisted commands', inputSchema: { type: 'object', properties: {}, }, },
- Type definition for CommandWhitelistEntry, the structure of objects in the whitelist 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; }
- Core helper method in CommandService that converts the internal whitelist Map to an array for the tool handler.public getWhitelist(): CommandWhitelistEntry[] { return Array.from(this.whitelist.values()); }