googleapis / googleapis/gcloud-mcp

feat(gcloud-mcp): add check_iam_permissions tool

Open
#324 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
904
Forks
83
PR merge metrics
No merged PRs in 30d

Description

## Feature: Add `check_iam_permissions` tool

### Problem
AI agents often encounter "permission denied" errors when running gcloud commands. Currently there's no easy way to proactively check if the user has the necessary permissions before attempting an operation.

### Solution
Add a `check_iam_permissions` tool that tests whether the authenticated account has specific IAM permissions on a project.

### Use Cases
- Verify permissions BEFORE running a command to avoid errors
- Debug "permission denied" errors by checking which permissions are missing
- Validate access to a specific project

### Implementation
- Uses `gcloud projects test-iam-permissions` under the hood
- Returns a clear summary of granted/denied permissions
- Provides helpful suggestions when permissions are missing

Related to #169 (reduce IAM errors)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.