DEV Community

dineshrajdhanapathyDD for AWS Community Builders

Posted on • Originally published at aws.plainenglish.io on

Building an AWS Study Buddy with MCP + Strands Agents SDK

An AI-powered learning assistant that can search AWS documentation, explain cloud concepts in simple terms, track learning progress, and generate quizzes for better understanding.

1

📖 Introduction

What if you had a personal AWS tutor that could search official documentation, explain services in simple terms, remember what you’ve studied, and quiz you on it later?

That’s exactly what I built for an AWS Study Buddy powered by the Model Context Protocol (MCP) and Amazon Nova Pro.

In this blog, I’ll walk you through the entire journey from concept to working demo.

🎯 The Problem

Learning AWS is overwhelming. There are 200+ services, thousands of documentation pages, and it’s hard to track what you’ve already studied. Most chatbots just answer questions — they don’t help you learn systematically.

I wanted an agent that:

  1. Searches real, official AWS documentation (not hallucinated answers)
  2. Remembers what I’ve studied across sessions
  3. Can quiz me to reinforce learning
  4. Does cost calculations for pricing questions
  5. Streams responses in real time

🧠 The Solution: AWS Study Buddy

An interactive AI agent that combines:

2

🏗️ Architecture

3

4

🔧 Tech Stack

  • Strands Agents SDK  — The agent framework
  • Amazon Bedrock  — Nova Pro v1 as the LLM
  • MCP (Model Context Protocol) — Connects to the AWS Documentation server
  • Python  — The glue that holds it all together
  • JSON  — Simple persistent memory (no cloud DB needed)

📝 Step-by-Step Build Process

Step 1: Setting Up the MCP Connection

The Model Context Protocol lets our agent talk to external tools via a standardized interface. The AWS Documentation MCP server provides tools to search and read official AWS docs.

from strands.tools.mcp import MCPClient 
from mcp import StdioServerParameters, stdio_client 

aws_docs_mcp = MCPClient( 
    lambda: stdio_client( 
        StdioServerParameters( 
            command="uvx", 
            args=["awslabs.aws-documentation-mcp-server@latest"], 
            env={**os.environ, "FASTMCP_LOG_LEVEL": "ERROR"} 
        ) 
    ) 
)
Enter fullscreen mode Exit fullscreen mode

This starts the MCP server as a subprocess and communicates via stdio. The uvx command downloads and runs the server without needing a separate install step.

5

Step 2: Building Custom Tools

I created 4 custom tools using the @tool decorator:

save_note  — Stores a study summary with timestamp:

@tool 
def save_note(topic: str, summary: str) -> str: 
    """Save a study note about an AWS topic.""" 
    notes = _load_notes() 
    notes["notes"][topic.lower()] = { 
        "summary": summary, 
        "studied_at": datetime.now().strftime("%Y-%m-%d %H:%M") 
    } 
    _save_notes(notes) 
    return f"📝 Note saved for '{topic}'!"
Enter fullscreen mode Exit fullscreen mode

get_notes  — Retrieves past study notes:

@tool 
def get_notes(topic: str) -> str: 
    """Retrieve study notes. Use 'all' to see everything.""" 
    notes = _load_notes() 
    if topic.lower() == "all": 
        return f"📚 You've studied {len(notes['topics'])} topics..."
Enter fullscreen mode Exit fullscreen mode

record_quiz_score  — Tracks quiz performance:

@tool 
def record_quiz_score(topic: str, score: int, total: int) -> str: 
    """Record quiz results for progress tracking."""
Enter fullscreen mode Exit fullscreen mode

calculator  — For cost estimates:

@tool 
def calculator(expression: str) -> str: 
    """Evaluate math expressions for pricing calculations."""
Enter fullscreen mode Exit fullscreen mode

Step 3: Streaming Callback

The callback handler prints text as it arrives — no waiting for the full response:

def streaming_callback(**kwargs): 
    if "data" in kwargs: 
        print(kwargs["data"], end="", flush=True) 
    if "current_tool_use" in kwargs and kwargs["current_tool_use"].get("name"): 
        print(f"\n🔧 Using tool: {kwargs['current_tool_use']['name']}")
Enter fullscreen mode Exit fullscreen mode

Key insight: The callback uses **kwargs (keyword arguments), not positional args. The SDK passes data, current_tool_use, init_event_loop, etc., as keyword arguments.

Step 4: The Agent System Prompt

The system prompt is crucial — it tells the agent how to behave as a tutor:

system_prompt = """You are AWS Study Buddy 📚🤖 

Your behavior: 
1. When asked about AWS, SEARCH the docs first, then explain 
2. After explaining, ALWAYS save a note using save_note 
3. When asked to quiz, create questions from saved notes 
4. Be encouraging, use emojis, make learning fun! 
"""
Enter fullscreen mode Exit fullscreen mode

Step 5: Combining MCP + Custom Tools

The magic happens when we combine MCP tools with custom tools:

with aws_docs_mcp: 
    mcp_tools = aws_docs_mcp.list_tools_sync() 
    all_tools = mcp_tools + [save_note, get_notes, record_quiz_score, calculator] 

    agent = Agent( 
        model=model, 
        tools=all_tools, 
        callback_handler=streaming_callback 
    )
Enter fullscreen mode Exit fullscreen mode

The agent now has access to both AWS documentation search AND persistent memory — it can search docs, explain, save notes, and quiz, all in one conversation.

Step 6: Interactive Chat Loop

while True: 
    user_input = input("\n🧑 You: ").strip() 
    if user_input.lower() in ("quit", "exit"): 
        break 
    print("\n🤖 Study Buddy: ", end="", flush=True) 
    response = agent(user_input) 
    print()
Enter fullscreen mode Exit fullscreen mode

7

🎬 Demo: A Real Conversation

🧑 You: Explain S3 in simple terms 

🤖 Study Buddy: 
🔧 Using tool: search_documentation 
🔧 Using tool: read_documentation 

Amazon S3 (Simple Storage Service) is object storage! 🪣 

Key points: 
• Store unlimited data as "objects" in "buckets" 
• 99.999999999% (11 nines) durability 
• Use cases: backups, static websites, data lakes 
• Storage classes: Standard, IA, Glacier 

🔧 Using tool: save_note 
📝 Note saved for 'S3'! You've now studied 1 topic.

🧑 You: How much for 100GB in S3 Standard? 

🤖 Study Buddy: 
🔧 Using tool: calculator 

S3 Standard: $0.023/GB/month 
100 × $0.023 = $2.30/month 💰

🧑 You: Quiz me on S3 

🤖 Study Buddy: 
🔧 Using tool: get_notes 

Q1: How many nines of durability does S3 have? 
Q2: What are objects stored inside? 
Q3: Name 2 storage classes.

🧑 You: 11 nines, buckets, Standard and Glacier 

🤖 Study Buddy: 
🔧 Using tool: record_quiz_score 
🌟 Excellent! 3/3 (100%) on S3!
Enter fullscreen mode Exit fullscreen mode

🧩 Challenges I Faced

1. mem0ai Version Incompatibility

Initially, I tried using mem0_memory from strands-agents-tools for persistent memory. But mem0ai version 1.x removed FAISS and aws_bedrock support, breaking everything.

Solution: Replaced with a simple JSON file-based memory. It’s simpler, always works, and has zero dependencies.

2. Streaming Callback Signature

The callback handler signature changed across versions. Using def callback(event) or def callback(event, **kwargs) Both failed.

Solution: Use def callback(**kwargs) - The SDK passes everything as keyword arguments.

3. MCP Server Startup

The MCP server needs uvx (from the uv package manager) to run without pre-installation.

Solution: Install uv with pip install uv, then the script uses uvx to auto-download and run the MCP server.

💡 Key Learnings

  1. MCP is powerful  — It gives agents access to real, structured data sources without hallucination
  2. Simple memory beats complex memory  — A JSON file is more reliable than fighting version conflicts
  3. System prompts matter  — The agent’s behaviour is 90% determined by how you prompt it
  4. Streaming makes UX great  — Real-time output feels much more responsive than waiting
  5. Tool chaining is magic  — The agent naturally chains search → explain → save in one turn

📊 Judging Criteria

6

🚀 Future Improvements

  • Add more MCP servers (CDK, Cost Analysis) for a multi-MCP super-agent
  • Spaced repetition algorithm for quiz scheduling
  • Export study notes as markdown files
  • Add a web UI with Flask/Streamlit
  • Connect to Bedrock Knowledge Bases for custom documentation

Conclusion

Building an AI agent with MCP + Strands SDK is surprisingly straightforward. The hardest part wasn’t the code it was getting the right package versions installed! Once that’s sorted, the SDK handles tool routing, streaming, and conversation management beautifully.

The Model Context Protocol is a game-changer for AI agents. Instead of hoping the LLM knows the answer, you can connect it to authoritative data sources. For AWS documentation, this means accurate, up-to-date answers every time.

If you’re learning AWS, try building your own study buddy. The act of building the agent teaches you more about AWS than using it! 🎓

GitHub link: AWS Study Buddy with MCP

Resources

Built with ❤️ by DD

Thank you for taking the time to read my article! If you found it helpful, feel free to like, share, and drop your thoughts in the comments; I’d love to hear from you.

If you want to connect or dive deeper into cloud, AI and DevOps, feel free to follow me on my socials:

💼 LinkedIn

X (formerly Twitter)

👨‍💻 DEV Community

🛡️Medium

🐙 GitHub

🌍AWS Builder Profile


Top comments (0)