test_gcp_auth
Verify Google Cloud Platform authentication credentials to ensure secure access to GCP services through the MCP interface.
Instructions
Test GCP authentication
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "test_gcp_auth"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/gcp-mcp-server/main.py:93-109 (handler)The handler function for the 'test_gcp_auth' tool. It tests GCP authentication by attempting to list storage buckets using the initialized GCP clients. The @mcp.tool() decorator registers it with the FastMCP server.
@mcp.tool() def test_gcp_auth() -> str: """Test GCP authentication""" try: # Get clients from client_instances module instead of context clients = client_instances.get_clients() # Test if we can list storage buckets if hasattr(clients, "storage"): try: buckets = list(clients.storage.list_buckets(max_results=5)) return f"Authentication successful. Found {len(buckets)} buckets. {buckets}" except Exception as e: return f"Storage authentication failed: {str(e)}" except Exception as e: return f"Authentication failed: {str(e)}"