# Google Cloud Network Security V1 Client - Class MCP (1.4.0)

1.4.0 (latest) 1.3.0 1.2.3 1.1.0 1.0.4 0.6.5 0.5.2 0.4.1 0.3.7 Reference documentation and code samples for the Google Cloud Network Security V1 Client class MCP.

Describes a set of MCP protocol attributes to match against for a
given MCP request.

Generated from protobuf message `google.cloud.networksecurity.v1.AuthzPolicy.AuthzRule.To.RequestOperation.MCP`

## Namespace

Google \\ Cloud \\ NetworkSecurity \\ V1 \\ AuthzPolicy \\ AuthzRule \\ To \\ RequestOperation

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ base_protocol_methods_option` | `int` Optional. If specified, matches on the MCP protocol's non-access specific methods namely: \* \* initialize \* \* completion/ \* \* logging/ \* \* notifications/ \* \* ping Defaults to SKIP_BASE_PROTOCOL_METHODS if not specified. |
| `↳ methods` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod>` Optional. A list of MCP methods and associated parameters to match on. It is recommended to use this field to match on tools, prompts and resource accesses while setting the baseProtocolMethodsOption to MATCH_BASE_PROTOCOL_METHODS to match on all the other MCP protocol methods. Limited to 10 MCP methods per Authorization Policy. |

### getBaseProtocolMethodsOption

Optional. If specified, matches on the MCP protocol's non-access
specific methods namely:

- initialize
- completion/
- logging/
- notifications/
- ping Defaults to SKIP_BASE_PROTOCOL_METHODS if not specified.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [BaseProtocolMethodsOption](https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption). |

### setBaseProtocolMethodsOption

Optional. If specified, matches on the MCP protocol's non-access
specific methods namely:

- initialize
- completion/
- logging/
- notifications/
- ping Defaults to SKIP_BASE_PROTOCOL_METHODS if not specified.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [BaseProtocolMethodsOption](https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthzPolicy.AuthzRule.To.RequestOperation.BaseProtocolMethodsOption). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMethods

Optional. A list of MCP methods and associated parameters to match
on. It is recommended to use this field to match on tools, prompts
and resource accesses while setting the baseProtocolMethodsOption
to MATCH_BASE_PROTOCOL_METHODS to match on all the other MCP
protocol methods.

Limited to 10 MCP methods per Authorization Policy.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod>` |   |

### setMethods

Optional. A list of MCP methods and associated parameters to match
on. It is recommended to use this field to match on tools, prompts
and resource accesses while setting the baseProtocolMethodsOption
to MATCH_BASE_PROTOCOL_METHODS to match on all the other MCP
protocol methods.

Limited to 10 MCP methods per Authorization Policy.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-network-security/latest/V1.AuthzPolicy.AuthzRule.To.RequestOperation.MCPMethod>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |