sample-agentic-ai-web
This project demonstrates how to use AWS Bedrock with Anthropic Claude and Amazon Nova models to create a web automation assistant with tool use, human-in-the-loop interaction, and vision capabilities.
claude mcp add --transport stdio aws-samples-sample-agentic-ai-web python 10-mcp-server.py \ --env DEBUG="true" \ --env AWS_REGION="your-aws-region" \ --env BEDROCK_API_KEY="your-bedrock-api-key" \ --env BEDROCK_MODEL_NOVA="Nova" \ --env BEDROCK_MODEL_CLAUDE="Claude3"
How to use
This MCP server implements a web automation assistant built on Amazon Bedrock models (Claude via Bedrock and Nova) with a progressive set of capabilities. It demonstrates how to define tools for web navigation, take and analyze screenshots, use human-in-the-loop input, and progressively integrate vision, text input, form submission, scrolling, file writing, and a full MCP client-server architecture. You can invoke the MCP server to perform tasks such as navigating to a webpage, capturing visual context, identifying clickable elements via vision, entering text into forms, and saving results to a markdown document. The architecture supports structured tool definitions, resource lifecycle management, and efficient context handling to maintain multi-step conversations without excessive token usage.
How to install
Prerequisites:
- Python 3.8+ installed on your system
- Access to AWS Bedrock with Claude and Nova models configured
- AWS CLI configured with credentials and region permissions
Steps:
-
Clone the repository: git clone <repository-url> cd sample-agentic-ai-web
-
(Optional) Create and activate a virtual environment: python -m venv venv source venv/bin/activate # on macOS/Linux .\venv\Scripts\activate # on Windows
-
Install dependencies (adjust if a requirements file exists): pip install -r requirements.txt # if provided
or install key packages manually, e.g., fastmcp, playwright, pillow, etc.
-
Ensure AWS Bedrock access and environment variables are set (see mcp_config env section).
-
Run the MCP server: python 10-mcp-server.py
-
In a separate terminal, you can run the client if needed (depending on your setup) to interact with the server via the MCP protocol.
Note: The repository describes a step-based progression from basic API usage to a fully MCP-based client/server architecture. Ensure Playwright dependencies are installed if you plan to run the headless browser and vision steps.
Additional notes
Tips and notes:
- The server starts automatically as shown in Step 10 and Step 11 of the project; ensure the working directory contains 10-mcp-server.py.
- Environment variables related to Bedrock (Beds) should be kept secure; avoid committing credentials.
- If you encounter permission or network issues, verify AWS credentials and Bedrock access, and ensure Playwright dependencies (like browsers) are installed when using headless browser features.
- Screenshots are saved with unique filenames; manage storage if running many sessions.
- This example emphasizes MCP-based architecture with a client/server separation and a lifecycle-managed runtime; adapt env vars to your deployment environment (local, container, or cloud).
- The project outlines a multi-step workflow; you can extend or modify steps by adding new MCP server steps following the same pattern.
Related MCP Servers
volcano-agent-sdk
🌋 Build AI agents that seamlessly combine LLM reasoning with real-world actions via MCP tools — in just a few lines of TypeScript.
sec-edgar
A SEC EDGAR MCP (Model Context Protocol) Server
mcp-checkpoint
MCP Checkpoint continuously secures and monitors Model Context Protocol operations through static and dynamic scans, revealing hidden risks in agent-to-tool communications.
mcp-flight-search
MCP Server implementation for the Model Context Protocol (MCP) enabling AI tool usage - Realtime Flight Search
symfony
A Symfony package designed for building secure servers based on the Model Context Protocol, utilizing Server-Sent Events (SSE) and/or StreamableHTTP for real-time communication. It offers a scalable tool system tailored for enterprise-grade applications.
remind
A memory layer for AI Agents