MCPProtocolVersion Class
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
| Source | aws-bedrockagentcore/lib/gateway/protocol.ts |
|---|---|
| Type last changed |
Example
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
# 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
// 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();
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
});
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_26MCPProtocolVersionMCP_2025_03_26MCPProtocolVersionMCP_2025_03_26MCPProtocolVersionMCP_2025_03_26MCPProtocolVersionMCP_2025_03_26MCPProtocolVersion static #MCP version 2025-03-26.
MCP_2025_06_18MCPProtocolVersionMCP_2025_06_18MCPProtocolVersionMCP_2025_06_18MCPProtocolVersionMCP_2025_06_18MCPProtocolVersionMCP_2025_06_18MCPProtocolVersion static #MCP version 2025-06-18.
MCP_2025_11_25MCPProtocolVersionMCP_2025_11_25MCPProtocolVersionMCP_2025_11_25MCPProtocolVersionMCP_2025_11_25MCPProtocolVersionMCP_2025_11_25MCPProtocolVersion static #MCP version 2025-11-25.
MCP_2026_07_28MCPProtocolVersionMCP_2026_07_28MCPProtocolVersionMCP_2026_07_28MCPProtocolVersionMCP_2026_07_28MCPProtocolVersionMCP_2026_07_28MCPProtocolVersion static #MCP version 2026-07-28.
The version string value.
Methods
of(value: string): MCPProtocolVersion // chainable@staticmethod def of(value: str) -> MCPProtocolVersionpublic static MCPProtocolVersion of(String value)public static MCPProtocolVersion Of(string value)func Of(Value *string) MCPProtocolVersion static #Use a custom MCP protocol version not yet defined in this class.
1 parameter
Parameters
valuevaluevaluevalueValue— The version string (YYYY-MM-DD format).
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string #Returns the string value.