feat(cloud/gcp): GCP provider for the cloud-context MCP#49
Merged
sourcehawk merged 4 commits intoMay 30, 2026
Conversation
…itions (#43) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sourcehawk
added a commit
that referenced
this pull request
May 30, 2026
…-env, and #46 binary findings Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Description
Towards #43
Implements the GCP provider for the read-only cloud-context MCP, plugged in behind the
cloud.Providerinterface from the scaffold (#45) and selected by--provider=gcp. The operator agent can now ground a Kubernetes incident in GCP context: inventory and identity through typed tools, and the long tail (reachability, IAM read, GKE config, logs, audit) through the gatedrun_cliagainst an embedded read-only allowlist. All access shellsgcloudthrough the injected harness RunFunc; nocloud.google.com/goSDK.Changes
pkg/mcp/cloud/providers/gcp/implementing all sevencloud.Providermethods over thegcloudCLI:Name,Binary(resolved viaexec.LookPath, test-overridable),DefaultAllowlist,DenyFloorAdditions,EnvPassthrough,Inventory,Identity.default_commands.json: read-onlygcloudverbs across the investigative axes (inventory, reachability/firewall/routes, IAM read, GKE describe, logs read, audit), each entry naming its axis in prose. Exact-match allowlist, so every entry is the complete invariant verb chain.DenyFloorAdditionscontributing GCP-specific dangerous subcommands (compute ssh,compute scp,compute reset-windows-password,functions call) on top of the base floor.Identityas the read-only whoami overgcloud auth list --filter=status:ACTIVE --format=json;Validrequires the resolved active account to equal the pinnedCLOUDSDK_AUTH_IMPERSONATE_SERVICE_ACCOUNT. Degraded auth surfaces throughValid/Hint, never a Go error.Inventoryovergcloud projects list --format=json, projected to{id, name}.serve.go:--provider=gcpnow constructs the provider; theawsarm is left as a separate not-built-yet case for Implement the AWS provider for the cloud-context MCP #46.Related
cloud.Providerinterface, harness, allowlist, probe).Testing
Table tests over captured
gcloud ... --format=jsonfixtures driving the projections, with a fakecloud.RunFuncreturning fixtureCLIResult— no live cloud. Coverage: binary/name/allowlist load,projects listpresent on the allowlist, one representative command per investigative axis, deny-floor additions, identity match/mismatch/no-active-account/no-target-pinned/run-error, the exact argv each typed tool emits, and inventory projection/empty/error. A compile-timevar _ cloud.Provider = (*Provider)(nil)guards interface drift. Fullmake test-go(race) andmake lintboth green from the worktree root.🤖 Generated with Claude Code