Skip to content

feat(mcp): authorize GCP backend endpoint - #44

Open
xnoto wants to merge 2 commits into
mainfrom
feat/mcp-gcp-direct-endpoint
Open

feat(mcp): authorize GCP backend endpoint#44
xnoto wants to merge 2 commits into
mainfrom
feat/mcp-gcp-direct-endpoint

Conversation

@xnoto

@xnoto xnoto commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Repository has no pull-request template.

Summary

Adds makeitwork-gcp to the per-backend MCP Access application set in cf-access-mcp.tf, creating the fail-closed Access application for mcp-makeitwork-gcp.makeitwork.cloud under the existing MCP Gateway service-token and GitHub-admin policies.

No new service token, tunnel identity, DNS record, workload route, provider version, workflow, or secret is created here. kustomize-cluster owns the later TunnelBinding route and must not merge it until this PR has merged and its environment-gated apply has completed.

Fixes # N/A — owner-directed direct GCP MCP endpoint.

Type of change

  • Infrastructure (OpenTofu root or module)

Validation

  • Required pull-request checks pass — opentofu run 34326070590 (test and plan) succeeded.
  • Generated or centrally distributed files were regenerated by their owning automation, not hand-edited — N/A; the for_each resource is already documented in README.md, and adding one list key does not change the generated resource inventory. CI terraform docs passed unchanged.
  • The redacted plan comment shows exactly Plan: 1 to add, 0 to change, 0 to destroy: cloudflare_zero_trust_access_application.mcp_gateway_backend["makeitwork-gcp"] for domain mcp-makeitwork-gcp.makeitwork.cloud.

Pre-PR review evidence:

  • Adversarial review: ADVANCE; no Critical/High findings; required the PR plan to show only the intended Access application (confirmed above).
  • Infrastructure security review: ADVANCE; two Low notes — the shared non-expiring service token's reach expands by design to this additional read-only backend, and route ordering is an operational dependency.
  • Release-readiness review (GLM fallback after the Kimi release-engineer delegation hit a provider quota): ADVANCE; ordering, rollback, and consumer-PR correction gates recorded.

Impact and rollout

Producer: tfroot-cloudflare is the canonical Cloudflare Access owner. Consumer: the existing ToolHive makeitwork-gcp backend and a later kustomize-cluster TunnelBinding route.

Ordered delivery:

  1. PR CI validates and plans this Access-only change. (passed)
  2. After review and explicit merge approval, merge to main; approve the environment-gated production apply.
  3. Confirm the Access application for mcp-makeitwork-gcp.makeitwork.cloud exists.
  4. Only then open/merge the held kustomize-cluster route PR (branch feat/mcp-gcp-direct-endpoint, whose README carries an explicit do-not-merge gate).
  5. The three corrected xnoto client PRs (codex-config#5, claude-config#5, opencode-config#17) add direct makeitwork-gcp entries; merge only after the route is live.

Rollback: remove the TunnelBinding route first, then revert this list addition through a new reviewed PR and environment-gated apply.

Safety and secrets

  • Contains no plaintext secrets, decrypted SOPS values, state files, kubeconfigs, tokens, or private endpoints
  • No local OpenTofu init/plan/apply/destroy/import/state operations were run or claimed — plans come from pull-request checks
  • Breaking or irreversible effects are described above with rollback notes

AI-assisted change: an OpenCode agent materially produced this change. Reviewers should verify the list key, expected plan delta, and that no workload DNS ownership moves into this root.

@xnoto
xnoto requested a review from a team as a code owner September 9, 2026 07:52
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

OpenTofu Test

OpenTofu test passed.

View the workflow run.

View run output
Terraform validate.......................................................Passed
Terraform validate with tflint...........................................Passed
Checkov..................................................................Passed
Terraform fmt............................................................Passed
Terraform docs...........................................................Passed
Detect hardcoded secrets.................................................Passed
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
check vcs permalinks.....................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
don't commit to branch..................................................Skipped
check for added large files..............................................Passed

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

OpenTofu Plan

OpenTofu plan passed.

View the workflow run.

View run output
OpenTofu will perform the following actions:

  # cloudflare_zero_trust_access_application.mcp_gateway_backend["makeitwork-gcp"] will be created
  + resource "cloudflare_zero_trust_access_application" "mcp_gateway_backend" {
      + account_id                 = (sensitive value)
      + allowed_idps               = [
          + "e584ea47-1251-4939-95f4-4daf4a58cd31",
        ]
      + app_launcher_visible       = true
      + aud                        = (known after apply)
      + destinations               = (known after apply)
      + domain                     = "mcp-makeitwork-gcp.makeitwork.cloud"
      + http_only_cookie_attribute = true
      + id                         = (known after apply)
      + name                       = "MCP makeitwork-gcp"
      + policies                   = [
          + {
              + decision   = "non_identity"
              + include    = [
                  + {
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
                        }
                    },
                ]
              + name       = "mcp-gateway-clients"
              + precedence = 1
            },
          + {
              + decision   = "allow"
              + include    = [
                  + {
                      + group = {
                          + id = "e0d9e873-31d7-4536-9234-3dad8a99d84d"
                        }
                    },
                ]
              + name       = "makeitworkcloud-admins"
              + precedence = 2
            },
        ]
      + self_hosted_domains        = (known after apply)
      + session_duration           = "24h"
      + type                       = "self_hosted"
    }

Plan: 1 to add, 0 to change, 0 to destroy.
OpenTofu will perform the following actions:

  # cloudflare_zero_trust_access_application.mcp_gateway_backend["makeitwork-gcp"] will be created
  + resource "cloudflare_zero_trust_access_application" "mcp_gateway_backend" {
      + account_id                 = (sensitive value)
      + allowed_idps               = [
          + "e584ea47-1251-4939-95f4-4daf4a58cd31",
        ]
      + app_launcher_visible       = true
      + aud                        = (known after apply)
      + destinations               = (known after apply)
      + domain                     = "mcp-makeitwork-gcp.makeitwork.cloud"
      + http_only_cookie_attribute = true
      + id                         = (known after apply)
      + name                       = "MCP makeitwork-gcp"
      + policies                   = [
          + {
              + decision   = "non_identity"
              + include    = [
                  + {
[REDACTED: potentially sensitive plan output]
[REDACTED: potentially sensitive plan output]
                        }
                    },
                ]
              + name       = "mcp-gateway-clients"
              + precedence = 1
            },
          + {
              + decision   = "allow"
              + include    = [
                  + {
                      + group = {
                          + id = "e0d9e873-31d7-4536-9234-3dad8a99d84d"
                        }
                    },
                ]
              + name       = "makeitworkcloud-admins"
              + precedence = 2
            },
        ]
      + self_hosted_domains        = (known after apply)
      + session_duration           = "24h"
      + type                       = "self_hosted"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant