Conversation
Adds a new `gws mcp` subcommand that starts a Model Context Protocol (MCP) server over stdio, exposing Google Workspace APIs as structured tools to any MCP-compatible client. - New `src/mcp_server.rs`: JSON-RPC stdio transport, handles `initialize`, `tools/list`, and `tools/call` - Tool discovery dynamically builds schemas from Google Discovery Docs - Filtering via `-s <services>` flag (e.g. `-s drive,gmail` or `-s all`) - `-w/--workflows` and `-e/--helpers` flags for optional extras - stderr startup warning when no services are configured - Refactored `executor::execute_method` to support output capture (returns `Option<Value>` instead of printing to stdout) so the MCP transport is not corrupted - Updated README.md with MCP Server section and usage examples
🦋 Changeset detectedLatest commit: b0c25ed The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a gws mcp subcommand to start a Model Context Protocol server, which involves refactoring src/executor.rs and implementing core server logic in src/mcp_server.rs to handle JSON-RPC requests and expose Google Workspace APIs as tools. A critical security vulnerability has been identified where the upload argument in tool calls allows for arbitrary local file reads, potentially leading to sensitive data exfiltration via prompt injection; strict path validation is required to address this. Furthermore, there are opportunities to improve error handling and simplify code for enhanced robustness and clarity.
- Add stderr warning when discovery doc fails to load (mcp_server.rs) - Remove redundant 'all' string check in service validation (mcp_server.rs) - Validate upload path to prevent arbitrary file reads - security fix (mcp_server.rs) - Remove redundant inner capture_output check in handle_binary_response (executor.rs) - Add changeset for minor version bump
- cargo fmt: format all changed files
- clippy: add #[allow(clippy::too_many_arguments)] on private handle_json_response
- clippy: collapse else { if } to else if in executor.rs
- clippy: replace svc_name.clone() with std::slice::from_ref in mcp_server.rs
- clippy: replace index-based loop with iterator in walk path resolution
- test: add ::<()> turbofish annotation to handle_error_response test calls
to fix E0282 type inference errors
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
* feat: add gws mcp server
Adds a new `gws mcp` subcommand that starts a Model Context Protocol
(MCP) server over stdio, exposing Google Workspace APIs as structured
tools to any MCP-compatible client.
- New `src/mcp_server.rs`: JSON-RPC stdio transport, handles
`initialize`, `tools/list`, and `tools/call`
- Tool discovery dynamically builds schemas from Google Discovery Docs
- Filtering via `-s <services>` flag (e.g. `-s drive,gmail` or `-s all`)
- `-w/--workflows` and `-e/--helpers` flags for optional extras
- stderr startup warning when no services are configured
- Refactored `executor::execute_method` to support output capture
(returns `Option<Value>` instead of printing to stdout) so the MCP
transport is not corrupted
- Updated README.md with MCP Server section and usage examples
* fix: address PR review comments
- Add stderr warning when discovery doc fails to load (mcp_server.rs)
- Remove redundant 'all' string check in service validation (mcp_server.rs)
- Validate upload path to prevent arbitrary file reads - security fix (mcp_server.rs)
- Remove redundant inner capture_output check in handle_binary_response (executor.rs)
- Add changeset for minor version bump
* fix: resolve CI lint, fmt, and test failures
- cargo fmt: format all changed files
- clippy: add #[allow(clippy::too_many_arguments)] on private handle_json_response
- clippy: collapse else { if } to else if in executor.rs
- clippy: replace svc_name.clone() with std::slice::from_ref in mcp_server.rs
- clippy: replace index-based loop with iterator in walk path resolution
- test: add ::<()> turbofish annotation to handle_error_response test calls
to fix E0282 type inference errors
Summary
Adds a new
gws mcpsubcommand that starts a Model Context Protocol server over stdio, exposing Google Workspace APIs as structured tools to any MCP-compatible LLM client (Claude Desktop, Gemini CLI, VS Code, etc.).Changes
New:
src/mcp_server.rsinitialize,tools/list, andtools/call-sflag (-s drive,gmailor-s all)-w/--workflowsand-e/--helpersflags for optional tool categoriesModified:
src/executor.rsexecute_methodnow accepts acapture_outputflagOption<Value>instead of printing directly to stdout when capturing, keeping the MCP stdio transport cleanModified:
src/helpers/*,src/main.rsexecute_methodcall sites to passcapture_output: false(preserving existing behavior)Modified:
README.mdUsage
{ "mcpServers": { "gws": { "command": "gws", "args": ["mcp", "-s", "drive,gmail,calendar"] } } }