Get the FREE Ultimate OpenClaw Setup Guide →

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.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
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:

  1. Clone the repository: git clone <repository-url> cd sample-agentic-ai-web

  2. (Optional) Create and activate a virtual environment: python -m venv venv source venv/bin/activate # on macOS/Linux .\venv\Scripts\activate # on Windows

  3. 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.

  4. Ensure AWS Bedrock access and environment variables are set (see mcp_config env section).

  5. Run the MCP server: python 10-mcp-server.py

  6. 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

Sponsor this space

Reach thousands of developers