unblock_command
Restore access to a previously blacklisted command, allowing it to be executed normally within the Desktop Commander MCP server. Use this tool to re-enable blocked terminal commands for seamless operation.
Instructions
Remove a command from the blacklist. Once unblocked, the command can be executed normally.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes |
Implementation Reference
- src/command-manager.ts:43-51 (handler)Core implementation of unblockCommand method in CommandManager class. Trims and lowercases the command, checks if blocked, removes it from the set if present, saves to config file, and returns success boolean.async unblockCommand(command: string): Promise<boolean> { command = command.toLowerCase().trim(); if (!this.blockedCommands.has(command)) { return false; } this.blockedCommands.delete(command); await this.saveBlockedCommands(); return true; }
- src/tools/schemas.ts:27-29 (schema)Zod schema for unblock_command tool input: requires a 'command' string parameter.export const UnblockCommandArgsSchema = z.object({ command: z.string(), });
- src/server.ts:108-113 (registration)Registers 'unblock_command' tool in the MCP server's listTools handler with name, description, and input schema converted to JSON schema.{ name: "unblock_command", description: "Remove a command from the blacklist. Once unblocked, the command can be executed normally.", inputSchema: zodToJsonSchema(UnblockCommandArgsSchema), },
- src/server.ts:243-248 (handler)Switch case in callToolRequest handler that parses input args using the schema and invokes commandManager.unblockCommand, returning the result as MCP content.case "unblock_command": { const parsed = UnblockCommandArgsSchema.parse(args); const unblockResult = await commandManager.unblockCommand(parsed.command); return { content: [{ type: "text", text: unblockResult }], };