feat(mcp): add gog mcp subcommand with gog_exec tool#637
Conversation
Runs an MCP server over stdio exposing a single `gog_exec` tool that delegates to the same gog binary as a subprocess, giving AI agents full access to all gog subcommands. 60s timeout, 100KB stdout/stderr cap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Codex review: needs real behavior proof before merge. Latest ClawSweeper review: 2026-05-23 07:22 UTC / May 23, 2026, 3:22 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. source-level: the PR diff shows MCP child invocations are built from tool args plus safety flags only, while current main root flags carry account, config-home, output, auth, and automation context. I did not run the PR because this review is read-only. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: If maintainers want MCP in core, land it as a focused, approved PR that preserves root execution context and safety policy, documents the trust model, keeps Go/Gmail changes separate, adds focused tests, and includes redacted JSON-RPC terminal proof. Do we have a high-confidence way to reproduce the issue? Yes, source-level: the PR diff shows MCP child invocations are built from tool args plus safety flags only, while current main root flags carry account, config-home, output, auth, and automation context. I did not run the PR because this review is read-only. Is this the best way to solve the issue? No, not as proposed: a core MCP server needs a maintainer scope decision first, and the implementation should be narrowed to preserve the effective execution context instead of mixing unrelated Gmail and Go directive changes. Label justifications:
Full review comments:
Overall correctness: patch is incorrect Security concerns:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 96d50e5510ce. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
Allows 'gog gmail list' and 'gog gmail messages list' to run without a positional query argument — defaults to in:inbox so the bare command shows the user's inbox. Also adds a -q/--query flag as an alias for the positional argument for ergonomic scripting. Applies to both GmailSearchCmd (gmail list) and GmailMessagesSearchCmd (gmail messages list) which shared the same UX pattern. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Pushed follow-up commit c6964c4 — makes Before: Existing behavior preserved when the positional or flag is provided. Same fix applied to |
Use utf8.Valid when trimming output so truncated slices never end with an orphan lead byte. Derive exec CommandContext from the MCP handler context so client cancellation ends subprocess work before the hard timeout.
Prepend --gmail-no-send, --enable-commands, and --disable-commands from the parent invocation so MCP-spawned gog runs honor the same restrictions as the parent process.
Kong resolves duplicate global flags last-wins; user-supplied MCP args must not be able to follow and override --enable-commands, --disable-commands, or --gmail-no-send enforced by the parent MCP process.
Summary
gog mcpsubcommand that runs an MCP (Model Context Protocol) server over stdiogog_exectool that takes{"args": ["..."]}and runsgog <args>as a subprocess, returning{stdout, stderr, exit_code}github.com/mark3labs/mcp-godependency (v0.54.0)Implementation details
os.Executable()so the MCP server always delegates to the same binaryCLIstruct inroot.gofollowing existing kong patternTesting
gog mcp --helpprints usage correctlytools/listrequest —gog_execappears in tool listgo test ./internal/cmd/... -run TestVersion)gofmtcleanNotes
gog_exectool gives agents full access via documentedgogsubcommandsgogauth is not currently configured on this machine;gog_execcalls will return auth errors at runtime, which is expected🤖 Generated with Claude Code