# MCPProtocolVersion

MCP protocol versions.

The Model Context Protocol uses string-based version identifiers following the format YYYY-MM-DD,
to indicate the last date backwards incompatible changes were made.
Versions are available at https://github.com/modelcontextprotocol/modelcontextprotocol/releases

Obtainable from: MCPProtocolVersion.MCP_2025_03_26, MCPProtocolVersion.MCP_2025_06_18, MCPProtocolVersion.MCP_2025_11_25, MCPProtocolVersion.MCP_2026_07_28, MCPProtocolVersion.of

- Source: [`aws-bedrockagentcore/lib/gateway/protocol.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/gateway/protocol.ts#L60)
- Type last changed: v2.276.0 · 10 Nov 2026

## Example

TypeScript:

```ts
// Create a KMS key for encryption
const encryptionKey = new kms.Key(this, "GatewayEncryptionKey", {
  enableKeyRotation: true,
  description: "KMS key for gateway encryption",
});

// Create gateway with KMS encryption
const gateway = new agentcore.Gateway(this, "MyGateway", {
  gatewayName: "my-encrypted-gateway",
  description: "Gateway with KMS encryption",
  protocolConfiguration: new agentcore.McpProtocolConfiguration({
    instructions: "Use this gateway to connect to external MCP tools",
    searchType: agentcore.McpGatewaySearchType.SEMANTIC,
    supportedVersions: [agentcore.MCPProtocolVersion.MCP_2025_03_26],
  }),
  authorizerConfiguration: agentcore.GatewayAuthorizer.usingCustomJwt({
    discoveryUrl: "https://auth.example.com/.well-known/openid-configuration",
    allowedAudience: ["my-app"],
    allowedClients: ["my-client-id"],
    allowedScopes: ["read", "write"],
  }),
  kmsKey: encryptionKey,
  exceptionLevel: agentcore.GatewayExceptionLevel.DEBUG,
});
```

Python:

```python
# Create a KMS key for encryption
encryption_key = kms.Key(self, "GatewayEncryptionKey",
    enable_key_rotation=True,
    description="KMS key for gateway encryption"
)

# Create gateway with KMS encryption
gateway = agentcore.Gateway(self, "MyGateway",
    gateway_name="my-encrypted-gateway",
    description="Gateway with KMS encryption",
    protocol_configuration=agentcore.McpProtocolConfiguration(
        instructions="Use this gateway to connect to external MCP tools",
        search_type=agentcore.McpGatewaySearchType.SEMANTIC,
        supported_versions=[agentcore.MCPProtocolVersion.MCP_2025_03_26]
    ),
    authorizer_configuration=agentcore.GatewayAuthorizer.using_custom_jwt(
        discovery_url="https://auth.example.com/.well-known/openid-configuration",
        allowed_audience=["my-app"],
        allowed_clients=["my-client-id"],
        allowed_scopes=["read", "write"]
    ),
    kms_key=encryption_key,
    exception_level=agentcore.GatewayExceptionLevel.DEBUG
)
```

Java:

```java
// Create a KMS key for encryption
Key encryptionKey = Key.Builder.create(this, "GatewayEncryptionKey")
        .enableKeyRotation(true)
        .description("KMS key for gateway encryption")
        .build();

// Create gateway with KMS encryption
Gateway gateway = Gateway.Builder.create(this, "MyGateway")
        .gatewayName("my-encrypted-gateway")
        .description("Gateway with KMS encryption")
        .protocolConfiguration(McpProtocolConfiguration.Builder.create()
                .instructions("Use this gateway to connect to external MCP tools")
                .searchType(McpGatewaySearchType.SEMANTIC)
                .supportedVersions(List.of(MCPProtocolVersion.MCP_2025_03_26))
                .build())
        .authorizerConfiguration(GatewayAuthorizer.usingCustomJwt(CustomJwtConfiguration.builder()
                .discoveryUrl("https://auth.example.com/.well-known/openid-configuration")
                .allowedAudience(List.of("my-app"))
                .allowedClients(List.of("my-client-id"))
                .allowedScopes(List.of("read", "write"))
                .build()))
        .kmsKey(encryptionKey)
        .exceptionLevel(GatewayExceptionLevel.DEBUG)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// Create a KMS key for encryption
var encryptionKey = new Key(this, "GatewayEncryptionKey", new KeyProps {
    EnableKeyRotation = true,
    Description = "KMS key for gateway encryption"
});

// Create gateway with KMS encryption
var gateway = new Gateway(this, "MyGateway", new GatewayProps {
    GatewayName = "my-encrypted-gateway",
    Description = "Gateway with KMS encryption",
    ProtocolConfiguration = new McpProtocolConfiguration(new McpConfiguration {
        Instructions = "Use this gateway to connect to external MCP tools",
        SearchType = McpGatewaySearchType.SEMANTIC,
        SupportedVersions = new [] { MCPProtocolVersion.MCP_2025_03_26 }
    }),
    AuthorizerConfiguration = GatewayAuthorizer.UsingCustomJwt(new CustomJwtConfiguration {
        DiscoveryUrl = "https://auth.example.com/.well-known/openid-configuration",
        AllowedAudience = new [] { "my-app" },
        AllowedClients = new [] { "my-client-id" },
        AllowedScopes = new [] { "read", "write" }
    }),
    KmsKey = encryptionKey,
    ExceptionLevel = GatewayExceptionLevel.DEBUG
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// Create a KMS key for encryption
encryptionKey := kms.NewKey(this, jsii.String("GatewayEncryptionKey"), &KeyProps{
	EnableKeyRotation: jsii.Boolean(true),
	Description: jsii.String("KMS key for gateway encryption"),
})

// Create gateway with KMS encryption
gateway := agentcore.NewGateway(this, jsii.String("MyGateway"), &GatewayProps{
	GatewayName: jsii.String("my-encrypted-gateway"),
	Description: jsii.String("Gateway with KMS encryption"),
	ProtocolConfiguration: agentcore.NewMcpProtocolConfiguration(&McpConfiguration{
		Instructions: jsii.String("Use this gateway to connect to external MCP tools"),
		SearchType: agentcore.McpGatewaySearchType_SEMANTIC(),
		SupportedVersions: []MCPProtocolVersion{
			agentcore.MCPProtocolVersion_MCP_2025_03_26(),
		},
	}),
	AuthorizerConfiguration: agentcore.GatewayAuthorizer_UsingCustomJwt(&CustomJwtConfiguration{
		DiscoveryUrl: jsii.String("https://auth.example.com/.well-known/openid-configuration"),
		AllowedAudience: []*string{
			jsii.String("my-app"),
		},
		AllowedClients: []*string{
			jsii.String("my-client-id"),
		},
		AllowedScopes: []*string{
			jsii.String("read"),
			jsii.String("write"),
		},
	}),
	KmsKey: encryptionKey,
	ExceptionLevel: agentcore.GatewayExceptionLevel_DEBUG(),
})
```

## Properties

- `MCP_2025_03_26`: [MCPProtocolVersion](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.MCPProtocolVersion.html) (static) — MCP version 2025-03-26.

- `MCP_2025_06_18`: [MCPProtocolVersion](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.MCPProtocolVersion.html) (static) — MCP version 2025-06-18.

- `MCP_2025_11_25`: [MCPProtocolVersion](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.MCPProtocolVersion.html) (static) — MCP version 2025-11-25.

- `MCP_2026_07_28`: [MCPProtocolVersion](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.MCPProtocolVersion.html) (static) — MCP version 2026-07-28.

- `value`: string — The version string value.

## Methods

- `of(value: string): MCPProtocolVersion // chainable` (static) — Use a custom MCP protocol version not yet defined in this class.

  **Parameters**

  - `value` — The version string (YYYY-MM-DD format).

- `toString(): string` — Returns the string value.
