AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
MCP verified MIT Self-run

Sample Strands Agent With Agentcore

mcp-aws-samples-sample-strands-agent-with-agentcore · by aws-samples

Reference architecture for agentic AI chatbots with Strands Agents and Amazon Bedrock AgentCore

No reviews yet
0 installs
19 views
0.0% view→install

Install

$ agentstack add mcp-aws-samples-sample-strands-agent-with-agentcore

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/mcp-aws-samples-sample-strands-agent-with-agentcore)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude DesktopCursorWindsurf

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Sample Strands Agent With Agentcore? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Strands Agent Chatbot with Amazon Bedrock AgentCore

An end-to-end reference architecture for building agentic workflows using Strands Agents and Amazon Bedrock AgentCore.

This repository demonstrates how to design and deploy a multi-agent chatbot that combines tool execution, memory, browser automation, and agent-to-agent collaboration. It is intended as a realistic, extensible sample for teams exploring advanced agent architectures on AWS.

> [!NOTE] > New: Bedrock Mantle models. The model picker now includes OpenAI GPT-5.5 / GPT-5.4, xAI Grok 4.3, and Google Gemma 4 via Amazon Bedrock's OpenAI-compatible Mantle endpoints — alongside the native Bedrock models (Claude, DeepSeek, Qwen, and more).


Demo

https://github.com/user-attachments/assets/11b383c2-2e14-4135-833f-b0b2bce62953

> Full demo (6 min)

Mobile App

Coding Agent Financial Analysis Browser Automation Web Search


What this repository demonstrates

  • Multi-agent orchestration with Strands Agents
  • Integration with Amazon Bedrock AgentCore
  • Tool-enabled agents (search, finance, weather, browser, code interpreter)
  • Autonomous browser, documentation, and analysis workflows
  • Modular architecture adaptable to real customer use cases
  • Infrastructure-as-Code (Terraform) for repeatable deployment

If you are building agentic AI applications on AWS and want a concrete, end-to-end example, this repository is designed to be read, run, and extended.

Quick links: [Architecture](#architecture-overview) · [Key Features](#key-features) · [Quick Start](#quick-start)


Architecture Overview

This sample combines Strands Agent orchestration with Amazon Bedrock AgentCore services:

| Component | Role | |-----------|------| | Strands Agents | Multi-turn reasoning and tool orchestration | | AgentCore Runtime | Managed, containerized agent execution | | AgentCore Memory | Persistent conversation state and summarization | | AgentCore Gateway | MCP-based tool integration with JWT authentication | | AgentCore Code Interpreter | Secure Python execution for analysis and document generation | | AgentCore Browser | Headless browser automation with live view | | AgentCore Identity | End-user authentication and 3LO OAuth delegation | | AgentCore Registry | Central catalog for agent skills, MCP servers, and A2A agents | | AgentCore Observability | Trace collection and agent execution monitoring | | Amazon Nova Act | Visual reasoning model for browser automation |


Key Features

  • Strands-based agent orchestration
  • Amazon Bedrock AgentCore Runtime, Gateway, and Memory
  • MCP Gateway tools (Google, Wikipedia, ArXiv, Yahoo Finance, Tavily, Open-Meteo)
  • Agent-to-Agent (A2A) collaboration — including remote Claude Agent SDK (Claude Code) for agentic coding tasks
  • Built-in Code Interpreter for charts and documents
  • Multimodal input and output (vision, charts, documents, screenshots)
  • Real-time voice interaction with Amazon Nova Sonic 2
  • Wide model selection — native Bedrock models (Claude, DeepSeek, Qwen, GLM, ...) plus OpenAI GPT-5.x, Grok, and Gemma 4 via Bedrock Mantle

Skill System (Progressive Disclosure)

Tools are organized into skills — grouped units with SKILL.md instructions that the agent loads on demand. Instead of injecting all tool documentation into every prompt, the agent activates only the skills it needs:

  1. L1 Catalog — Skill names and one-line descriptions (always in system prompt)
  2. L2 Instructions — Full SKILL.md loaded via skill_dispatcher when activated
  3. L3 Execution — Tool calls via skill_executor

This keeps prompt size small while giving the agent access to detailed instructions when needed.

Design notes:

  • https://medium.com/towards-artificial-intelligence/agent-skills-part-2-bridging-skills-with-production-tool-ecosystems-422e4a63fcad
skills/
├── visual-design/          # Charts, posters, infographics (Code Interpreter)
├── code-interpreter/       # General code execution
├── browser-automation/     # Nova Act browser tools
├── word-documents/         # Word document generation
├── excel-spreadsheets/     # Excel spreadsheet generation
├── powerpoint-presentations/  # PowerPoint generation
├── gmail/                  # Gmail read/search/delete (3LO OAuth)
├── google-calendar/        # Calendar events (3LO OAuth)
├── notion/                 # Notion pages and databases (3LO OAuth)
├── github/                 # GitHub repos, issues, PRs, code (3LO OAuth)
└── ...                     # 20+ skills (web search, finance, maps, weather, and more)

Claude Desktop 3P (Cowork) Integration

Claude Desktop in 3P mode can connect directly to the AgentCore Gateway as an MCP connector, giving Cowork access to the same 23 Gateway tools (web search, arXiv, finance, weather, maps, Wikipedia, etc.) used by the chatbot agents.

Authentication uses Cognito user identity (authorization_code + PKCE flow) with automatic token refresh, so per-user identity propagates to Lambda tools.

cd cowork
./setup.sh    # Cognito login + configure managedMcpServers
# Restart Cowork

See [cowork/README.md](cowork/README.md) for setup modes, token lifecycle, and known limitations.


Multi-Protocol Tool Architecture

| Tool Category | Protocol | Examples | Authentication | |--------------|----------|----------|----------------| | Local Tools | Direct Python | Web Search, URL Fetcher, Visualization | None | | Built-in Tools | AWS SDK / WebSocket | Code Interpreter, Browser (Nova Act) | IAM | | Gateway Tools | MCP | Google Search, Maps, Wikipedia, ArXiv, Finance | SigV4 | | Private API Tools | MCP (3LO OAuth) | Gmail, Google Calendar, Notion, GitHub | OAuth 2.0 | | A2A Tools | A2A | Research Agent, Browser-Use Agent | JWT |

Total: 100+ tools across 20 tool groups See [docs/guides/TOOLS.md](docs/guides/TOOLS.md) for full details.


Voice Mode

Real-time voice interaction using Amazon Nova Sonic 2, Strands BidiAgent, and AgentCore Runtime WebSocket.

  • Seamless switching between voice and text within a single session
  • Shared conversation history across both modes
  • Full tool execution support during voice conversations

Memory Architecture and Long-Context Management

The system uses AgentCore Memory with:

  • Short-term session memory
  • Long-term summarized memory

Long conversations are compacted using a context summarization strategy to retain key information while controlling token growth.

Design notes:

  • https://medium.com/@revoir07/long-context-compaction-for-ai-agents-part-1-design-principles-2bf4a5748154

Token Optimization via Prompt Caching

Prompt caching reduces input token usage by reusing system prompts, stable instruction blocks, and repeated conversation context across agent loop iterations.

This project originally implemented caching via custom Strands hooks. The approach has since been upstreamed into the Strands SDK as a built-in feature (strands-agents/sdk-python#1438):

from strands.models import BedrockModel, CacheConfig

model = BedrockModel(
    model_id="us.anthropic.claude-sonnet-4-6-v1",
    cache_config=CacheConfig(strategy="auto")
)

Design notes:

  • https://medium.com/@revoir07/agent-loop-caching-the-missing-optimization-for-agent-workflows-230cc530eb72

Multi-Agent Architecture

Agent-to-Agent communication is handled via the A2A protocol, allowing the supervisor agent to delegate tasks to specialized worker agents such as a deep research agent. Multiple agents collaborating in sequence — each handling its own role — are coordinated using the Swarm pattern.

This architecture also includes a Claude Agent SDK (Claude Code) instance deployed as a remote A2A agent on AgentCore Runtime. The supervisor delegates agentic coding tasks — multi-file implementation, refactoring, test suites — to this agent over A2A, with an S3-backed workspace that persists files across sessions.

Design notes:

  • https://medium.com/@revoir07/extend-your-chatbot-with-deep-research-using-a2a-ba4de3ed23e9

Use Cases

  • Financial research agents
  • Technical research assistants using multi-agent patterns
  • Autonomous web automation agents
  • Memory-backed conversational assistants
  • Hybrid research workflows using MCP, A2A, and AWS SDK tools

Quick Start

Prerequisites

  • AWS account with Bedrock access
  • AWS CLI configured
  • Docker installed
  • Node.js 18+ and Python 3.13+

Local Development

git clone https://github.com/aws-samples/sample-strands-agent-with-agentcore.git
cd sample-strands-agent-with-agentcore

cd chatbot-app
./setup.sh

# Create chatbot-app/.env with deployment outputs (Cognito IDs, API URL, etc.)
# — typically populated from terraform output after `infra/scripts/deploy.sh apply`.

./start.sh

Frontend will be available at http://localhost:3000.


Cloud Deployment

# Configure
cp infra/environments/dev/terraform.tfvars.example infra/environments/dev/terraform.tfvars
# Edit terraform.tfvars with your settings

# Deploy all
./infra/scripts/deploy.sh apply

# Deploy specific modules
./infra/scripts/deploy.sh apply -target=module.chat
./infra/scripts/deploy.sh apply -target=module.runtime_orchestrator

See [DEPLOYMENT.md](DEPLOYMENT.md) for full instructions.

Project Structure

sample-strands-agent-chatbot/
├── chatbot-app/
│   ├── frontend/          # Next.js UI + BFF
│   └── agentcore/         # Python backend (Strands Agent)
├── agentcore/             # AgentCore workloads (built/deployed by Terraform)
│   ├── gateway-tools/     # Lambda MCP tools (arxiv, weather, tavily, ...)
│   ├── a2a-agents/        # A2A runtimes (code-agent, research-agent)
│   └── mcp-runtime/       # MCP 3LO runtime (Gmail, GitHub, Notion, ...)
├── cowork/                # Claude Desktop 3P ↔ AgentCore Gateway connector
└── infra/                 # Terraform infrastructure
    ├── modules/           # Reusable modules (auth, runtime, gateway, chat, ...)
    ├── environments/dev/  # Environment configuration
    └── scripts/           # Deploy orchestrator

Documentation

  • DEPLOYMENT.md
  • docs/guides/TROUBLESHOOTING.md

License

MIT License. See LICENSE for details.

Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.