GatewayTargetMcpServerProps

class aws_cdk.aws_bedrockagentcore.GatewayTargetMcpServerProps(*, description=None, gateway_target_name=None, credential_provider_configurations, endpoint, gateway)

Bases: GatewayTargetCommonProps

Properties for creating an MCP Server-based Gateway Target.

Parameters:
  • description (Optional[str]) – Optional description for the gateway target The description can have up to 200 characters. Default: - No description

  • gateway_target_name (Optional[str]) – The name of the gateway target The name must be unique within the gateway Pattern: ^([0-9a-zA-Z][-]?){1,100}$. Default: - auto generate

  • credential_provider_configurations (Sequence[ICredentialProviderConfig]) – Credential providers for authentication.

  • endpoint (str) – The HTTPS endpoint URL of the MCP server. The endpoint must: - Use HTTPS protocol - Be properly URL-encoded - Point to an MCP server that implements tool capabilities

  • gateway (IGateway) – The gateway this target belongs to.

ExampleMetadata:

fixture=default infused

Example:

gateway = agentcore.Gateway(self, "MyGateway",
    gateway_name="my-gateway"
)

# OAuth2 (recommended): use OAuth2CredentialProvider + bindForGatewayOAuthTarget, or ARNs from console/API
oauth_provider_arn = "arn:aws:bedrock-agentcore:us-east-1:123456789012:token-vault/abc123/oauth2credentialprovider/my-oauth"
oauth_secret_arn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-oauth-secret-abc123"

# Create a gateway target with MCP Server
mcp_target = agentcore.GatewayTarget.for_mcp_server(self, "MyMcpServer",
    gateway_target_name="my-mcp-server",
    description="External MCP server integration",
    gateway=gateway,
    endpoint="https://my-mcp-server.example.com",
    credential_provider_configurations=[
        agentcore.GatewayCredentialProvider.from_oauth_identity_arn(
            provider_arn=oauth_provider_arn,
            secret_arn=oauth_secret_arn,
            scopes=["mcp-runtime-server/invoke"]
        )
    ]
)

Attributes

credential_provider_configurations

Credential providers for authentication.

description

Optional description for the gateway target The description can have up to 200 characters.

Default:
  • No description

endpoint

The HTTPS endpoint URL of the MCP server.

The endpoint must:

  • Use HTTPS protocol

  • Be properly URL-encoded

  • Point to an MCP server that implements tool capabilities

gateway

The gateway this target belongs to.

gateway_target_name

^([0-9a-zA-Z][-]?){1,100}$.

Default:
  • auto generate

Type:

The name of the gateway target The name must be unique within the gateway Pattern