AWS Logo
Menu
Build a Trusted Advisor MCP Server

Build a Trusted Advisor MCP Server

Yet Again...

Published Apr 15, 2025

Problem Statement:

I need to be able to use natural language to query and retrieve Recommendations by AWS Trusted Advisor. I don’t want to use AWS Cli. I don’t want to login to console. Just use my favourite AI tool ( Amazon Q or Claude Desktop or Cline) and write a prompt. I also wanted to be easily able to do the same in multiple projects/Teams across my organization.

What is AWS Trusted Advisor:

AWS Trusted Advisor is service that helps you optimize your AWS infrastructure for cost, performance, security, and other areas by providing real-time guidance and recommendations based on AWS best practices. It analyzes your AWS environment and suggests actions to remediate any deviations from best practices, potentially leading to cost savings, improved performance, and enhanced security.

Why not use latest AWS–native Q Developer CLI agent?

There are quite a few MCP servers from AWS in the github repo https://github.com/awslabs/mcp/tree/main/samples/ but nothing specific to AWS Trusted Advisor recommendations. Without custom MCP implementation or usage of AWS CLI, the tool cannot perform required action

Enter world of MCP Servers:

Developed by Anthropic as an open protocol, MCP provides a standardized way to connect AI models to virtually any data source or tool. Using a client-server architecture, MCP enables developers to expose their data through lightweight MCP servers while building AI applications as MCP clients that connect to these servers. Through this architecture, MCP enables users to build more powerful, context-aware AI agents that can seamlessly access the information and tools they need. Whether you’re connecting to external systems or internal data stores or tools, you can now use MCP to interface with all of them in the same way. The client-server architecture of MCP enables your agent to access new capabilities as the MCP server updates without requiring any changes to the application code.

Trusted Advisor MCP Server Solution Architecture Diagram:

MCP Server Implementation Files:

Refer to github : https://github.com/ajitnk-lab/trucsted-advisor-mcp.git
trusted_advisor_mcp_server.py – Implement MCP server using FastAPI
requirements.txt – Python dependencies
.env – contain AWS credentials for AWS account access with Business Support plan

MCP Server Configuration:

claude_desktop_config.json – for Claude Desktop integration

Next Steps:

You can create an AWS Bedrock Agent that uses an Action Group to call an external MCP server. This is a very valid and potentially powerful architecture
 

Comments