check_mount
Verify Proton Drive mount status and accessibility to enable file operations through the MCP server.
Instructions
Check if Proton Drive is mounted and accessible
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:228-258 (handler)The main handler for the 'check_mount' tool. It checks if the Proton Drive path exists using existsSync, stats the directory if present, and returns a JSON object with mount status, accessibility, path, and platform information.case 'check_mount': { const exists = existsSync(PROTON_DRIVE_PATH); let info: any = { mounted: exists, path: PROTON_DRIVE_PATH, platform: platform(), }; if (exists) { try { const stats = await stat(PROTON_DRIVE_PATH); info.accessible = true; info.isDirectory = stats.isDirectory(); } catch (e) { info.accessible = false; info.error = 'Cannot access Proton Drive directory'; } } else { info.accessible = false; info.suggestion = 'Please ensure Proton Drive is installed and running'; } return { content: [ { type: 'text', text: JSON.stringify(info, null, 2), }, ], }; }
- src/index.ts:124-131 (schema)Tool schema definition including name, description, and empty input schema (no parameters required). This is part of the tools list returned by listTools.{ name: 'check_mount', description: 'Check if Proton Drive is mounted and accessible', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:122-220 (registration)Registration of the listTools handler which includes 'check_mount' in the available tools list.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ { name: 'check_mount', description: 'Check if Proton Drive is mounted and accessible', inputSchema: { type: 'object', properties: {}, }, }, { name: 'list_files', description: 'List files and folders in Proton Drive', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path relative to Proton Drive root (e.g., "Documents" or "Projects/2024")' }, }, }, }, { name: 'read_file', description: 'Read a text file from Proton Drive', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'File path relative to Proton Drive root' }, }, required: ['path'], }, }, { name: 'write_file', description: 'Write or create a file in Proton Drive', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'File path relative to Proton Drive root' }, content: { type: 'string', description: 'Text content to write to the file' }, }, required: ['path', 'content'], }, }, { name: 'delete_file', description: 'Delete a file or folder from Proton Drive', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path to delete relative to Proton Drive root' }, }, required: ['path'], }, }, { name: 'create_folder', description: 'Create a new folder in Proton Drive', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Folder path relative to Proton Drive root' }, }, required: ['path'], }, }, { name: 'get_file_info', description: 'Get information about a file or folder', inputSchema: { type: 'object', properties: { path: { type: 'string', description: 'Path to the file or folder' }, }, required: ['path'], }, }, ], }));
- src/index.ts:75-75 (helper)Constant definition for the Proton Drive path used by check_mount handler.const PROTON_DRIVE_PATH = getDefaultProtonPath();
- src/index.ts:16-72 (helper)Helper function to detect the default Proton Drive mount path across platforms (macOS, Windows, Linux). Used to set PROTON_DRIVE_PATH.function getDefaultProtonPath(): string { const home = homedir(); const system = platform(); // First check environment variable if (process.env.PROTON_DRIVE_PATH) { return process.env.PROTON_DRIVE_PATH; } if (system === 'darwin') { // macOS - check CloudStorage folder const cloudStorage = join(home, 'Library', 'CloudStorage'); if (existsSync(cloudStorage)) { try { const dirs = readdirSync(cloudStorage); const protonDir = dirs.find(d => d.startsWith('ProtonDrive-')); if (protonDir) { return join(cloudStorage, protonDir); } } catch (e) { // Fall through to default } } // Fallback for macOS return join(home, 'Proton Drive'); } else if (system === 'win32') { // Windows - check common locations const locations = [ join(home, 'Proton Drive'), join(home, 'ProtonDrive'), join('C:', 'Proton Drive'), join(home, 'Documents', 'Proton Drive'), ]; for (const loc of locations) { if (existsSync(loc)) { return loc; } } return locations[0]; // Default to first option } else { // Linux - check common locations const locations = [ join(home, 'ProtonDrive'), join(home, 'Proton Drive'), join(home, 'Documents', 'ProtonDrive'), '/media/proton', ]; for (const loc of locations) { if (existsSync(loc)) { return loc; } } return locations[0]; // Default to first option } }