mirror of
https://github.com/awslabs/amazon-bedrock-agentcore-samples.git
synced 2025-09-08 20:50:46 +00:00
- Complete serverless AI-powered AWS operations platform - Multi-Lambda architecture with Function URL deployment - Bedrock AgentCore Gateway integration with MCP protocol - 20 AWS service tools for comprehensive operations - Dual authentication: AWS SigV4 + Okta JWT - Natural language interface with streaming responses - DynamoDB conversation persistence - Docker-based MCP Tool Lambda with Strands framework - Production-ready with enterprise security patterns - Comprehensive documentation and setup guides - Read-only operations by default with write enablement guide - Interactive client with CLI interface - Complete Okta OAuth2 PKCE setup - Management scripts for gateway and target operations - Sanitized configuration with dummy data for public sharing
3.5 KiB
3.5 KiB
Bedrock AgentCore Gateway AWS Operations Agent Client
📋 Navigation
🏠 README | 📖 Setup Guide | 🏗️ Architecture | 🔧 Scripts | 🤖 Client | ⚙️ Config | 🔐 Okta Setup
This directory contains the AWS Operations Agent client that connects to your Bedrock AgentCore Gateway production setup.
Structure
client/
├── README.md # This file
├── requirements.txt # Python dependencies
├── run_client.sh # Convenience script
├── src/
│ ├── auth.py # AWS authentication
│ ├── cli_interface.py # Command-line interface
│ ├── commands.py # Client commands
│ ├── config.py # Client configuration
│ ├── conversation.py # Conversation management
│ ├── lambda_client.py # Lambda API client
│ ├── main.py # Entry point
│ ├── mcp_tools.py # MCP tools manager
│ └── save_token.py # Token management
└── token.txt # Okta token (create this file)
Setup
-
Install dependencies:
pip install -r requirements.txt
-
Create token file:
# Option 1: Use save_token.py script python src/save_token.py # Option 2: Create token file manually echo "YOUR_OKTA_ACCESS_TOKEN" > token.txt
-
Run the client:
# Option 1: Use convenience script ./run_client.sh # Option 2: Run directly python src/main.py
Usage
AWS Operational Support Agent - Natural language AWS operations
Commands:
/help Show this help message
/clear Clear current conversation
/tools List available MCP tools
/quit Exit the application
/token <token> Set Okta token
/token-file <path> Load Okta token from file
Command-line Arguments
--url
- Lambda Function URL (default: from config)--region
- AWS region (default: us-east-1)--profile
- AWS profile (default: demo1)--token
- Okta token for Bedrock AgentCore Gateway authentication--token-file
- Path to file containing Okta token
Configuration
Your client is configured to work with:
- Bedrock AgentCore Gateway:
https://example-gateway-abc123def456.gateway.bedrock-agentcore.us-east-1.amazonaws.com/mcp
- Target:
EXAMPLE123
with 20 AWS service tools - Lambda:
example-operations-agent
function
Example Commands
> What time is it? Use the get_time tool.
> List my S3 buckets
> Show me EC2 instances in us-east-1
> What Lambda functions do I have?
> How many CloudFormation stacks are in FAILED state?
Troubleshooting
Common Issues
-
Authentication Errors:
- Check that your Okta token is valid and not expired
- Verify AWS credentials with
aws sts get-caller-identity --profile demo1
-
Connection Issues:
- Verify Lambda Function URL is correct
- Check network connectivity
-
Tool Execution Errors:
- Verify target is properly configured
- Check Lambda logs for detailed error messages
Debug Commands
# Check token file
cat token.txt | head -c 20
# Test Lambda Function URL directly
curl -X POST https://<function-url>/chat \
--header "Content-Type: application/json" \
--data '{"message":"Hello"}'