MCPProtocolVersion

class aws_cdk.aws_bedrockagentcore.MCPProtocolVersion(*args: Any, **kwargs)

Bases: object

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

ExampleMetadata:

fixture=default infused

Example:

# 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
)

Methods

to_string()

Returns the string value.

Return type:

str

Attributes

MCP_2025_03_26 = <aws_cdk.aws_bedrockagentcore.MCPProtocolVersion object>
MCP_2025_06_18 = <aws_cdk.aws_bedrockagentcore.MCPProtocolVersion object>
value

The version string value.

Static Methods

classmethod of(value)

Use a custom MCP protocol version not yet defined in this class.

Parameters:

value (str) – The version string (YYYY-MM-DD format).

Return type:

MCPProtocolVersion