feat(mcp): add typed, capability-scoped Gmail write and mutation tools
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 8.4k
- Forks
- 697
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 89
Description
Summary
Please add typed Gmail write tools to gog mcp for compose/send, draft lifecycle, labels/read state, archive, trash, and other ordinary mailbox mutations supported by the existing gog gmail CLI. Keep them hidden behind the existing explicit write/send gates and per-account capability policy.
This is not a request for a generic command runner or model-supplied argv.
Current behavior
Tested with gog v0.38.2:
gog mcp --allow-write --allow-tool gmail --list-tools
The registered Gmail surface remains read-only:
gmail_searchgmail_get_messagegmail_get_thread
No typed Gmail write tools are registered even when the authenticated profile has gmail.modify, gmail.compose, and gmail.send grants and write exposure is explicitly requested. Live read-only probes succeed; this is not an OAuth failure.
The current MCP documentation likewise lists Gmail reads and only Docs/Sheets writes: https://github.com/openclaw/gogcli/blob/main/docs/mcp.md
Requested behavior
Expose a curated set of typed, auditable Gmail mutation tools that:
- map one tool to one reviewed
gogGmail operation; - use fixed schemas with unknown-field rejection;
- remain absent by default;
- require the existing explicit write/send authorization and command safety gates;
- respect the per-account capability policy added by #914, so one account can remain read-only while another receives a narrowly selected write surface;
- preserve
--wrap-untrusted,--no-input, dry-run behavior where supported, bounded output, and the existing subprocess safety model.
Useful initial operations would be compose/create draft, send draft/message, add/remove labels, mark read/unread, archive, trash, restore, and delete only if the existing baked safety policy permits it. Tool naming and exact initial scope should follow the maintainers' existing registry conventions.
Why
A trusted-side MCP integration needs ordinary mailbox control without exposing reusable OAuth material to an agent sandbox and without introducing a custom wrapper or generic shell bridge. gog mcp already provides the correct typed-tool, untrusted-content, account-policy, and safety architecture; the missing piece is a curated Gmail mutation surface.
Duplicate check
I searched the open and closed issue set for Gmail MCP write/send/mutation requests. #913/#914 adds persistent capability policy but explicitly adds no tools. I did not find an existing request for the Gmail mutation tool surface described here.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the existing gog mcp tool registry and docs/mcp.md, then compare the Gmail read tools with the operations exposed by the gog gmail CLI. Read the per-account capability policy from #914 and the existing write/send safety gates. Done means a maintainer-approved, typed Gmail mutation surface follows those policies, remains absent by default, and preserves the stated safety behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design, cli, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100