Method: testMcpEnabled

Tests a value against the result of merging MCP consumer policies in the resource hierarchy. This operation is designed to be used for building policy-aware UIs and command-line tools, not for access checking.

HTTP request

POST https://serviceusage.googleapis.com/v2beta/{name=*/*}:testMcpEnabled

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. Resource name to check the value against hierarchically. Format: projects/100, folders/101 or organizations/102.

Request body

The request body contains data with the following structure:

JSON representation
{

  // Union field value can be only one of the following:
  "serviceName": string
  // End of list of possible types for union field value.
}
Fields
Union field value. Asks "Is this value enabled according to the merged MCP consumer policies from the resource hierarchy?". For example, the value can be a service name to check if the targeted resource can use this service. value can be only one of the following:
serviceName

string

The name of a service to test for MCP enablement. Format: services/{service}.

Response body

McpState objects represent the MCP related state of a service with respect to a consumer.

If successful, the response body contains data with the following structure:

JSON representation
{
  "name": string,
  "mcpEnableRules": [
    {
      object (McpEnableRule)
    }
  ]
}
Fields
name

string

Output only. The resource whose MCP state is being represented. Format: projects/100/services/hello.googleapis.com, folders/101/services/hello.googleapis.com, organizations/102/services/hello.googleapis.com.

mcpEnableRules[]

object (McpEnableRule)

Output only. Mcp enable rules, grouped by any associated conditions, that provide access to this resource.

If the mcpEnableRules field is empty, then the named resource is not enabled for MCP.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform.read-only
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.