Build an AWS Agent using MCP and LangGraph

Build an AWS Agent using MCP and LangGraph

August 6, 2025, by Tobias Abdon

Transform Your AI Agents with an AWS Integration

I'm excited to announce the launch of my new hands-on lab: "Build an AWS Agent using MCP and LangGraph". This project teaches you how to build AI agents that can directly interact with and manage your AWS infrastructure through natural language commands.

Ever wanted to ask an AI assistant "How many EC2 instances are running?" or "Create an S3 bucket named my-demo-bucket" and have it actually execute those tasks? This lab makes that possible using the Model Context Protocol (MCP) – an emerging standard that makes it easier to connnect AI agents to external systems.

What is MCP and Why Does It Matter?

The Model Context Protocol (MCP), developed by Anthropic, is an open protocol that standardizes how AI models connect to external tools and data sources. Think of it as a universal translator between AI agents and the services they need to interact with.

Key benefits of MCP for AI agents:

  • Up-to-date knowledge: Pull in fresh data that your base model might not know (like recent AWS service APIs)
  • Improved accuracy: Get real information instead of hallucinations, especially for specialized domains like AWS
  • Tool execution & automation: Turn common workflows into tools the agent can actually invoke
  • Standard integration: Use one unified interface for all tools, regardless of the underlying system

What You'll Learn in This Lab

This hands-on tutorial guides you through building a modern LangGraph agent that:

  • Uses Claude as the reasoning engine for natural language understanding
  • Connects to AWS API MCP server for real AWS operations
  • Handles complex requests like infrastructure provisioning and monitoring
  • Maintains conversation memory for context-aware interactions

Real-World Examples You'll Build

By the end of the lab, your agent will seamlessly handle natural language requests that would typically require knowledge of specific AWS CLI commands or console navigation. You'll be able to ask questions like "How many EC2 instances are running?" and get immediate, detailed responses about your infrastructure. Need to provision storage? Simply tell the agent "Create an S3 bucket named skillmix-demo-bucket" and watch it execute the proper AWS commands behind the scenes. The agent also excels at region-specific queries, so requests like "List my S3 buckets in us-west-2" or "Show me all running instances in us-west-2" become as simple as having a conversation with a knowledgeable colleague who has instant access to your AWS environment.

The AWS API MCP Server Advantage

What makes the AWS API MCP Server particularly compelling is its comprehensive coverage and built-in safety features. The server supports nearly all AWS CLI commands with up-to-date coverage, meaning you're not limited to a subset of AWS functionality that might become outdated. Every command gets validated before execution, preventing potentially dangerous operations from accidentally wreaking havoc on your infrastructure. The server seamlessly integrates with your existing AWS credentials and respects your IAM permission boundaries, so the agent can only perform actions you're already authorized to do. For those wanting to explore safely, there's even a read-only mode that lets you learn and experiment without any risk of making unwanted changes. Perhaps most impressively, the server provides intelligent command suggestions using embedding-based search, helping the AI figure out the right AWS operations even for complex or ambiguous requests.

What's Covered in the Lab

The tutorial walks you through:

  1. Environment setup with Python virtual environments and required packages
  2. Claude API integration for the reasoning engine
  3. AWS CLI configuration with proper credentials
  4. MCP client setup using the MultiServerMCPClient interface
  5. LangGraph agent creation with conversation memory
  6. Interactive testing with real AWS operations

Sample Output

🚀 Interactive AWS Assistant
Type 'quit' to exit, 'help' for examples
==================================================

🧑 You: what ec2 instances are running

🤖 Assistant: I've found 1 EC2 instance that is currently running:

**Instance Details:**
- **Instance ID**: i-0a404920ae67095b5
- **Instance Type**: t2.micro
- **State**: running
- **Availability Zone**: us-west-2a
- **Public IP**: 52.12.174.155
- **Launch Time**: 2025-08-06T02:51:20+00:00

Ready to Get Started?

This lab shows what's possible with AI-powered infrastructure management. Instead of memorizing AWS CLI commands or navigating complex consoles, you can simply tell an AI agent what you need in plain English.

Whether you're a DevOps engineer, cloud architect, or AI enthusiast, this hands-on experience will give you practical skills for building the next generation of intelligent automation tools.

Access the full lab tutorial here (3 free lab sessions) →

Have questions or want to share what you built? I'd love to hear about your experience with MCP and AI agents in the comments below!


This lab is part of my ongoing series on practical AI applications. Stay tuned for more tutorials on agent architectures, tool integration, and real-world automation.