bedrock-agentcore-starter-toolkit 0.1.6__py3-none-any.whl → 0.1.8__py3-none-any.whl

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.

Potentially problematic release.


This version of bedrock-agentcore-starter-toolkit might be problematic. Click here for more details.

Files changed (18) hide show
  1. bedrock_agentcore_starter_toolkit/cli/cli.py +3 -1
  2. bedrock_agentcore_starter_toolkit/operations/gateway/client.py +1 -1
  3. bedrock_agentcore_starter_toolkit/operations/runtime/create_role.py +1 -1
  4. bedrock_agentcore_starter_toolkit/operations/runtime/launch.py +20 -26
  5. bedrock_agentcore_starter_toolkit/services/codebuild.py +29 -21
  6. bedrock_agentcore_starter_toolkit/services/runtime.py +1 -1
  7. bedrock_agentcore_starter_toolkit/utils/runtime/entrypoint.py +0 -41
  8. bedrock_agentcore_starter_toolkit/utils/runtime/logs.py +1 -1
  9. bedrock_agentcore_starter_toolkit/utils/runtime/templates/Dockerfile.j2 +7 -4
  10. bedrock_agentcore_starter_toolkit/utils/runtime/templates/execution_role_policy.json.j2 +65 -1
  11. bedrock_agentcore_starter_toolkit-0.1.8.dist-info/METADATA +132 -0
  12. {bedrock_agentcore_starter_toolkit-0.1.6.dist-info → bedrock_agentcore_starter_toolkit-0.1.8.dist-info}/RECORD +16 -17
  13. bedrock_agentcore_starter_toolkit/operations/gateway/README.md +0 -277
  14. bedrock_agentcore_starter_toolkit-0.1.6.dist-info/METADATA +0 -157
  15. {bedrock_agentcore_starter_toolkit-0.1.6.dist-info → bedrock_agentcore_starter_toolkit-0.1.8.dist-info}/WHEEL +0 -0
  16. {bedrock_agentcore_starter_toolkit-0.1.6.dist-info → bedrock_agentcore_starter_toolkit-0.1.8.dist-info}/entry_points.txt +0 -0
  17. {bedrock_agentcore_starter_toolkit-0.1.6.dist-info → bedrock_agentcore_starter_toolkit-0.1.8.dist-info}/licenses/LICENSE.txt +0 -0
  18. {bedrock_agentcore_starter_toolkit-0.1.6.dist-info → bedrock_agentcore_starter_toolkit-0.1.8.dist-info}/licenses/NOTICE.txt +0 -0
@@ -16,7 +16,6 @@ setup_toolkit_logging(mode="cli")
16
16
  app.command("invoke")(invoke)
17
17
  app.command("status")(status)
18
18
  app.command("launch")(launch)
19
- app.command("import-agent")(import_agent)
20
19
  app.add_typer(configure_app)
21
20
 
22
21
  # gateway
@@ -24,6 +23,9 @@ app.command("create_mcp_gateway")(create_mcp_gateway)
24
23
  app.command("create_mcp_gateway_target")(create_mcp_gateway_target)
25
24
  app.add_typer(gateway_app, name="gateway")
26
25
 
26
+ # import-agent
27
+ app.command("import-agent")(import_agent)
28
+
27
29
 
28
30
  def main():
29
31
  """Entry point for the CLI application."""
@@ -84,7 +84,7 @@ class GatewayClient:
84
84
  "protocolType": "MCP",
85
85
  "authorizerType": "CUSTOM_JWT",
86
86
  "authorizerConfiguration": authorizer_config,
87
- "exceptionLevel": "DEBUG"
87
+ "exceptionLevel": "DEBUG",
88
88
  }
89
89
  if enable_semantic_search:
90
90
  create_request["protocolConfiguration"] = {"mcp": {"searchType": "SEMANTIC"}}
@@ -395,7 +395,7 @@ def get_or_create_codebuild_execution_role(
395
395
  logger.info("Waiting for IAM role propagation...")
396
396
  import time
397
397
 
398
- time.sleep(15)
398
+ time.sleep(10)
399
399
 
400
400
  logger.info("CodeBuild execution role creation complete: %s", role_arn)
401
401
  return role_arn
@@ -101,15 +101,6 @@ def _ensure_execution_role(agent_config, project_config, config_path, agent_name
101
101
  # Step 1: Check if we already have a role in config
102
102
  if execution_role_arn:
103
103
  log.info("Using execution role from config: %s", execution_role_arn)
104
-
105
- # Step 2: Basic validation for existing roles
106
- if not _validate_execution_role(execution_role_arn, session):
107
- raise ValueError(
108
- f"Execution role {execution_role_arn} has invalid trust policy. "
109
- "Ensure it allows bedrock-agentcore.amazonaws.com service to assume the role."
110
- )
111
-
112
- log.info("✅ Execution role validation passed: %s", execution_role_arn)
113
104
  return execution_role_arn
114
105
 
115
106
  # Step 3: Create role if needed (idempotent)
@@ -363,7 +354,7 @@ def launch_bedrock_agentcore(
363
354
  ecr_uri = _ensure_ecr_repository(agent_config, project_config, config_path, bedrock_agentcore_name, region)
364
355
 
365
356
  # Deploy to ECR
366
- repo_name = ecr_uri.split("/")[-1]
357
+ repo_name = "/".join(ecr_uri.split("/")[1:])
367
358
  deploy_to_ecr(tag, repo_name, region, runtime)
368
359
 
369
360
  log.info("Image uploaded to ECR: %s", ecr_uri)
@@ -431,18 +422,28 @@ def _execute_codebuild_workflow(
431
422
  log.info("Preparing CodeBuild project and uploading source...")
432
423
  codebuild_service = CodeBuildService(session)
433
424
 
434
- codebuild_execution_role = codebuild_service.create_codebuild_execution_role(
435
- account_id=account_id, ecr_repository_arn=ecr_repository_arn, agent_name=agent_name
436
- )
425
+ # Use cached CodeBuild role from config if available
426
+ if hasattr(agent_config, "codebuild") and agent_config.codebuild.execution_role:
427
+ log.info("Using CodeBuild role from config: %s", agent_config.codebuild.execution_role)
428
+ codebuild_execution_role = agent_config.codebuild.execution_role
429
+ else:
430
+ codebuild_execution_role = codebuild_service.create_codebuild_execution_role(
431
+ account_id=account_id, ecr_repository_arn=ecr_repository_arn, agent_name=agent_name
432
+ )
437
433
 
438
434
  source_location = codebuild_service.upload_source(agent_name=agent_name)
439
435
 
440
- project_name = codebuild_service.create_or_update_project(
441
- agent_name=agent_name,
442
- ecr_repository_uri=ecr_uri,
443
- execution_role=codebuild_execution_role,
444
- source_location=source_location,
445
- )
436
+ # Use cached project name from config if available
437
+ if hasattr(agent_config, "codebuild") and agent_config.codebuild.project_name:
438
+ log.info("Using CodeBuild project from config: %s", agent_config.codebuild.project_name)
439
+ project_name = agent_config.codebuild.project_name
440
+ else:
441
+ project_name = codebuild_service.create_or_update_project(
442
+ agent_name=agent_name,
443
+ ecr_repository_uri=ecr_uri,
444
+ execution_role=codebuild_execution_role,
445
+ source_location=source_location,
446
+ )
446
447
 
447
448
  # Execute CodeBuild
448
449
  log.info("Starting CodeBuild build (this may take several minutes)...")
@@ -475,13 +476,6 @@ def _launch_with_codebuild(
475
476
  env_vars: Optional[dict] = None,
476
477
  ) -> LaunchResult:
477
478
  """Launch using CodeBuild for ARM64 builds."""
478
- log.info(
479
- "Starting CodeBuild ARM64 deployment for agent '%s' to account %s (%s)",
480
- agent_name,
481
- agent_config.aws.account,
482
- agent_config.aws.region,
483
- )
484
-
485
479
  # Execute shared CodeBuild workflow with full deployment mode
486
480
  build_id, ecr_uri, region, account_id = _execute_codebuild_workflow(
487
481
  config_path=config_path,
@@ -6,7 +6,6 @@ import os
6
6
  import tempfile
7
7
  import time
8
8
  import zipfile
9
- from datetime import datetime, timezone
10
9
  from pathlib import Path
11
10
  from typing import List
12
11
 
@@ -99,9 +98,8 @@ class CodeBuildService:
99
98
  file_path = Path(root) / file
100
99
  zipf.write(file_path, file_rel_path)
101
100
 
102
- # Create agent-organized S3 key: agentname/timestamp.zip
103
- timestamp = datetime.now(timezone.utc).strftime("%Y%m%d-%H%M%S")
104
- s3_key = f"{agent_name}/{timestamp}.zip"
101
+ # Create agent-organized S3 key: agentname/source.zip (fixed naming for cache consistency)
102
+ s3_key = f"{agent_name}/source.zip"
105
103
 
106
104
  self.s3_client.upload_file(temp_zip.name, bucket_name, s3_key)
107
105
 
@@ -109,6 +107,7 @@ class CodeBuildService:
109
107
  return f"s3://{bucket_name}/{s3_key}"
110
108
 
111
109
  finally:
110
+ temp_zip.close()
112
111
  os.unlink(temp_zip.name)
113
112
 
114
113
  def _normalize_s3_location(self, source_location: str) -> str:
@@ -151,7 +150,7 @@ class CodeBuildService:
151
150
  "environment": {
152
151
  "type": "ARM_CONTAINER", # ARM64 images require ARM_CONTAINER environment type
153
152
  "image": "aws/codebuild/amazonlinux2-aarch64-standard:3.0",
154
- "computeType": "BUILD_GENERAL1_LARGE", # 4 vCPUs, 7GB RAM for faster builds
153
+ "computeType": "BUILD_GENERAL1_MEDIUM", # 4 vCPUs, 7GB RAM - optimal for I/O workloads
155
154
  "privilegedMode": True, # Required for Docker
156
155
  },
157
156
  "serviceRole": execution_role,
@@ -227,37 +226,46 @@ class CodeBuildService:
227
226
  self.logger.error("❌ Build failed during %s phase", current_phase)
228
227
  raise RuntimeError(f"CodeBuild failed with status: {status}")
229
228
 
230
- time.sleep(5)
229
+ time.sleep(1)
231
230
 
232
231
  total_duration = time.time() - build_start_time
233
232
  minutes, seconds = divmod(int(total_duration), 60)
234
233
  raise TimeoutError(f"CodeBuild timed out after {minutes}m {seconds}s (current phase: {current_phase})")
235
234
 
236
235
  def _get_arm64_buildspec(self, ecr_repository_uri: str) -> str:
237
- """Get optimized buildspec for ARM64 Docker."""
236
+ """Get optimized buildspec with parallel ECR authentication."""
238
237
  return f"""
239
238
  version: 0.2
240
239
  phases:
241
- pre_build:
242
- commands:
243
- - echo Logging in to Amazon ECR...
244
- - aws ecr get-login-password --region $AWS_DEFAULT_REGION |
245
- docker login --username AWS --password-stdin {ecr_repository_uri}
246
- - export DOCKER_BUILDKIT=1
247
- - export BUILDKIT_PROGRESS=plain
248
240
  build:
249
241
  commands:
250
- - echo Build started on `date`
251
- - echo Building ARM64 Docker image with BuildKit processing...
252
- - export DOCKER_BUILDKIT=1
253
- - docker buildx create --name arm64builder --use || true
254
- - docker buildx build --platform linux/arm64 --load -t bedrock-agentcore-arm64 .
242
+ - echo "Starting parallel Docker build and ECR authentication..."
243
+ - |
244
+ docker build -t bedrock-agentcore-arm64 . &
245
+ BUILD_PID=$!
246
+ aws ecr get-login-password --region $AWS_DEFAULT_REGION | \\
247
+ docker login --username AWS --password-stdin {ecr_repository_uri} &
248
+ AUTH_PID=$!
249
+ echo "Waiting for Docker build to complete..."
250
+ wait $BUILD_PID
251
+ if [ $? -ne 0 ]; then
252
+ echo "Docker build failed"
253
+ exit 1
254
+ fi
255
+ echo "Waiting for ECR authentication to complete..."
256
+ wait $AUTH_PID
257
+ if [ $? -ne 0 ]; then
258
+ echo "ECR authentication failed"
259
+ exit 1
260
+ fi
261
+ echo "Both build and auth completed successfully"
262
+ - echo "Tagging image..."
255
263
  - docker tag bedrock-agentcore-arm64:latest {ecr_repository_uri}:latest
256
264
  post_build:
257
265
  commands:
258
- - echo Build completed on `date`
259
- - echo Pushing ARM64 image to ECR...
266
+ - echo "Pushing ARM64 image to ECR..."
260
267
  - docker push {ecr_repository_uri}:latest
268
+ - echo "Build completed at $(date)"
261
269
  """
262
270
 
263
271
  def _parse_dockerignore(self) -> List[str]:
@@ -343,7 +343,7 @@ class BedrockAgentCoreClient:
343
343
  except Exception as e:
344
344
  if "ResourceNotFoundException" not in str(e):
345
345
  raise
346
- time.sleep(2)
346
+ time.sleep(1)
347
347
  return (
348
348
  f"Endpoint is taking longer than {max_wait} seconds to be ready, "
349
349
  f"please check status and try to invoke after some time"
@@ -32,47 +32,6 @@ def parse_entrypoint(entrypoint: str) -> Tuple[Path, str]:
32
32
  return file_path, file_name
33
33
 
34
34
 
35
- def handle_requirements_file(
36
- requirements_file: Optional[str] = None, build_dir: Optional[Path] = None
37
- ) -> Optional[str]:
38
- """Handle requirements file selection and validation.
39
-
40
- Args:
41
- requirements_file: Optional path to requirements file
42
- build_dir: Build directory, defaults to current directory
43
-
44
- Returns:
45
- Validated requirements file path or None
46
-
47
- Raises:
48
- ValueError: If specified requirements file is invalid
49
- """
50
- if build_dir is None:
51
- build_dir = Path.cwd()
52
-
53
- if requirements_file:
54
- log.info("Validating requirements file: %s", requirements_file)
55
- # Validate provided requirements file
56
- try:
57
- deps = validate_requirements_file(build_dir, requirements_file)
58
- log.info("Requirements file validated: %s", requirements_file)
59
- return requirements_file
60
- except (FileNotFoundError, ValueError) as e:
61
- log.error("Requirements file validation failed: %s", e)
62
- raise ValueError(str(e)) from e
63
-
64
- # Auto-detect dependencies (no validation needed, just detection)
65
- log.info("Auto-detecting dependencies in: %s", build_dir)
66
- deps = detect_dependencies(build_dir)
67
-
68
- if deps.found:
69
- log.info("Dependencies detected: %s", deps.file)
70
- return None # Let operations handle the detected file
71
- else:
72
- log.info("No dependency files found")
73
- return None # No file found or specified
74
-
75
-
76
35
  @dataclass
77
36
  class DependencyInfo:
78
37
  """Information about project dependencies."""
@@ -15,7 +15,7 @@ def get_agent_log_paths(agent_id: str, endpoint_name: Optional[str] = None) -> T
15
15
  """
16
16
  endpoint_name = endpoint_name or "DEFAULT"
17
17
  runtime_log_group = f"/aws/bedrock-agentcore/runtimes/{agent_id}-{endpoint_name}"
18
- otel_log_group = f"/aws/bedrock-agentcore/runtimes/{agent_id}-{endpoint_name}/runtime-logs"
18
+ otel_log_group = f"/aws/bedrock-agentcore/runtimes/{agent_id}-{endpoint_name} --log-stream-names otel-rt-logs"
19
19
  return runtime_log_group, otel_log_group
20
20
 
21
21
 
@@ -1,20 +1,23 @@
1
- FROM public.ecr.aws/docker/library/python:{{ python_version }}-slim
1
+ FROM ghcr.io/astral-sh/uv:python{{ python_version }}-bookworm-slim
2
2
  WORKDIR /app
3
3
 
4
+ # Configure UV for container environment
5
+ ENV UV_SYSTEM_PYTHON=1 UV_COMPILE_BYTECODE=1
6
+
4
7
  {% if dependencies_file %}
5
8
  {% if dependencies_install_path %}
6
9
  COPY {{ dependencies_install_path }} {{ dependencies_install_path }}
7
10
  # Install from pyproject.toml directory
8
- RUN pip install {{ dependencies_install_path }}
11
+ RUN uv pip install {{ dependencies_install_path }}
9
12
  {% else %}
10
13
  COPY {{ dependencies_file }} {{ dependencies_file }}
11
14
  # Install from requirements file
12
- RUN pip install -r {{ dependencies_file }}
15
+ RUN uv pip install -r {{ dependencies_file }}
13
16
  {% endif %}
14
17
  {% endif %}
15
18
 
16
19
  {% if observability_enabled %}
17
- RUN pip install aws-opentelemetry-distro>=0.10.1
20
+ RUN uv pip install aws-opentelemetry-distro>=0.10.1
18
21
  {% endif %}
19
22
 
20
23
  # Set AWS region environment variable
@@ -70,7 +70,71 @@
70
70
  }
71
71
  },
72
72
  {
73
- "Sid": "GetAgentAccessToken",
73
+ "Sid": "BedrockAgentCoreRuntime",
74
+ "Effect": "Allow",
75
+ "Action": [
76
+ "bedrock-agentcore:InvokeAgentRuntime"
77
+ ],
78
+ "Resource": [
79
+ "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:runtime/*"
80
+ ]
81
+ },
82
+ {
83
+ "Sid": "BedrockAgentCoreMemoryCreateMemory",
84
+ "Effect": "Allow",
85
+ "Action": [
86
+ "bedrock-agentcore:CreateMemory"
87
+ ],
88
+ "Resource": "*"
89
+ },
90
+ {
91
+ "Sid": "BedrockAgentCoreMemory",
92
+ "Effect": "Allow",
93
+ "Action": [
94
+ "bedrock-agentcore:CreateEvent",
95
+ "bedrock-agentcore:GetEvent",
96
+ "bedrock-agentcore:GetMemory",
97
+ "bedrock-agentcore:GetMemoryRecord",
98
+ "bedrock-agentcore:ListActors",
99
+ "bedrock-agentcore:ListEvents",
100
+ "bedrock-agentcore:ListMemoryRecords",
101
+ "bedrock-agentcore:ListSessions",
102
+ "bedrock-agentcore:DeleteEvent",
103
+ "bedrock-agentcore:DeleteMemoryRecord",
104
+ "bedrock-agentcore:RetrieveMemoryRecords"
105
+ ],
106
+ "Resource": [
107
+ "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:memory/*"
108
+ ]
109
+ },
110
+ {
111
+ "Sid": "BedrockAgentCoreIdentityGetResourceApiKey",
112
+ "Effect": "Allow",
113
+ "Action": [
114
+ "bedrock-agentcore:GetResourceApiKey"
115
+ ],
116
+ "Resource": [
117
+ "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:token-vault/default",
118
+ "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:token-vault/default/apikeycredentialprovider/*",
119
+ "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:workload-identity-directory/default",
120
+ "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:workload-identity-directory/default/workload-identity/{{ agent_name }}-*"
121
+ ]
122
+ },
123
+ {
124
+ "Sid": "BedrockAgentCoreIdentityGetResourceOauth2Token",
125
+ "Effect": "Allow",
126
+ "Action": [
127
+ "bedrock-agentcore:GetResourceOauth2Token"
128
+ ],
129
+ "Resource": [
130
+ "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:token-vault/default",
131
+ "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:token-vault/default/oauth2credentialprovider/*",
132
+ "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:workload-identity-directory/default",
133
+ "arn:aws:bedrock-agentcore:{{ region }}:{{ account_id }}:workload-identity-directory/default/workload-identity/{{ agent_name }}-*"
134
+ ]
135
+ },
136
+ {
137
+ "Sid": "BedrockAgentCoreIdentityGetWorkloadAccessToken",
74
138
  "Effect": "Allow",
75
139
  "Action": [
76
140
  "bedrock-agentcore:GetWorkloadAccessToken",
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.4
2
+ Name: bedrock-agentcore-starter-toolkit
3
+ Version: 0.1.8
4
+ Summary: A starter toolkit for using Bedrock AgentCore
5
+ Project-URL: Homepage, https://github.com/aws/bedrock-agentcore-starter-toolkit
6
+ Project-URL: Bug Tracker, https://github.com/aws/bedrock-agentcore-starter-toolkit/issues
7
+ Project-URL: Documentation, https://github.com/aws/bedrock-agentcore-starter-toolkit
8
+ Author-email: AWS <opensource@amazon.com>
9
+ License: Apache-2.0
10
+ License-File: LICENSE.txt
11
+ License-File: NOTICE.txt
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: autopep8>=2.3.2
25
+ Requires-Dist: bedrock-agentcore>=0.1.2
26
+ Requires-Dist: boto3>=1.39.7
27
+ Requires-Dist: botocore>=1.39.7
28
+ Requires-Dist: docstring-parser<1.0,>=0.15
29
+ Requires-Dist: httpx>=0.28.1
30
+ Requires-Dist: jinja2>=3.1.6
31
+ Requires-Dist: openapi-spec-validator>=0.7.2
32
+ Requires-Dist: prance>=25.4.8.0
33
+ Requires-Dist: prompt-toolkit>=3.0.51
34
+ Requires-Dist: py-openapi-schema-to-json-schema>=0.0.3
35
+ Requires-Dist: pydantic<3.0.0,>=2.0.0
36
+ Requires-Dist: pyyaml>=6.0.2
37
+ Requires-Dist: questionary>=2.1.0
38
+ Requires-Dist: requests>=2.25.0
39
+ Requires-Dist: rich>=13.0.0
40
+ Requires-Dist: ruamel-yaml>=0.18.14
41
+ Requires-Dist: toml>=0.10.2
42
+ Requires-Dist: typer>=0.16.0
43
+ Requires-Dist: typing-extensions<5.0.0,>=4.13.2
44
+ Requires-Dist: urllib3>=1.26.0
45
+ Requires-Dist: uvicorn>=0.34.2
46
+ Description-Content-Type: text/markdown
47
+
48
+ <div align="center">
49
+ <h1>
50
+ Bedrock AgentCore Starter Toolkit
51
+ </h1>
52
+
53
+ <h2>
54
+ Deploy your local AI agent to Bedrock AgentCore with zero infrastructure
55
+ </h2>
56
+
57
+ <div align="center">
58
+ <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/graphs/commit-activity"><img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/aws/bedrock-agentcore-starter-toolkit"/></a>
59
+ <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/issues"><img alt="GitHub open issues" src="https://img.shields.io/github/issues/aws/bedrock-agentcore-starter-toolkit"/></a>
60
+ <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/pulls"><img alt="GitHub open pull requests" src="https://img.shields.io/github/issues-pr/aws/bedrock-agentcore-starter-toolkit"/></a>
61
+ <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/blob/main/LICENSE.txt"><img alt="License" src="https://img.shields.io/github/license/aws/bedrock-agentcore-starter-toolkit"/></a>
62
+ <a href="https://pypi.org/project/bedrock-agentcore-starter-toolkit"><img alt="PyPI version" src="https://img.shields.io/pypi/v/bedrock-agentcore-starter-toolkit"/></a>
63
+ <a href="https://python.org"><img alt="Python versions" src="https://img.shields.io/pypi/pyversions/bedrock-agentcore-starter-toolkit"/></a>
64
+ </div>
65
+
66
+ <p>
67
+ <a href="https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/what-is-bedrock-agentcore.html">Documentation</a>
68
+ ◆ <a href="https://github.com/awslabs/amazon-bedrock-agentcore-samples">Samples</a>
69
+ ◆ <a href="https://discord.gg/bedrockagentcore-preview">Discord</a>
70
+ ◆ <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-agentcore-control.html">Boto3 Python SDK</a>
71
+ ◆ <a href="https://github.com/aws/bedrock-agentcore-sdk-python">Runtime Python SDK</a>
72
+ ◆ <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit">Starter Toolkit</a>
73
+
74
+ </p>
75
+ </div>
76
+
77
+ ## Overview
78
+ Amazon Bedrock AgentCore enables you to deploy and operate highly effective agents securely, at scale using any framework and model. With Amazon Bedrock AgentCore, developers can accelerate AI agents into production with the scale, reliability, and security, critical to real-world deployment. AgentCore provides tools and capabilities to make agents more effective and capable, purpose-built infrastructure to securely scale agents, and controls to operate trustworthy agents. Amazon Bedrock AgentCore services are composable and work with popular open-source frameworks and any model, so you don’t have to choose between open-source flexibility and enterprise-grade security and reliability.
79
+
80
+ Amazon Bedrock AgentCore includes the following modular Services that you can use together or independently:
81
+
82
+ ## 🚀 Amazon Bedrock AgentCore Runtime
83
+ AgentCore Runtime is a secure, serverless runtime purpose-built for deploying and scaling dynamic AI agents and tools using any open-source framework including LangGraph, CrewAI, and Strands Agents, any protocol, and any model. Runtime was built to work for agentic workloads with industry-leading extended runtime support, fast cold starts, true session isolation, built-in identity, and support for multi-modal payloads. Developers can focus on innovation while Amazon Bedrock AgentCore Runtime handles infrastructure and security -- accelerating time-to-market
84
+
85
+ **[Runtime Quick Start](https://aws.github.io/bedrock-agentcore-starter-toolkit/user-guide/runtime/quickstart.html)**
86
+
87
+ ## 🧠 Amazon Bedrock AgentCore Memory
88
+ AgentCore Memory makes it easy for developers to build context aware agents by eliminating complex memory infrastructure management while providing full control over what the AI agent remembers. Memory provides industry-leading accuracy along with support for both short-term memory for multi-turn conversations and long-term memory that can be shared across agents and sessions.
89
+
90
+ **[Memory Quick Start](https://aws.github.io/bedrock-agentcore-starter-toolkit/user-guide/memory/quickstart.html)**
91
+
92
+ ## 🔗 Amazon Bedrock AgentCore Gateway
93
+ Amazon Bedrock AgentCore Gateway acts as a managed Model Context Protocol (MCP) server that converts APIs and Lambda functions into MCP tools that agents can use. Gateway manages the complexity of OAuth ingress authorization and secure egress credential exchange, making standing up remote MCP servers easier and more secure. Gateway also offers composition and built-in semantic search over tools, enabling developers to scale their agents to use hundreds or thousands of tools.
94
+
95
+ **[Gateway Quick Start](https://aws.github.io/bedrock-agentcore-starter-toolkit/user-guide/gateway/quickstart.html)**
96
+
97
+ ## 💻 Amazon Bedrock AgentCore Code Interpreter
98
+ AgentCore Code Interpreter tool enables agents to securely execute code in isolated sandbox environments. It offers advanced configuration support and seamless integration with popular frameworks. Developers can build powerful agents for complex workflows and data analysis while meeting enterprise security requirements.
99
+
100
+ **[Code Interpreter Quick Start](https://aws.github.io/bedrock-agentcore-starter-toolkit/user-guide/builtin-tools/quickstart-code-interpreter.html)**
101
+
102
+
103
+ ## 🌐 Amazon Bedrock AgentCore Browser
104
+ AgentCore Browser tool provides a fast, secure, cloud-based browser runtime to enable AI agents to interact with websites at scale. It provides enterprise-grade security, comprehensive observability features, and automatically scales— all without infrastructure management overhead.
105
+
106
+ **[Browser Quick Start](https://aws.github.io/bedrock-agentcore-starter-toolkit/user-guide/builtin-tools/quickstart-browser.html)**
107
+
108
+ ## 📊 Amazon Bedrock AgentCore Observability
109
+ AgentCore Observability helps developers trace, debug, and monitor agent performance in production through unified operational dashboards. With support for OpenTelemetry compatible telemetry and detailed visualizations of each step of the agent workflow, AgentCore enables developers to easily gain visibility into agent behavior and maintain quality standards at scale.
110
+
111
+ **[Observability Quick Start](https://aws.github.io/bedrock-agentcore-starter-toolkit/user-guide/observability/quickstart.html)**
112
+
113
+ ## 🔐 Amazon Bedrock AgentCore Identity
114
+ AgentCore Identity provides a secure, scalable agent identity and access management capability accelerating AI agent development. It is compatible with existing identity providers, eliminating needs for user migration or rebuilding authentication flows. AgentCore Identity's helps to minimize consent fatigue with a secure token vault and allows you to build streamlined AI agent experiences. Just-enough access and secure permission delegation allow agents to securely access AWS resources and third-party tools and services.
115
+
116
+ **[Identity Quick Start](https://aws.github.io/bedrock-agentcore-starter-toolkit/user-guide/identity/quickstart.html)**
117
+
118
+ ## 🔐 Import Amazon Bedrock Agents to Bedrock AgentCore
119
+ AgentCore Import-Agent enables seamless migration of existing Amazon Bedrock Agents to LangChain/LangGraph or Strands frameworks while automatically integrating AgentCore primitives like Memory, Code Interpreter, and Gateway. Developers can migrate agents in minutes with full feature parity and deploy directly to AgentCore Runtime for serverless operation.
120
+
121
+ **[Import Agent Quick Start](https://aws.github.io/bedrock-agentcore-starter-toolkit/user-guide/import-agent/quickstart.html)**
122
+
123
+
124
+ ## ⚠️ Preview Status
125
+
126
+ Bedrock AgentCore is currently in public preview.
127
+
128
+ ## 📝 License & Contributing
129
+
130
+ - **License:** Apache 2.0 - see [LICENSE.txt](LICENSE.txt)
131
+ - **Contributing:** See [CONTRIBUTING.md](CONTRIBUTING.md)
132
+ - **Security:** Report vulnerabilities via [SECURITY.md](SECURITY.md)
@@ -1,6 +1,6 @@
1
1
  bedrock_agentcore_starter_toolkit/__init__.py,sha256=tN3-JWKvxk4ZSJQJIHQ4mMsDtt8J_cDCz-drcGU9USA,120
2
2
  bedrock_agentcore_starter_toolkit/cli/__init__.py,sha256=WuIWfHtJKD9gQA-mE49bq8OHGb0Ugt8upRGaOp6-H90,62
3
- bedrock_agentcore_starter_toolkit/cli/cli.py,sha256=h7lb9htskppokMShmrfzna_8qic49q0nYG6BCWY13fQ,965
3
+ bedrock_agentcore_starter_toolkit/cli/cli.py,sha256=rmPi14B8WDbbJbrcUIKjXHtbFyfV2cJ7K8yG2_C1kuM,981
4
4
  bedrock_agentcore_starter_toolkit/cli/common.py,sha256=R9ZRKmW9gq7u7gkTiCUOTCQTno2lXnsplnq2x0-k2v8,1311
5
5
  bedrock_agentcore_starter_toolkit/cli/gateway/__init__.py,sha256=8IZ0kSe6Kz5s2j-SBsoc6qy04MbK85RMTQwZCiR2wmo,68
6
6
  bedrock_agentcore_starter_toolkit/cli/gateway/commands.py,sha256=3DuXCvqXlmHU2cmjGzDruyc2Fkrpgoi158myj0vc3nA,3265
@@ -15,24 +15,23 @@ bedrock_agentcore_starter_toolkit/notebook/__init__.py,sha256=wH1ZzIVKsKT_P0qX2k
15
15
  bedrock_agentcore_starter_toolkit/notebook/runtime/__init__.py,sha256=DoGfB_uGFLANJVE9rSZtTH3ymw76WBWmD9vORvBIdXs,66
16
16
  bedrock_agentcore_starter_toolkit/notebook/runtime/bedrock_agentcore.py,sha256=UvG-X9Ny_z4VhMG8BNTy-OaZMFU4VIQ8QIHz2lm7Dyo,15328
17
17
  bedrock_agentcore_starter_toolkit/operations/__init__.py,sha256=L7sCNjfZviiVVoh2f3NEs2sbjNqFkmIRI3ZPYMMWMz0,51
18
- bedrock_agentcore_starter_toolkit/operations/gateway/README.md,sha256=aJla3qAaZmM0b4t9q4lQYqfamAugU0FyyzsufFMRi_A,8192
19
18
  bedrock_agentcore_starter_toolkit/operations/gateway/__init__.py,sha256=5Qo1GeN-DghNp9g0coFUs7WpUJDboJoidOVs-5Co7fo,233
20
- bedrock_agentcore_starter_toolkit/operations/gateway/client.py,sha256=udkwl15s6gmpHgmZfJKHy9sO1NulL3ByRignZkFwzoM,20067
19
+ bedrock_agentcore_starter_toolkit/operations/gateway/client.py,sha256=8WP2E_u6h1-mPfz4TgNMloD6bcXfoXQDL3UCrbyhT7g,20068
21
20
  bedrock_agentcore_starter_toolkit/operations/gateway/constants.py,sha256=0_4J6BN4VAE4-XTQhPTEACkhilRrFqu_iKiuHSm2pYk,4610
22
21
  bedrock_agentcore_starter_toolkit/operations/gateway/create_lambda.py,sha256=MQsBJfUj26zBh7LqYWLoekHuvbAHIJE8qcXwrmJOhM0,2875
23
22
  bedrock_agentcore_starter_toolkit/operations/gateway/create_role.py,sha256=a38JE28PbdRabskTgLXsiqHqWS1vt06jxEEGneYPO_g,3145
24
23
  bedrock_agentcore_starter_toolkit/operations/gateway/exceptions.py,sha256=WjsrE7lT2708CJniM_ISMzkfNX4IUteGgvOxleD9JZY,272
25
24
  bedrock_agentcore_starter_toolkit/operations/runtime/__init__.py,sha256=7ucAtIbabrDmEaHOfGqHtEr2CkQlEsb5O2tkHirXCqU,673
26
25
  bedrock_agentcore_starter_toolkit/operations/runtime/configure.py,sha256=7xjNN6fn1U2cv20W2tmHdlbSjc-RU953tnbOaH5iXPQ,9056
27
- bedrock_agentcore_starter_toolkit/operations/runtime/create_role.py,sha256=5-BL_EA1LFy6vSTl5Rppj1et7Y0tuaB8C9-Ze4ESt1A,15952
26
+ bedrock_agentcore_starter_toolkit/operations/runtime/create_role.py,sha256=o3rimy-9SDOS0r-DKHctKSS6dAVIGelhn1zUhrSeolY,15952
28
27
  bedrock_agentcore_starter_toolkit/operations/runtime/invoke.py,sha256=ZcPXI7Zx7NO7G7fM2xY6JKVoo2CR2sdyBlBJ63Pd6MI,4559
29
- bedrock_agentcore_starter_toolkit/operations/runtime/launch.py,sha256=vG6SFKVWtKNtxIkpDA9tHlvHDs1LYA4_t-M_RUXXfyo,19206
28
+ bedrock_agentcore_starter_toolkit/operations/runtime/launch.py,sha256=RbQt76m1a3TZCWDuMBAP91AA4eH35nW3jk7He8Yqlf8,19260
30
29
  bedrock_agentcore_starter_toolkit/operations/runtime/models.py,sha256=Qr45hc73a25cqmiSErq9-degckPXuVhnENyDSshU_mU,3673
31
30
  bedrock_agentcore_starter_toolkit/operations/runtime/status.py,sha256=tpOtzAq1S3z_7baxR_WOT8Avo3MtWKGpelVOOfb-uMA,2516
32
31
  bedrock_agentcore_starter_toolkit/services/__init__.py,sha256=s7QtYYFCCX2ff0gZHUdDxCDI3zhUq0fPsjevZbF9xdA,66
33
- bedrock_agentcore_starter_toolkit/services/codebuild.py,sha256=i5VbjqAWrPsPwLUdGSWI-_beqFHPqN3FnVLKM4s3rSo,13445
32
+ bedrock_agentcore_starter_toolkit/services/codebuild.py,sha256=77aagVvjSMQxBfNmwYTO6lwE_2izXGqgc6kWp9Bf98U,13618
34
33
  bedrock_agentcore_starter_toolkit/services/ecr.py,sha256=nW9wIZcXI6amZeLVSmM9F6awVBQP1-zrFXTozSNEDjo,2805
35
- bedrock_agentcore_starter_toolkit/services/runtime.py,sha256=ZLQ8X48mOb4xqzvbVf8vqOZR5AAA9atf89va6tW3-uo,18601
34
+ bedrock_agentcore_starter_toolkit/services/runtime.py,sha256=zGC-p4fagXHWemtdncg1K1h0MFkqd9CsvI3Px_tmAX8,18601
36
35
  bedrock_agentcore_starter_toolkit/services/import_agent/__init__.py,sha256=ig-xanZqA3oJdRTucYz9xF9_2yi31ADRVIKFsnIw_l4,68
37
36
  bedrock_agentcore_starter_toolkit/services/import_agent/utils.py,sha256=ErY-J0hClJbt5D-pQ99ma-1Fll35tHjqOttM-h0bKKw,15675
38
37
  bedrock_agentcore_starter_toolkit/services/import_agent/assets/memory_manager_template.py,sha256=RKrtTxir5XxyMg6cim4CAEbguaxb4mg1Qb31pd7D_kY,7892
@@ -47,17 +46,17 @@ bedrock_agentcore_starter_toolkit/utils/endpoints.py,sha256=1gIDRd1oO1fymYpiedVi
47
46
  bedrock_agentcore_starter_toolkit/utils/logging_config.py,sha256=NtZDyndNKCAbz7jZ0leb13bb3UmjjRUTSVwI8MMlOfw,2191
48
47
  bedrock_agentcore_starter_toolkit/utils/runtime/config.py,sha256=qRQid59rD3zJ0d0hcBY4-8R52PNIWEIUt9iR3biuz_c,4495
49
48
  bedrock_agentcore_starter_toolkit/utils/runtime/container.py,sha256=wGJLxwT2mhTGPxSoFb6x9lW7Tyz37YghIvSs4jBnO8A,15679
50
- bedrock_agentcore_starter_toolkit/utils/runtime/entrypoint.py,sha256=0MlqXCUcW9Dvr_9I0KC5PDq7GdIgSueTBIaOUUVtcBA,7355
51
- bedrock_agentcore_starter_toolkit/utils/runtime/logs.py,sha256=RUP5W2rbkXf33Kis4MnaI8xIjkpidO1at3kiXmxAw0I,1082
49
+ bedrock_agentcore_starter_toolkit/utils/runtime/entrypoint.py,sha256=d-XjEwvQOdpRHvBGLdIBCs1fgUwNwB0EL_WkcdQXwXQ,5893
50
+ bedrock_agentcore_starter_toolkit/utils/runtime/logs.py,sha256=zRNYiNtEEYatZSRbc5VrUNgWhyP3Pl6p-hMl8AEUx_o,1101
52
51
  bedrock_agentcore_starter_toolkit/utils/runtime/policy_template.py,sha256=CgER7YXPh0BpR6JcTcumDL_k8bhmfLSEok1sf09-31I,2054
53
52
  bedrock_agentcore_starter_toolkit/utils/runtime/schema.py,sha256=gZ0zPvry-ZkXwqUEAy6Izz1RJvmZaXA6a2twnSdk1AY,6418
54
- bedrock_agentcore_starter_toolkit/utils/runtime/templates/Dockerfile.j2,sha256=-HQM15yR-EPhkyQBaO4qRKqaqYdpTAOprMTOzUWkTU8,1166
53
+ bedrock_agentcore_starter_toolkit/utils/runtime/templates/Dockerfile.j2,sha256=0KmVBMP3ZeCrt7dQ5cR8WTvI8ZVt_SFgHYRxn6DYMfA,1261
55
54
  bedrock_agentcore_starter_toolkit/utils/runtime/templates/dockerignore.template,sha256=b_70sBi0MwkTuA9TqxPqFcWK7TcmpaXBJ6M2Ipox65Q,691
56
- bedrock_agentcore_starter_toolkit/utils/runtime/templates/execution_role_policy.json.j2,sha256=kBNIDrILAx4ZGUxB_ExZAYxTKENfwNFVc7eifiD8z9U,2511
55
+ bedrock_agentcore_starter_toolkit/utils/runtime/templates/execution_role_policy.json.j2,sha256=-0AXT46IYVQr4fwueXTQ0FVXcCshZFNx7-2mViR34Co,4941
57
56
  bedrock_agentcore_starter_toolkit/utils/runtime/templates/execution_role_trust_policy.json.j2,sha256=PPJF6Ofq70W5DUE0NlbmnZjw5RkgepPgkskxEgEG28o,473
58
- bedrock_agentcore_starter_toolkit-0.1.6.dist-info/METADATA,sha256=ekLiNPUrYrvTAi2191q2tjgV9xILlutAmSDiIN3B9xE,7120
59
- bedrock_agentcore_starter_toolkit-0.1.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
60
- bedrock_agentcore_starter_toolkit-0.1.6.dist-info/entry_points.txt,sha256=Tf94DkUf2Tp8P7p8MEXLxre7A7Pp_XNukteiz0wHnk8,77
61
- bedrock_agentcore_starter_toolkit-0.1.6.dist-info/licenses/LICENSE.txt,sha256=nNPOMinitYdtfbhdQgsPgz1UowBznU6QVN3Xs0pSTKU,10768
62
- bedrock_agentcore_starter_toolkit-0.1.6.dist-info/licenses/NOTICE.txt,sha256=rkBsg8DbKqfIoQbveqX9foR4uJPUVAokbkr02pRPilE,8674
63
- bedrock_agentcore_starter_toolkit-0.1.6.dist-info/RECORD,,
57
+ bedrock_agentcore_starter_toolkit-0.1.8.dist-info/METADATA,sha256=T-Y9VXQUjDahbwI5rWcjOYWCgrGU7avljQfd6DBtgLw,9706
58
+ bedrock_agentcore_starter_toolkit-0.1.8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
59
+ bedrock_agentcore_starter_toolkit-0.1.8.dist-info/entry_points.txt,sha256=Tf94DkUf2Tp8P7p8MEXLxre7A7Pp_XNukteiz0wHnk8,77
60
+ bedrock_agentcore_starter_toolkit-0.1.8.dist-info/licenses/LICENSE.txt,sha256=nNPOMinitYdtfbhdQgsPgz1UowBznU6QVN3Xs0pSTKU,10768
61
+ bedrock_agentcore_starter_toolkit-0.1.8.dist-info/licenses/NOTICE.txt,sha256=rkBsg8DbKqfIoQbveqX9foR4uJPUVAokbkr02pRPilE,8674
62
+ bedrock_agentcore_starter_toolkit-0.1.8.dist-info/RECORD,,
@@ -1,277 +0,0 @@
1
- # Bedrock AgentCore Gateway
2
-
3
- Bedrock AgentCore Gateway is a primitive within the Bedrock AgentCore SDK that enables you to:
4
- - Convert REST APIs (OpenAPI) into MCP tools
5
- - Expose Lambda functions as MCP tools
6
- - Handle authentication automatically with EZ Auth
7
- - Enable semantic search across your tools
8
-
9
- ## Quick Start
10
-
11
- ### Using the CLI (Recommended)
12
-
13
- ```bash
14
- # Create a Gateway to use with targets defined in OpenAPI or Smithy
15
- agentcore create_mcp_gateway \
16
- --region us-west-2 \
17
- --name gateway-name
18
-
19
- # Create a Gateway Target with predefined smithy model
20
- agentcore create_mcp_gateway_target \
21
- --region us-west-2 \
22
- --gateway-arn arn:aws:bedrock-agentcore:us-west-2:123:gateway/gateway-id \
23
- --gateway-url https://gateway-id.gateway.bedrock-agentcore.us-west-2.amazonaws.com/mcp \
24
- --role-arn arn:aws:iam::123:role/BedrockAgentCoreGatewayRole \
25
- --target-type smithyModel
26
-
27
- # Create a Gateway Target with OpenAPI target (OAuth with API Key)
28
- agentcore create_mcp_gateway_target \
29
- --region us-west-2 \
30
- --gateway-arn arn:aws:bedrock-agentcore:us-west-2:123:gateway/gateway-id \
31
- --gateway-url https://gateway-id.gateway.bedrock-agentcore.us-west-2.amazonaws.com/mcp \
32
- --role-arn arn:aws:iam::123:role/BedrockAgentCoreGatewayRole \
33
- --target-type openApiSchema \
34
- --credentials "{\"api_key\": \"Bearer 123234bc\", \"credential_location\": \"HEADER\", \"credential_parameter_name\": \"Authorization\"}" \
35
- --target-payload "{\"s3\": { \"uri\": \"s3://openapischemas/sample-openapi-schema.json\", \"bucketOwnerAccountId\": \"012345678912\"}}"
36
-
37
- # Create a Gateway Target with OpenAPI target (OAuth with credential provider)
38
- agentcore create_mcp_gateway_target \
39
- --region us-west-2 \
40
- --gateway-arn arn:aws:bedrock-agentcore:us-west-2:123:gateway/gateway-id \
41
- --gateway-url https://gateway-id.gateway.bedrock-agentcore.us-west-2.amazonaws.com/mcp \
42
- --role-arn arn:aws:iam::123:role/BedrockAgentCoreGatewayRole \
43
- --target-type openApiSchema \
44
- --credentials "{\"oauth2_provider_config\": { \"customOauth2ProviderConfig\": {\"oauthDiscovery\" : {\"authorizationServerMetadata\" : {\"issuer\" : \"<issuer>\",\"authorizationEndpoint\" : \"<authorizationEndpoint>\",\"tokenEndpoint\" : \"<tokenEndpoint>\"}},\"clientId\" : \"<clientId>\",\"clientSecret\" : \"<clientSecret>\" }}}" \
45
- --target-payload "{\"s3\": { \"uri\": \"s3://openapischemas/sample-openapi-schema.json\", \"bucketOwnerAccountId\": \"012345678912\"}}"
46
- ```
47
-
48
- The CLI automatically:
49
- - Detects target type from ARN patterns or file extensions
50
- - Sets up Cognito OAuth (EZ Auth)
51
- - Detects your AWS region and account
52
- - Builds full role ARN from role name
53
-
54
-
55
- ### Using the SDK
56
-
57
- For programmatic access in scripts, notebooks, or CI/CD:
58
-
59
- ```python
60
- from bedrock_agentcore_starter_toolkit.operations.gateway.client import GatewayClient
61
- import json
62
-
63
- # Initialize client
64
- client = GatewayClient(region_name='us-west-2')
65
-
66
- # EZ Auth - automatically sets up Cognito OAuth
67
- cognito_result = client.create_oauth_authorizer_with_cognito("my-gateway")
68
-
69
- # Create Gateway with OpenAPI schema target
70
- gateway = client.create_mcp_gateway(
71
- name="my-gateway",
72
- role_arn="arn:aws:iam::123:role/BedrockAgentCoreGatewayExecutionRole",
73
- authorizer_config=cognito_result['authorizer_config']
74
- )
75
-
76
- target = client.create_mcp_gateway_target(
77
- gateway=gateway,
78
- name="sample_target",
79
- target_type='openApiSchema',
80
- target_payload= {
81
- "s3": {
82
- "uri": "s3://openapischemas/sample-openapi-schema.json",
83
- "bucketOwnerAccountId": "012345678912"
84
- }
85
- },
86
- credentials={
87
- "api_key": "abc123",
88
- "credential_location": "HEADER",
89
- "credential_parameter_name": "Authorization"
90
- }
91
- )
92
- print(f"MCP Endpoint: {gateway['gatewayUrl']}")
93
- print(f"OAuth Credentials:")
94
- print(f" Client ID: {cognito_result['client_info']['client_id']}")
95
- print(f" Client Secret: {cognito_result['client_info']['client_secret']}")
96
- print(f" Scope: {cognito_result['client_info']['scope']}")
97
- ```
98
-
99
- ## Key Features
100
-
101
- ### EZ Auth
102
- Eliminates the complexity of OAuth setup:
103
- ```python
104
- # Without EZ Auth: 8+ manual steps
105
- # With EZ Auth: 1 line
106
- cognito_result = client.create_oauth_authorizer_with_cognito("my-gateway")
107
- ```
108
-
109
- ### Semantic Search
110
- Enable intelligent tool discovery:
111
- ```python
112
- gateway = client.create_mcp_gateway(
113
- name="my-gateway",
114
- role_arn="arn:aws:iam::123:role/BedrockAgentCoreGatewayExecutionRole",
115
- authorizer_config=cognito_result['authorizer_config'],
116
- enable_semantic_search=True # Enable semantic search.
117
- )
118
- ```
119
-
120
- ### Multiple Target Types
121
-
122
- #### Lambda Functions
123
- ```python
124
- # Auto-generated schema (default)
125
- gateway = client.create_mcp_gateway(
126
- name="my-gateway",
127
- role_arn="arn:aws:iam::123:role/BedrockAgentCoreGatewayExecutionRole",
128
- authorizer_config=cognito_result['authorizer_config']
129
- )
130
-
131
- # Create a lambda target
132
- lambda_target = client.create_mcp_gateway_target(
133
- name="lambda-target",
134
- gateway=gateway,
135
- target_type='lambda'
136
- )
137
- ```
138
-
139
- #### OpenAPI (REST APIs)
140
- ```python
141
- # Inline OpenAPI
142
- openapi_spec = {
143
- "openapi": "3.0.0",
144
- "info": {"title": "My API", "version": "1.0.0"},
145
- "servers": [{"url": "https://api.example.com"}],
146
- "paths": {
147
- "/users": {
148
- "get": {
149
- "operationId": "listUsers",
150
- "responses": {"200": {"description": "Success"}}
151
- }
152
- }
153
- }
154
- }
155
- openAPI_inline_target = client.create_mcp_gateway_target(
156
- name="inlineTarget",
157
- gateway=gateway,
158
- credentials={
159
- "api_key": "abc123",
160
- "credential_location": "HEADER",
161
- "credential_parameter_name": "Authorization"
162
- },
163
- target_type='openApiSchema',
164
- target_payload= {
165
- "inlinePayload": openapi_spec
166
- }
167
- )
168
-
169
- # From S3
170
- openAPI_target = client.create_mcp_gateway_target(
171
- name="s3target",
172
- gateway=gateway,
173
- credentials={
174
- "api_key": "abc123",
175
- "credential_location": "HEADER",
176
- "credential_parameter_name": "Authorization"
177
- },
178
- target_type='openApiSchema',
179
- target_payload= {
180
- "s3": {
181
- "uri": "s3://openapischemas/sample-openapi-schema.json",
182
- "bucketOwnerAccountId": "012345678912"
183
- }
184
- }
185
- )
186
- ```
187
-
188
- ## MCP Integration
189
-
190
- Once created, use any MCP client to interact with your Gateway:
191
-
192
- ```python
193
- import httpx
194
-
195
- # Get token
196
- token = client.get_access_token_for_cognito(cognito_result['client_info'])
197
-
198
- # List tools
199
- async with httpx.AsyncClient() as http:
200
- response = await http.post(
201
- gateway['gatewayUrl'],
202
- headers={"Authorization": f"Bearer {token}"},
203
- json={
204
- "jsonrpc": "2.0",
205
- "id": 1,
206
- "method": "tools/list",
207
- "params": {}
208
- }
209
- )
210
- tools = response.json()
211
-
212
- # Invoke a tool
213
- response = await http.post(
214
- gateway['gatewayUrl'],
215
- headers={"Authorization": f"Bearer {token}"},
216
- json={
217
- "jsonrpc": "2.0",
218
- "id": 2,
219
- "method": "tools/call",
220
- "params": {
221
- "name": "listUsers",
222
- "arguments": {}
223
- }
224
- }
225
- )
226
- ```
227
-
228
- ## Prerequisites
229
-
230
- **AWS Account**: Must be allowlisted for Bedrock AgentCore beta
231
- **IAM Execution Role**: With trust relationship to BedrockAgentCore service
232
- **Permissions**: Role needs access to your backends (Lambda invoke, S3 read, etc.)
233
- **Custom Boto3 SDK**: Download from Bedrock AgentCore documentation
234
-
235
- ## Testing
236
-
237
- See `tests/bedrock_agentcore/gateway/` for integration tests covering all target types.
238
-
239
- ## API Reference
240
-
241
- ### GatewayClient
242
-
243
- - `create_oauth_authorizer_with_cognito(gateway_name)` - Set up Cognito OAuth automatically
244
- - `create_mcp_gateway(...)` - Create a gateway
245
- - `create_mcp_gateway_target(...)` - Create a gateway target
246
- - `get_test_token_for_cognito(client_info)` - Get OAuth token for testing
247
-
248
- ### List of all builtin schemas
249
- ```doc
250
- 1. confluence
251
- 2. onedrive
252
- 3. dynamodb
253
- 4. cloudwatch
254
- 5. slack
255
- 6. smartsheet
256
- 7. sap-business-partner
257
- 8. tavily
258
- 9. jira
259
- 10. sap-product-master-data
260
- 11. genericHTTP
261
- 12. sap-material-stock
262
- 13. sap-physical-inventory
263
- 14. salesforce
264
- 15. servicenow
265
- 16. bambooHR
266
- 17. brave-search
267
- 18. msExchange
268
- 19. sap-bill-of-material
269
- 20. sharepoint
270
- 21. asana
271
- 22. zendesk
272
- 23. msTeams
273
- 24. pagerduty
274
- 25. zoom
275
- 26. bedrock-runtime
276
- 27. bedrock-agent-runtime
277
- ```
@@ -1,157 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: bedrock-agentcore-starter-toolkit
3
- Version: 0.1.6
4
- Summary: A starter toolkit for using Bedrock AgentCore
5
- Project-URL: Homepage, https://github.com/aws/bedrock-agentcore-starter-toolkit
6
- Project-URL: Bug Tracker, https://github.com/aws/bedrock-agentcore-starter-toolkit/issues
7
- Project-URL: Documentation, https://github.com/aws/bedrock-agentcore-starter-toolkit
8
- Author-email: AWS <opensource@amazon.com>
9
- License: Apache-2.0
10
- License-File: LICENSE.txt
11
- License-File: NOTICE.txt
12
- Classifier: Development Status :: 3 - Alpha
13
- Classifier: Intended Audience :: Developers
14
- Classifier: License :: OSI Approved :: Apache Software License
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python :: 3
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.12
20
- Classifier: Programming Language :: Python :: 3.13
21
- Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
- Requires-Python: >=3.10
24
- Requires-Dist: autopep8>=2.3.2
25
- Requires-Dist: bedrock-agentcore>=0.1.2
26
- Requires-Dist: boto3>=1.39.7
27
- Requires-Dist: botocore>=1.39.7
28
- Requires-Dist: docstring-parser<1.0,>=0.15
29
- Requires-Dist: httpx>=0.28.1
30
- Requires-Dist: jinja2>=3.1.6
31
- Requires-Dist: openapi-spec-validator>=0.7.2
32
- Requires-Dist: prance>=25.4.8.0
33
- Requires-Dist: prompt-toolkit>=3.0.51
34
- Requires-Dist: py-openapi-schema-to-json-schema>=0.0.3
35
- Requires-Dist: pydantic<3.0.0,>=2.0.0
36
- Requires-Dist: pyyaml>=6.0.2
37
- Requires-Dist: questionary>=2.1.0
38
- Requires-Dist: requests>=2.25.0
39
- Requires-Dist: rich>=13.0.0
40
- Requires-Dist: ruamel-yaml>=0.18.14
41
- Requires-Dist: toml>=0.10.2
42
- Requires-Dist: typer>=0.16.0
43
- Requires-Dist: typing-extensions<5.0.0,>=4.13.2
44
- Requires-Dist: urllib3>=1.26.0
45
- Requires-Dist: uvicorn>=0.34.2
46
- Description-Content-Type: text/markdown
47
-
48
- <div align="center">
49
- <h1>
50
- Bedrock AgentCore Starter Toolkit
51
- </h1>
52
-
53
- <h2>
54
- Deploy your local AI agent to Bedrock AgentCore with zero infrastructure
55
- </h2>
56
-
57
- <div align="center">
58
- <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/graphs/commit-activity"><img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/aws/bedrock-agentcore-starter-toolkit"/></a>
59
- <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/issues"><img alt="GitHub open issues" src="https://img.shields.io/github/issues/aws/bedrock-agentcore-starter-toolkit"/></a>
60
- <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/pulls"><img alt="GitHub open pull requests" src="https://img.shields.io/github/issues-pr/aws/bedrock-agentcore-starter-toolkit"/></a>
61
- <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit/blob/main/LICENSE.txt"><img alt="License" src="https://img.shields.io/github/license/aws/bedrock-agentcore-starter-toolkit"/></a>
62
- <a href="https://pypi.org/project/bedrock-agentcore-starter-toolkit"><img alt="PyPI version" src="https://img.shields.io/pypi/v/bedrock-agentcore-starter-toolkit"/></a>
63
- <a href="https://python.org"><img alt="Python versions" src="https://img.shields.io/pypi/pyversions/bedrock-agentcore-starter-toolkit"/></a>
64
- </div>
65
-
66
- <p>
67
- <a href="https://github.com/aws/bedrock-agentcore-sdk-python">Python SDK</a>
68
- ◆ <a href="https://github.com/aws/bedrock-agentcore-starter-toolkit">Starter Toolkit</a>
69
- ◆ <a href="https://github.com/awslabs/amazon-bedrock-agentcore-samples">Samples</a>
70
- ◆ <a href="https://discord.gg/bedrockagentcore-preview">Discord</a>
71
- </p>
72
- </div>
73
-
74
- ## 🚀 From Local Development to Bedrock AgentCore
75
-
76
- ```python
77
- # Build your agent with the SDK
78
- from bedrock_agentcore import BedrockAgentCoreApp
79
-
80
- app = BedrockAgentCoreApp()
81
-
82
- @app.entrypoint
83
- def my_agent(request):
84
- # Your existing Strands, LangGraph, CrewAI, or custom agent logic
85
- return process_with_your_framework(request.get("prompt"))
86
-
87
- app.run()
88
- ```
89
-
90
- ```bash
91
- # Deploy with the Starter Toolkit
92
- agentcore configure --entrypoint my_agent.py
93
- agentcore launch # Ready to run on Bedrock AgentCore
94
- agentcore invoke '{"prompt": "tell me a fact"}'
95
- ```
96
-
97
- **What you get with the Starter Toolkit:**
98
- - ✅ **Keep your agent logic** - Works with any SDK-built agent
99
- - ✅ **Zero infrastructure management** - No servers, containers, or scaling concerns
100
- - ✅ **One-command deployment** - From local development to enterprise platform
101
- - ✅ **Production-ready hosting** - Reliable, scalable, compliant Bedrock AgentCore deployment
102
-
103
- ## ⚠️ Preview Status
104
-
105
- Bedrock AgentCore Starter Toolkit is currently in public preview. APIs may change as we refine the SDK.
106
-
107
- ## 🛠️ Deployment & Management Tools
108
-
109
- **Simple Configuration**
110
- ```bash
111
- # Configure your agent for deployment
112
- agentcore configure --entrypoint my_agent.py --name my-production-agent
113
-
114
- # Check deployment status
115
- agentcore status
116
-
117
- # Invoke your deployed agent
118
- agentcore invoke '{"prompt": "Hello from Bedrock AgentCore!"}'
119
- ```
120
-
121
- **Enterprise Platform Services**
122
- - 🚀 **Runtime** - Serverless deployment and scaling with fast cold starts
123
- - 🧠 **Memory** - Persistent knowledge with event and semantic memory
124
- - 🔗 **Gateway** - Transform existing APIs and Lambda functions into MCP tools
125
- - 🔐 **Identity** - Secure authentication and access management
126
- - 💻 **Code Interpreter** - Secure code execution in isolated sandbox environments
127
- - 🌐 **Browser** - Fast, secure cloud-based browser for web automation
128
- - 📊 **Observability** - Real-time monitoring and tracing with OpenTelemetry support
129
-
130
- ## ➡️ Importing from Bedrock Agents
131
-
132
- Import from Bedrock Agents to AgentCore using the `import-agent` utility.
133
-
134
- ```bash
135
- # Launch the import-agent workflow
136
- agentcore import-agent
137
- ```
138
-
139
- This will generate an equivalent Langchain or Strands agent in `./output`, leveraging AgentCore primitives, and provide an option to deploy the agent to AgentCore Runtime. See additional documentation on this utility:
140
- - [Quickstart Guide](https://github.com/aws/bedrock-agentcore-starter-toolkit/blob/main/documentation/docs/user-guide/import-agent/quickstart.md)
141
- - [Utility Overview](https://github.com/aws/bedrock-agentcore-starter-toolkit/blob/main/documentation/docs/user-guide/import-agent/overview.md)
142
-
143
-
144
- ## 📚 About Amazon Bedrock AgentCore
145
-
146
- Amazon Bedrock AgentCore enables you to deploy and operate highly effective agents securely, at scale using any framework and model. With AgentCore, developers can accelerate AI agents into production with enterprise-grade scale, reliability, and security. The platform provides:
147
-
148
- - **Composable Services**: Mix and match services to fit your needs
149
- - **Framework Flexibility**: Works with Strands, LangGraph, CrewAI, Strands, and more
150
- - **Any Model Support**: Not locked into specific models
151
- - **Enterprise Security**: Built-in identity, isolation, and access controls
152
-
153
- ## 📝 License & Contributing
154
-
155
- - **License:** Apache 2.0 - see [LICENSE.txt](LICENSE.txt)
156
- - **Contributing:** See [CONTRIBUTING.md](CONTRIBUTING.md)
157
- - **Security:** Report vulnerabilities via [SECURITY.md](SECURITY.md)