AddMcpServerTargetOptions
- class aws_cdk.aws_bedrockagentcore.AddMcpServerTargetOptions(*, credential_provider_configurations, endpoint, description=None, gateway_target_name=None)
Bases:
objectOptions for adding an MCP Server target to a gateway.
- Parameters:
credential_provider_configurations (
Sequence[ICredentialProviderConfig]) – Credential providers for authentication. MCP servers require explicit authentication configuration. OAuth2 is strongly recommended over NoAuth.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 capabilitiesdescription (
Optional[str]) – Optional description for the gateway target. Default: - No descriptiongateway_target_name (
Optional[str]) – The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen). Default: - auto generate
- ExampleMetadata:
fixture=default infused
Example:
gateway = agentcore.Gateway(self, "MyGateway", gateway_name="my-gateway" ) oauth = agentcore.OAuth2CredentialProvider.using_github(self, "GhOAuth", o_auth2_credential_provider_name="github-oauth", client_id="your-client-id", client_secret=cdk.SecretValue.unsafe_plain_text("your-client-secret") ) gateway.add_mcp_server_target("Mcp", gateway_target_name="mcp-server", description="MCP with GitHub OAuth", endpoint="https://my-mcp-server.example.com", credential_provider_configurations=[ agentcore.GatewayCredentialProvider.from_oauth_identity(oauth, scopes=["read:user"] ) ] )
Attributes
- credential_provider_configurations
Credential providers for authentication.
MCP servers require explicit authentication configuration. OAuth2 is strongly recommended over NoAuth.
- description
Optional description for the gateway target.
- 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_target_name
The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).
- Default:
auto generate