@aws-cdk/aws-bedrock-agentcore-alpha 2.225.0-alpha.0 → 2.227.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +14021 -5792
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +343 -1
- package/README.md +880 -19
- package/agentcore/gateway/gateway-base.d.ts +292 -0
- package/agentcore/gateway/gateway-base.js +171 -0
- package/agentcore/gateway/gateway.d.ts +383 -0
- package/agentcore/gateway/gateway.js +521 -0
- package/agentcore/gateway/inbound-auth/authorizer.d.ts +121 -0
- package/agentcore/gateway/inbound-auth/authorizer.js +133 -0
- package/agentcore/gateway/outbound-auth/api-key.d.ts +117 -0
- package/agentcore/gateway/outbound-auth/api-key.js +141 -0
- package/agentcore/gateway/outbound-auth/credential-provider.d.ts +70 -0
- package/agentcore/gateway/outbound-auth/credential-provider.js +80 -0
- package/agentcore/gateway/outbound-auth/iam-role.d.ts +28 -0
- package/agentcore/gateway/outbound-auth/iam-role.js +40 -0
- package/agentcore/gateway/outbound-auth/oauth.d.ts +80 -0
- package/agentcore/gateway/outbound-auth/oauth.js +76 -0
- package/agentcore/gateway/perms.d.ts +75 -0
- package/agentcore/gateway/perms.js +112 -0
- package/agentcore/gateway/protocol.d.ts +121 -0
- package/agentcore/gateway/protocol.js +120 -0
- package/agentcore/gateway/targets/schema/api-schema.d.ts +110 -0
- package/agentcore/gateway/targets/schema/api-schema.js +207 -0
- package/agentcore/gateway/targets/schema/base-schema.d.ts +24 -0
- package/agentcore/gateway/targets/schema/base-schema.js +12 -0
- package/agentcore/gateway/targets/schema/tool-schema.d.ts +198 -0
- package/agentcore/gateway/targets/schema/tool-schema.js +213 -0
- package/agentcore/gateway/targets/target-base.d.ts +153 -0
- package/agentcore/gateway/targets/target-base.js +81 -0
- package/agentcore/gateway/targets/target-configuration.d.ts +230 -0
- package/agentcore/gateway/targets/target-configuration.js +407 -0
- package/agentcore/gateway/targets/target.d.ts +345 -0
- package/agentcore/gateway/targets/target.js +444 -0
- package/agentcore/gateway/validation-helpers.d.ts +65 -0
- package/agentcore/gateway/validation-helpers.js +333 -0
- package/agentcore/index.d.ts +15 -0
- package/agentcore/index.js +32 -1
- package/agentcore/memory/memory-strategy.js +1 -1
- package/agentcore/memory/memory.js +6 -3
- package/agentcore/memory/strategies/managed-strategy.js +1 -1
- package/agentcore/memory/strategies/self-managed-strategy.js +1 -1
- package/agentcore/network/network-configuration.js +4 -4
- package/agentcore/runtime/runtime-artifact.js +1 -1
- package/agentcore/runtime/runtime-authorizer-configuration.d.ts +1 -1
- package/agentcore/runtime/runtime-authorizer-configuration.js +6 -5
- package/agentcore/runtime/runtime-base.js +1 -1
- package/agentcore/runtime/runtime-endpoint-base.js +1 -1
- package/agentcore/runtime/runtime-endpoint.js +1 -1
- package/agentcore/runtime/runtime.js +1 -1
- package/agentcore/tools/browser.js +2 -2
- package/agentcore/tools/code-interpreter.js +2 -2
- package/package.json +9 -9
- package/rosetta/default.ts-fixture +15 -6
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GatewayTargetBase = exports.McpTargetType = exports.GatewayTargetProtocolType = void 0;
|
|
4
|
+
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
5
|
+
const aws_cdk_lib_1 = require("aws-cdk-lib");
|
|
6
|
+
const iam = require("aws-cdk-lib/aws-iam");
|
|
7
|
+
/******************************************************************************
|
|
8
|
+
* ENUM
|
|
9
|
+
*****************************************************************************/
|
|
10
|
+
/**
|
|
11
|
+
* Protocol types supported by gateway targets
|
|
12
|
+
*/
|
|
13
|
+
var GatewayTargetProtocolType;
|
|
14
|
+
(function (GatewayTargetProtocolType) {
|
|
15
|
+
/** Model Context Protocol type */
|
|
16
|
+
GatewayTargetProtocolType["MCP"] = "MCP";
|
|
17
|
+
})(GatewayTargetProtocolType || (exports.GatewayTargetProtocolType = GatewayTargetProtocolType = {}));
|
|
18
|
+
/**
|
|
19
|
+
* MCP target types
|
|
20
|
+
*/
|
|
21
|
+
var McpTargetType;
|
|
22
|
+
(function (McpTargetType) {
|
|
23
|
+
/** OpenAPI schema target type */
|
|
24
|
+
McpTargetType["OPENAPI_SCHEMA"] = "OPENAPI_SCHEMA";
|
|
25
|
+
/** Smithy model target type */
|
|
26
|
+
McpTargetType["SMITHY_MODEL"] = "SMITHY_MODEL";
|
|
27
|
+
/** Lambda function target type */
|
|
28
|
+
McpTargetType["LAMBDA"] = "LAMBDA";
|
|
29
|
+
/** MCP server target type */
|
|
30
|
+
McpTargetType["MCP_SERVER"] = "MCP_SERVER";
|
|
31
|
+
})(McpTargetType || (exports.McpTargetType = McpTargetType = {}));
|
|
32
|
+
/******************************************************************************
|
|
33
|
+
* Base Class
|
|
34
|
+
*****************************************************************************/
|
|
35
|
+
/**
|
|
36
|
+
* Base class for gateway target implementations
|
|
37
|
+
*
|
|
38
|
+
* Provides common functionality for all gateway target types including
|
|
39
|
+
* permission management and property definitions.
|
|
40
|
+
*/
|
|
41
|
+
class GatewayTargetBase extends aws_cdk_lib_1.Resource {
|
|
42
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@aws-cdk/aws-bedrock-agentcore-alpha.GatewayTargetBase", version: "2.227.0-alpha.0" };
|
|
43
|
+
/**
|
|
44
|
+
* Grants IAM actions to the IAM Principal
|
|
45
|
+
*
|
|
46
|
+
* @param grantee The principal to grant permissions to
|
|
47
|
+
* @param actions The IAM actions to grant
|
|
48
|
+
*/
|
|
49
|
+
grant(grantee, ...actions) {
|
|
50
|
+
return iam.Grant.addToPrincipal({
|
|
51
|
+
grantee: grantee,
|
|
52
|
+
resourceArns: [this.targetArn],
|
|
53
|
+
actions: actions,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Grants `Get` and `List` actions on the Gateway Target
|
|
58
|
+
*
|
|
59
|
+
* @param grantee The principal to grant read permissions to
|
|
60
|
+
*/
|
|
61
|
+
grantRead(grantee) {
|
|
62
|
+
const resourceSpecificGrant = this.grant(grantee, 'bedrock-agentcore:GetGatewayTarget');
|
|
63
|
+
const allResourceGrant = iam.Grant.addToPrincipal({
|
|
64
|
+
grantee: grantee,
|
|
65
|
+
resourceArns: ['*'],
|
|
66
|
+
actions: ['bedrock-agentcore:ListGatewayTargets'],
|
|
67
|
+
});
|
|
68
|
+
// Return combined grant
|
|
69
|
+
return resourceSpecificGrant.combine(allResourceGrant);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Grants `Create`, `Update`, and `Delete` actions on the Gateway Target
|
|
73
|
+
*
|
|
74
|
+
* @param grantee The principal to grant manage permissions to
|
|
75
|
+
*/
|
|
76
|
+
grantManage(grantee) {
|
|
77
|
+
return this.grant(grantee, 'bedrock-agentcore:CreateGatewayTarget', 'bedrock-agentcore:UpdateGatewayTarget', 'bedrock-agentcore:DeleteGatewayTarget');
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.GatewayTargetBase = GatewayTargetBase;
|
|
81
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFyZ2V0LWJhc2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJ0YXJnZXQtYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsNkNBQWtEO0FBQ2xELDJDQUEyQztBQUkzQzs7K0VBRStFO0FBQy9FOztHQUVHO0FBQ0gsSUFBWSx5QkFHWDtBQUhELFdBQVkseUJBQXlCO0lBQ25DLGtDQUFrQztJQUNsQyx3Q0FBVyxDQUFBO0FBQ2IsQ0FBQyxFQUhXLHlCQUF5Qix5Q0FBekIseUJBQXlCLFFBR3BDO0FBRUQ7O0dBRUc7QUFDSCxJQUFZLGFBU1g7QUFURCxXQUFZLGFBQWE7SUFDdkIsaUNBQWlDO0lB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iBTbWl0aHkgbW9kZWwgdGFyZ2V0IHR5cGUgKi9cbiAgU01JVEhZX01PREVMID0gJ1NNSVRIWV9NT0RFTCcsXG4gIC8qKiBMYW1iZGEgZnVuY3Rpb24gdGFyZ2V0IHR5cGUgKi9cbiAgTEFNQkRBID0gJ0xBTUJEQScsXG4gIC8qKiBNQ1Agc2VydmVyIHRhcmdldCB0eXBlICovXG4gIE1DUF9TRVJWRVIgPSAnTUNQX1NFUlZFUicsXG59XG5cbi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnRlcmZhY2VcbiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi9cblxuLyoqXG4gKiBJbnRlcmZhY2UgZm9yIEdhdGV3YXlUYXJnZXQgcmVzb3VyY2VzXG4gKlxuICogUmVwcmVzZW50cyBhIHRhcmdldCB0aGF0IGhvc3RzIHRvb2xzIGZvciB0aGUgZ2F0ZXdheS5cbiAqIFRhcmdldHMgY2FuIGJlIExhbWJkYSBmdW5jdGlvbnMsIE9wZW5BUEkgc2NoZW1hcywgb3IgU21pdGh5IG1vZGVscy5cbiAqL1xuZXhwb3J0IGludGVyZmFjZSBJR2F0ZXdheVRhcmdldCBleHRlbmRzIElSZXNvdXJjZSB7XG4gIC8qKlxuICAgKiBUaGUgQVJOIG9mIHRoZSBnYXRld2F5IHRhcmdldCByZXNvdXJjZVxuICAgKiBAYXR0cmlidXRlXG4gICAqL1xuICByZWFkb25seSB0YXJnZXRBcm46IHN0cmluZztcblxuICAvKipcbiAgICogVGhlIGlkIG9mIHRoZSBnYXRld2F5IHRhcmdldFxuICAgKiBAYXR0cmlidXRlXG4gICAqL1xuICByZWFkb25seSB0YXJnZXRJZDogc3RyaW5nO1xuXG4gIC8qKl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GFyZ2V0IHtcbiAgLyoqXG4gICAqIFRoZSB0eXBlIG9mIHRhcmdldCAoTGFtYmRhLCBPcGVuQVBJLCBvciBTbWl0aHkpXG4gICAqL1xuICByZWFkb25seSB0YXJnZXRUeXBlOiBNY3BUYXJnZXRUeXBlO1xufVxuXG4vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmFzZSBDbGFzc1xuICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqL1xuLyoqXG4gKiBCYXNlIGNsYXNzIGZvciBnYXRld2F5IHRhcmdldCBpbXBsZW1lbnRhdGlvbnNcbiAqXG4gKiBQcm92aWRlcyBjb21tb24gZnVuY3Rpb25hbGl0eSBmb3IgYWxsIGdhdGV3YXkgdGFyZ2V0IHR5cGVzIGluY2x1ZGluZ1xuICogcGVybWlzc2lvbiBtYW5hZ2VtZW50IGFuZCBwcm9wZXJ0eSBkZWZpbml0aW9ucy5cbiAqL1xuZXhwb3J0IGFic3RyYWN0IGNsYXNzIEdhdGV3YXlUYXJnZXRCYXNlIGV4dGVuZHMgUmVzb3VyY2UgaW1wbGVtZW50cyBJR2F0ZXdheVRhcmdldCB7XG4gIHB1YmxpYyBhYnN0cmFjdCByZWFkb25seSB0YXJnZXRBcm46IHN0cmluZztcbiAgcHVibGljIGFic3RyYWN0IHJlYWRvbmx5IHRhcmdldElkOiBzdHJpbmc7XG4gIHB1YmxpYyBhYnN0cmFjdCByZWFkb25seSBuYW1lOiBzdHJpbmc7XG4gIHB1YmxpYyBhYnN0cmFjdCByZWFkb25seSBkZXNjcmlwdGlvbj86IHN0cmluZztcbiAgcHVibGljIGFic3RyYWN0IHJlYWRvbmx5IGdhdGV3YXk6IElHYXRld2F5O1xuICBwdWJsaWMgYWJz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ICAnYmVkcm9jay1hZ2VudGNvcmU6VXBkYXRlR2F0ZXdheVRhcmdldCcsXG4gICAgICAnYmVkcm9jay1hZ2VudGNvcmU6RGVsZXRlR2F0ZXdheVRhcmdldCcsXG4gICAgKTtcbiAgfVxufVxuIl19
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { IFunction } from 'aws-cdk-lib/aws-lambda';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
import { IGateway } from '../gateway-base';
|
|
4
|
+
import { ApiSchema } from './schema/api-schema';
|
|
5
|
+
import { ToolSchema } from './schema/tool-schema';
|
|
6
|
+
import { McpTargetType } from './target-base';
|
|
7
|
+
/******************************************************************************
|
|
8
|
+
* Interface
|
|
9
|
+
*****************************************************************************/
|
|
10
|
+
/**
|
|
11
|
+
* Configuration returned by binding a target configuration
|
|
12
|
+
*/
|
|
13
|
+
export interface TargetConfigurationConfig {
|
|
14
|
+
/**
|
|
15
|
+
* Indicates that the configuration has been successfully bound
|
|
16
|
+
*/
|
|
17
|
+
readonly bound: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Base interface for target configurations
|
|
21
|
+
*/
|
|
22
|
+
export interface ITargetConfiguration {
|
|
23
|
+
/**
|
|
24
|
+
* The target type
|
|
25
|
+
*/
|
|
26
|
+
readonly targetType: McpTargetType;
|
|
27
|
+
/**
|
|
28
|
+
* Binds the configuration to a construct scope
|
|
29
|
+
* Sets up permissions and dependencies
|
|
30
|
+
*/
|
|
31
|
+
bind(scope: Construct, gateway: IGateway): TargetConfigurationConfig;
|
|
32
|
+
/**
|
|
33
|
+
* Renders the configuration as CloudFormation properties
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
_render(): any;
|
|
37
|
+
}
|
|
38
|
+
/******************************************************************************
|
|
39
|
+
* MCP Target Configuration Base
|
|
40
|
+
*****************************************************************************/
|
|
41
|
+
/**
|
|
42
|
+
* Abstract base class for MCP target configurations
|
|
43
|
+
* Provides common functionality for all MCP target types
|
|
44
|
+
*/
|
|
45
|
+
export declare abstract class McpTargetConfiguration implements ITargetConfiguration {
|
|
46
|
+
/**
|
|
47
|
+
* The target type
|
|
48
|
+
*/
|
|
49
|
+
abstract readonly targetType: McpTargetType;
|
|
50
|
+
/**
|
|
51
|
+
* Binds the configuration to a construct scope
|
|
52
|
+
* Sets up permissions and dependencies
|
|
53
|
+
*/
|
|
54
|
+
abstract bind(scope: Construct, gateway: IGateway): TargetConfigurationConfig;
|
|
55
|
+
/**
|
|
56
|
+
* Renders the MCP-specific configuration
|
|
57
|
+
*/
|
|
58
|
+
protected abstract renderMcpConfiguration(): any;
|
|
59
|
+
/**
|
|
60
|
+
* Renders the configuration as CloudFormation properties
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
_render(): any;
|
|
64
|
+
}
|
|
65
|
+
/******************************************************************************
|
|
66
|
+
* Lambda Target Configuration
|
|
67
|
+
*****************************************************************************/
|
|
68
|
+
/**
|
|
69
|
+
* Configuration for Lambda-based MCP targets
|
|
70
|
+
*
|
|
71
|
+
* This configuration wraps a Lambda function as MCP tools,
|
|
72
|
+
* allowing the gateway to invoke the function to provide tool capabilities.
|
|
73
|
+
*/
|
|
74
|
+
export declare class LambdaTargetConfiguration extends McpTargetConfiguration {
|
|
75
|
+
/**
|
|
76
|
+
* Create a Lambda target configuration
|
|
77
|
+
*
|
|
78
|
+
* @param lambdaFunction The Lambda function to invoke
|
|
79
|
+
* @param toolSchema The schema defining the tools
|
|
80
|
+
* @returns A new LambdaTargetConfiguration instance
|
|
81
|
+
*/
|
|
82
|
+
static create(lambdaFunction: IFunction, toolSchema: ToolSchema): LambdaTargetConfiguration;
|
|
83
|
+
readonly targetType = McpTargetType.LAMBDA;
|
|
84
|
+
/**
|
|
85
|
+
* The Lambda function that implements the MCP server logic
|
|
86
|
+
*/
|
|
87
|
+
readonly lambdaFunction: IFunction;
|
|
88
|
+
/**
|
|
89
|
+
* The tool schema that defines the available tools
|
|
90
|
+
*/
|
|
91
|
+
readonly toolSchema: ToolSchema;
|
|
92
|
+
constructor(lambdaFunction: IFunction, toolSchema: ToolSchema);
|
|
93
|
+
/**
|
|
94
|
+
* Binds this configuration to a construct scope
|
|
95
|
+
* Sets up necessary permissions for the gateway to invoke the Lambda function
|
|
96
|
+
*
|
|
97
|
+
* @param scope The construct scope
|
|
98
|
+
* @param gateway The gateway that will use this target
|
|
99
|
+
*/
|
|
100
|
+
bind(scope: Construct, gateway: IGateway): TargetConfigurationConfig;
|
|
101
|
+
/**
|
|
102
|
+
* Renders the MCP-specific configuration
|
|
103
|
+
*/
|
|
104
|
+
protected renderMcpConfiguration(): any;
|
|
105
|
+
}
|
|
106
|
+
/******************************************************************************
|
|
107
|
+
* OpenAPI Target Configuration
|
|
108
|
+
*****************************************************************************/
|
|
109
|
+
/**
|
|
110
|
+
* Configuration for OpenAPI-based MCP targets
|
|
111
|
+
*
|
|
112
|
+
* This configuration exposes an OpenAPI/REST API as MCP tools,
|
|
113
|
+
* allowing the gateway to transform API operations into tool calls.
|
|
114
|
+
*/
|
|
115
|
+
export declare class OpenApiTargetConfiguration extends McpTargetConfiguration {
|
|
116
|
+
/**
|
|
117
|
+
* Create an OpenAPI target configuration
|
|
118
|
+
*
|
|
119
|
+
* @param apiSchema The OpenAPI schema
|
|
120
|
+
* @param validateSchema Whether to validate the OpenAPI schema (only applies to inline schemas)
|
|
121
|
+
* @returns A new OpenApiTargetConfiguration instance
|
|
122
|
+
*/
|
|
123
|
+
static create(apiSchema: ApiSchema, validateSchema?: boolean): OpenApiTargetConfiguration;
|
|
124
|
+
readonly targetType = McpTargetType.OPENAPI_SCHEMA;
|
|
125
|
+
/**
|
|
126
|
+
* The OpenAPI schema that defines the API
|
|
127
|
+
*/
|
|
128
|
+
readonly apiSchema: ApiSchema;
|
|
129
|
+
/**
|
|
130
|
+
* Whether to validate the OpenAPI schema
|
|
131
|
+
*/
|
|
132
|
+
private readonly shouldValidateSchema;
|
|
133
|
+
constructor(apiSchema: ApiSchema, validateSchema?: boolean);
|
|
134
|
+
/**
|
|
135
|
+
* Binds this configuration to a construct scope
|
|
136
|
+
* Sets up necessary permissions for the gateway to access the API schema
|
|
137
|
+
*
|
|
138
|
+
* @param scope The construct scope
|
|
139
|
+
* @param gateway The gateway that will use this target
|
|
140
|
+
*/
|
|
141
|
+
bind(scope: Construct, gateway: IGateway): TargetConfigurationConfig;
|
|
142
|
+
/**
|
|
143
|
+
* Renders the MCP-specific configuration
|
|
144
|
+
*/
|
|
145
|
+
protected renderMcpConfiguration(): any;
|
|
146
|
+
}
|
|
147
|
+
/******************************************************************************
|
|
148
|
+
* Smithy Target Configuration
|
|
149
|
+
*****************************************************************************/
|
|
150
|
+
/**
|
|
151
|
+
* Configuration for Smithy-based MCP targets
|
|
152
|
+
*
|
|
153
|
+
* This configuration exposes a Smithy-modeled API as MCP tools,
|
|
154
|
+
* allowing the gateway to transform Smithy operations into tool calls.
|
|
155
|
+
*/
|
|
156
|
+
export declare class SmithyTargetConfiguration extends McpTargetConfiguration {
|
|
157
|
+
/**
|
|
158
|
+
* Create a Smithy target configuration
|
|
159
|
+
*
|
|
160
|
+
* @param smithyModel The Smithy model schema
|
|
161
|
+
* @returns A new SmithyTargetConfiguration instance
|
|
162
|
+
*/
|
|
163
|
+
static create(smithyModel: ApiSchema): SmithyTargetConfiguration;
|
|
164
|
+
readonly targetType = McpTargetType.SMITHY_MODEL;
|
|
165
|
+
/**
|
|
166
|
+
* The Smithy model that defines the API
|
|
167
|
+
*/
|
|
168
|
+
readonly smithyModel: ApiSchema;
|
|
169
|
+
constructor(smithyModel: ApiSchema);
|
|
170
|
+
/**
|
|
171
|
+
* Binds this configuration to a construct scope
|
|
172
|
+
* Sets up necessary permissions for the gateway to access the Smithy model
|
|
173
|
+
*
|
|
174
|
+
* @param scope The construct scope
|
|
175
|
+
* @param gateway The gateway that will use this target
|
|
176
|
+
*/
|
|
177
|
+
bind(scope: Construct, gateway: IGateway): TargetConfigurationConfig;
|
|
178
|
+
/**
|
|
179
|
+
* Renders the MCP-specific configuration
|
|
180
|
+
*/
|
|
181
|
+
protected renderMcpConfiguration(): any;
|
|
182
|
+
}
|
|
183
|
+
/******************************************************************************
|
|
184
|
+
* MCP Server Target Configuration
|
|
185
|
+
*****************************************************************************/
|
|
186
|
+
/**
|
|
187
|
+
* Configuration for MCP Server-based targets
|
|
188
|
+
*
|
|
189
|
+
* MCP (Model Context Protocol) servers provide tools, data access, and custom
|
|
190
|
+
* functions for AI agents. When you configure an MCP server as a gateway target,
|
|
191
|
+
* the gateway automatically discovers and indexes available tools through
|
|
192
|
+
* synchronization.
|
|
193
|
+
*/
|
|
194
|
+
export declare class McpServerTargetConfiguration extends McpTargetConfiguration {
|
|
195
|
+
/**
|
|
196
|
+
* Create an MCP server target configuration
|
|
197
|
+
*
|
|
198
|
+
* @param endpoint The HTTPS endpoint URL of the MCP server
|
|
199
|
+
* @returns A new McpServerTargetConfiguration instance
|
|
200
|
+
*/
|
|
201
|
+
static create(endpoint: string): McpServerTargetConfiguration;
|
|
202
|
+
readonly targetType = McpTargetType.MCP_SERVER;
|
|
203
|
+
/**
|
|
204
|
+
* The HTTPS endpoint URL of the MCP server
|
|
205
|
+
*/
|
|
206
|
+
readonly endpoint: string;
|
|
207
|
+
constructor(endpoint: string);
|
|
208
|
+
/**
|
|
209
|
+
* Binds this configuration to a construct scope
|
|
210
|
+
* No additional permissions are needed for MCP server targets
|
|
211
|
+
*
|
|
212
|
+
* @param _scope The construct scope
|
|
213
|
+
* @param _gateway The gateway that will use this target
|
|
214
|
+
*/
|
|
215
|
+
bind(_scope: Construct, _gateway: IGateway): TargetConfigurationConfig;
|
|
216
|
+
/**
|
|
217
|
+
* Renders the MCP-specific configuration
|
|
218
|
+
*/
|
|
219
|
+
protected renderMcpConfiguration(): any;
|
|
220
|
+
/**
|
|
221
|
+
* Validates the MCP server endpoint
|
|
222
|
+
* - Must use HTTPS protocol
|
|
223
|
+
* - Should be properly URL encoded
|
|
224
|
+
*
|
|
225
|
+
* @param endpoint The endpoint URL to validate
|
|
226
|
+
* @throws ValidationError if the endpoint is invalid
|
|
227
|
+
* @internal
|
|
228
|
+
*/
|
|
229
|
+
private validateEndpoint;
|
|
230
|
+
}
|