Describe the bug
Path duplication bug in Google Drive MCP server causing authentication failure. The credential file path is incorrectly constructed with a duplicated drive letter (C:\C:) on Windows systems, preventing proper authentication.
To Reproduce
Steps to reproduce the behavior:
- Set up Google Drive MCP server on Windows
- Run the authentication flow using
node ./dist auth
- Complete the OAuth process in browser
- Attempt to use the server with Claude desktop app
Expected behavior
The credential file should be saved with the correct path structure (C:\Users...) and the server should properly authenticate with Google Drive.
Logs
Error: ENOENT: no such file or directory, open 'C:\C:\Users\w\npm-cache\_npx\901beb8b1a496dd2\node_modules\.gdrive-server-credentials.json'
at Object.writeFileSync (node:fs:2426:20)
at authenticateAndSaveCredentials (file:///C:/Users/w/npm-cache/_npx/901beb8b1a496dd2/node_modules/@modelcontextprotocol/server-gdrive/dist/index.js:154:8)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\C:\\Users\\w\\npm-cache\\_npx\\901beb8b1a496dd2\\node_modules\\.gdrive-server-credentials.json'
}
Additional context
The issue appears to be in the path handling code when constructing credential paths. The problem specifically occurs in the authenticateAndSaveCredentials function when using fileURLToPath and path.join together on Windows systems. The code is using path manipulations that seem to be causing drive letter duplication (C:\C:) in the final path.
Describe the bug
Path duplication bug in Google Drive MCP server causing authentication failure. The credential file path is incorrectly constructed with a duplicated drive letter (C:\C:) on Windows systems, preventing proper authentication.
To Reproduce
Steps to reproduce the behavior:
node ./dist authExpected behavior
The credential file should be saved with the correct path structure (C:\Users...) and the server should properly authenticate with Google Drive.
Logs
Additional context
The issue appears to be in the path handling code when constructing credential paths. The problem specifically occurs in the
authenticateAndSaveCredentialsfunction when usingfileURLToPathandpath.jointogether on Windows systems. The code is using path manipulations that seem to be causing drive letter duplication (C:\C:) in the final path.