googleapis / googleapis/gcloud-mcp
feat(gcloud-mcp): add get_gcloud_context tool
- Dominant language
- TypeScript
- Stars
- 904
- Forks
- 83
- PR merge metrics
- No merged PRs in 30d
Description
## Feature: Add `get_gcloud_context` tool
### Problem
AI agents frequently need to know the current GCP context (active account, project, region, zone) before executing commands. Currently they must run multiple `gcloud config get-value` commands sequentially.
### Solution
Add a `get_gcloud_context` tool that returns all context values in a single call by running the config queries in parallel.
### Use Cases
- Verify which project/account will be used before executing commands
- Check environment at session start
- Debug configuration issues
### Implementation
- Returns: account, project, region, zone, configuration name
- Executes 5 gcloud config queries in parallel for performance
- Handles unset values gracefully with helpful notes
Related to #168 (provide gcloud context)
Contributor guide
Research direction
Start by locating the existing gcloud MCP tool registration and the code that runs gcloud configuration queries. Implement the five-value context response with parallel queries and graceful handling of unset values, then run the repository's relevant tests to verify the tool output and performance behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- google-cloud, typescript
- Domain
- cli, cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100