Skip to main content
Glama

Super Shell MCP Server

get_platform_info

Retrieve details about the current platform and shell environment to identify system configurations and ensure compatibility across Windows, macOS, and Linux.

Instructions

Get information about the current platform and shell

Input Schema

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

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

Implementation Reference

  • The main handler function that executes the get_platform_info tool logic. It dynamically imports platform utilities, detects the platform, gets shell info from CommandService, and returns formatted JSON response.
    private async handleGetPlatformInfo() { const { detectPlatform, getShellSuggestions, getCommonShellLocations } = await import('./utils/platform-utils.js'); const platform = detectPlatform(); const currentShell = this.commandService.getShell(); const shellExecutionEnabled = this.commandService.isShellEnabled(); const suggestedShells = getShellSuggestions()[platform]; const commonLocations = getCommonShellLocations(); return { content: [ { type: 'text', text: JSON.stringify({ platform, currentShell, shellExecutionEnabled, suggestedShells, commonLocations, helpMessage: shellExecutionEnabled ? `Super Shell MCP is running on ${platform} using ${currentShell} with shell parsing enabled.` : `Super Shell MCP is running on ${platform} executing commands without shell parsing.`, }, null, 2), }, ], }; }
  • src/index.ts:141-148 (registration)
    Registration of the get_platform_info tool in the ListToolsRequestHandler, including name, description, and empty input schema (no parameters required).
    { name: 'get_platform_info', description: 'Get information about the current platform and shell', inputSchema: { type: 'object', properties: {}, }, },
  • Input schema definition for get_platform_info tool: an empty object since no input parameters are required.
    inputSchema: { type: 'object', properties: {}, },
  • Helper function to detect the current operating system platform (Windows, macOS, Linux, or unknown). Used by the handler.
    export function detectPlatform(): PlatformType { const platform = process.platform; if (platform === 'win32') return PlatformType.WINDOWS; if (platform === 'darwin') return PlatformType.MACOS; if (platform === 'linux') return PlatformType.LINUX; return PlatformType.UNKNOWN; }
  • Helper function providing suggested shell executables for each platform. Used by the handler.
    export function getShellSuggestions(): Record<PlatformType, string[]> { return { [PlatformType.WINDOWS]: ['cmd.exe', 'powershell.exe', 'pwsh.exe'], [PlatformType.MACOS]: ['/bin/zsh', '/bin/bash', '/bin/sh'], [PlatformType.LINUX]: ['/bin/bash', '/bin/sh', '/bin/zsh'], [PlatformType.UNKNOWN]: ['/bin/sh'] }; }
  • Helper function providing common shell file paths for the current platform. Used by the handler.
    export function getCommonShellLocations(): string[] { const platform = detectPlatform(); switch (platform) { case PlatformType.WINDOWS: return [ process.env.COMSPEC || 'C:\\Windows\\System32\\cmd.exe', 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe', 'C:\\Program Files\\PowerShell\\7\\pwsh.exe' ]; case PlatformType.MACOS: return ['/bin/zsh', '/bin/bash', '/bin/sh']; case PlatformType.LINUX: return ['/bin/bash', '/bin/sh', '/usr/bin/bash', '/usr/bin/zsh']; default: return ['/bin/sh']; } }

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

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