Skip to main content
Glama

get_whitelist

Retrieve the list of whitelisted commands approved for secure execution on macOS through the Mac Shell MCP Server, ensuring controlled and authorized command usage.

Instructions

Get the list of whitelisted commands

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • The handler function for the 'get_whitelist' tool. It calls commandService.getWhitelist() and returns the whitelist as a formatted JSON string in the MCP response format.
    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 listTools response, including name, description, and empty input schema.
    { name: 'get_whitelist', description: 'Get the list of whitelisted commands', inputSchema: { type: 'object', properties: {}, }, },
  • Helper method in CommandService that retrieves and returns all whitelisted command entries from the internal Map.
    public getWhitelist(): CommandWhitelistEntry[] { return Array.from(this.whitelist.values()); }
  • Type definition for CommandWhitelistEntry, which structures the whitelist data returned by getWhitelist().
    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; }

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/cfdude/mac-shell-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server