Skip to main content
Glama
cfdude

Super Shell MCP Server

get_pending_commands

Retrieve commands awaiting approval for secure execution across Windows, macOS, and Linux systems.

Instructions

Get the list of commands pending approval

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler for the 'get_pending_commands' tool. It fetches pending commands from the CommandService and formats them as JSON text content for the MCP response.
    /** * Handle get_pending_commands tool */ private async handleGetPendingCommands() { const pendingCommands = this.commandService.getPendingCommands(); return { content: [ { type: 'text', text: JSON.stringify(pendingCommands.map(cmd => ({ id: cmd.id, command: cmd.command, args: cmd.args, requestedAt: cmd.requestedAt, requestedBy: cmd.requestedBy, })), null, 2), }, ], }; }
  • src/index.ts:234-241 (registration)
    Registration of the 'get_pending_commands' tool in the list of available tools, including its name, description, and empty input schema.
    { name: 'get_pending_commands', description: 'Get the list of commands pending approval', inputSchema: { type: 'object', properties: {}, }, },
  • Dispatch in the tool call switch statement that routes 'get_pending_commands' calls to the handler function.
    case 'get_pending_commands': return await this.handleGetPendingCommands();
  • Helper method in CommandService that retrieves and returns all pending commands from the internal queue.
    public getPendingCommands(): PendingCommand[] { return Array.from(this.pendingCommands.values()); }
  • TypeScript interface defining the structure of PendingCommand objects returned by the tool.
    export interface PendingCommand { /** Unique ID for the command */ id: string; /** The command to execute */ command: string; /** Arguments for the command */ args: string[]; /** When the command was requested */ requestedAt: Date; /** Who requested the command */ requestedBy?: string; /** Resolve function to call when approved */ resolve: (value: { stdout: string; stderr: string }) => void; /** Reject function to call when denied */ reject: (reason: Error) => void; }

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/super-shell-mcp'

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