openWayStation
Launch the WayStation desktop application to connect MCP hosts with productivity tools through a no-code integration hub.
Instructions
Call this action when users says 'Open WayStation'. Opens the WayStation desktop application
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:139-204 (handler)Handler for the 'openWayStation' tool. Platform-specific logic to open the WayStation desktop application (Windows: exec start, macOS: AppleScript), handles onboarding and config dir.
} else if (request.params.name === "openWayStation") { try { // Create config directory if it doesn't exist const configDir = getWayStationPath(); fs.mkdirSync(configDir, { recursive: true }); // Check and update onboarding state const onboardingFile = getWayStationPath('onboarding_completed'); const onboardingCompleted = fs.existsSync(onboardingFile); if (!onboardingCompleted) { fs.writeFileSync(onboardingFile, 'true'); } // Platform-specific code to open WayStation if (os.platform() === 'win32') { // Windows: Use start command to open WayStation try { const programFiles = process.env['ProgramFiles'] || 'C:\\Program Files'; const wayStationPath = path.join(programFiles, 'WayStation', 'WayStation.exe'); execSync(`start "" "${wayStationPath}"`, { shell: 'cmd.exe' }); } catch (innerError) { throw new Error(`Failed to open WayStation on Windows: ${innerError instanceof Error ? innerError.message : String(innerError)}`); } } else if (os.platform() === 'darwin') { // macOS: Use AppleScript to activate WayStation const applescript = `tell application "WayStation" to activate delay 0.5 tell application "System Events" -- Get the WayStation window set wayProcess to application process "WayStation" -- If WayStation has windows and is running, bring it to front if (exists wayProcess) and (count of windows of wayProcess) > 0 then set frontmost of wayProcess to true end if end tell`; // Function to escape only double quotes in AppleScript function escapeAppleScriptString(str: string): string { return str.replace(/"/g, '\\"'); } execSync(`osascript -e "${escapeAppleScriptString(applescript)}"`); } else { throw new Error(`Unsupported platform: ${os.platform()}`); } return { error: false, content: [{ type: "text", text: "WayStation app has been opened successfully." }] }; } catch (error) { return { error: true, content: [{ type: "text", text: `Error opening WayStation: ${error instanceof Error ? error.message : String(error)}` }] }; } } - src/index.ts:99-107 (registration)Registration of the 'openWayStation' tool in the tools list response, with description and input schema.
{ name: "openWayStation", description: "Call this action when users says 'Open WayStation'. Opens the WayStation desktop application", inputSchema: { type: "object", properties: {}, required: [] } } - src/index.ts:14-20 (helper)Helper function getWayStationPath used to determine config and token paths for WayStation on different platforms.
function getWayStationPath(fileName?: string): string { const basePath = os.platform() === 'win32' ? path.join(process.env.APPDATA || '', 'WayStation') : path.join(os.homedir(), '.waystation'); return fileName ? path.join(basePath, fileName) : basePath; }