Add --transport flag support (defaults to stdio)#5
Open
sam-at-luther wants to merge 10 commits intomainfrom
Open
Add --transport flag support (defaults to stdio)#5sam-at-luther wants to merge 10 commits intomainfrom
sam-at-luther wants to merge 10 commits intomainfrom
Conversation
Add support for --transport flag to match Slack MCP server pattern. Defaults to stdio transport for compatibility with supergateway. Usage: mcp-server-gdrive # Use stdio (default) mcp-server-gdrive --transport stdio # Use stdio explicitly mcp-server-gdrive --transport http # HTTP transport (not yet implemented)
Wrap drive.files.list() in try-catch to properly handle API errors and return user-friendly error messages instead of internal errors. Also add validation for required query parameter.
Extract detailed error information from Google API error responses to provide more helpful error messages to users.
Log full error object to stderr for debugging purposes to help identify the structure of Google API errors.
Use process.stderr.write instead of console.error to ensure error details are flushed immediately and appear in container logs.
Handle both string and object error formats from Google API. Extract error_description and full response data for better debugging.
The 'fullText' query term may not be supported or may require special permissions. Using 'name contains' which is a standard Drive API v3 query term for searching file names.
The OAuth2 client must be initialized with client_id and client_secret from the keyfile, not just setCredentials with token. This fixes the 'Could not determine client ID from request' error.
Now that OAuth2 is properly initialized, fullText contains works. Using 'name contains' OR 'fullText contains' to search both file names and file contents.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for
--transportflag to match Slack MCP server pattern and improve compatibility with supergateway.Changes
--transportflag parsing (defaults tostdio)name containsandfullText containsfor comprehensive searchUsage
Testing
Tested successfully with Google Drive API:
This should help with supergateway integration where explicit transport flags are expected.