# AddMcpServerTargetOptions

Options for adding an MCP Server target to a gateway.

- Source: [`aws-bedrockagentcore/lib/gateway/gateway.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-bedrockagentcore/lib/gateway/gateway.ts#L144)
- Type last changed: v2.255.0 · 19 May 2026

## Example

```ts
const gateway = new agentcore.Gateway(this, "MyGateway", {
  gatewayName: "my-gateway",
});

const oauth = agentcore.OAuth2CredentialProvider.usingGithub(this, "GhOAuth", {
  oAuth2CredentialProviderName: "github-oauth",
  clientId: "your-client-id",
  clientSecret: cdk.SecretValue.unsafePlainText("your-client-secret"),
});

gateway.addMcpServerTarget("Mcp", {
  gatewayTargetName: "mcp-server",
  description: "MCP with GitHub OAuth",
  endpoint: "https://my-mcp-server.example.com",
  credentialProviderConfigurations: [
    agentcore.GatewayCredentialProvider.fromOauthIdentity(oauth, {
      scopes: ["read:user"],
    }),
  ],
});
```

## Properties

- `credentialProviderConfigurations`: [ICredentialProviderConfig](/cdk/api/v2/docs/aws-cdk-lib.aws_bedrockagentcore.ICredentialProviderConfig.html)[] (required) — Credential providers for authentication.

  MCP servers require explicit authentication configuration.
  OAuth2 is strongly recommended over NoAuth.

- `description`: string — Optional description for the gateway target.

  **Default:** No description

- `endpoint`: string (required) — 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

- `gatewayTargetName`: string — The name of the gateway target Valid characters are a-z, A-Z, 0-9, _ (underscore) and - (hyphen).

  **Default:** auto generate
