Enterprise Secure AWS MCP Server

Enterprise Secure AWS MCP Server

Enables secure tool discovery and execution on AWS Lambda with role-based access control, command injection defense, and sensitive data redaction, allowing managed CloudWatch log queries and Terraform operations through a standard MCP interface.

Category
Visit Server

README

Enterprise Secure AWS Model Context Protocol (MCP) Server

Production-grade Model Context Protocol (MCP) Server deployed on AWS Lambda & API Gateway with 100% Terraform IaC, zero-trust IAM RBAC, and OWASP LLM Top 10 defense guardrails.


AWS Architecture Overview

AWS Enterprise MCP Server Figma Architecture Diagram


Features

  • Standard MCP Specs: Full support for Anthropic Model Context Protocol (MCP) Tool Discovery (/mcp/tools) and Tool Execution (/mcp/tools/call).
  • IAM Role-Based Access Control (RBAC): Restricts tool execution by role (sre_read_only, security_auditor, sre_admin).
  • OWASP LLM02 Defense: Edge sanitization blocking subshell metacharacter injections ([;&|'$]).
  • OWASP LLM06 Defense: Automatic output buffer redactor scrubbing AWS access keys (AKIA...) and PII.
  • Interactive Web UI Playground: Dark-mode test interface running on http://localhost:8080 (make ui).
  • Zero Idle Cloud Cost: Provisioned via Terraform with single-command deployment (make deploy) and instant teardown (make destroy).

Web UI Playground Demo

Below is the automated high-definition interactive demonstration showing RBAC access denial, command injection defense, and successful server restart execution under the sre_admin role:

AWS MCP Server Web UI Security Testing Demo


Prerequisites & System Setup

Before setting up the project, ensure your environment has Python 3.11+, Terraform, and AWS CLI installed.

1. System Dependencies (Linux / Ubuntu / Debian)

sudo apt update && sudo apt install python3-venv python3-pip terraform awscli -y

2. Environment Setup

Clone the repository and install project dependencies into an isolated virtual environment (.venv):

git clone https://github.com/patelketul1230/aws-mcp-enterprise-server.git
cd aws-mcp-enterprise-server

# Create .venv and install dependencies
make install

Repository Structure

aws-mcp-enterprise-server/
├── docs/
│   ├── assets/                    # Centralized PNG images & HD animations
│   │   ├── mcp_aws_figma_architecture_diagram.png
│   │   ├── mcp_ui_testing_demo.webp
│   │   ├── mcp_ui_testing_demo.gif
│   │   ├── mcp_ui_playground_success_screenshot.png
│   │   ├── mcp_ui_playground_admin_success_screenshot.png
│   │   └── mcp_ui_playground_blocked_screenshot.png
│   ├── blogs/                     # 3 Medium Sub-Blogs ready for publication
│   │   ├── blog_1_1_mcp_decoded.md
│   │   ├── blog_1_2_mcp_rbac_python.md
│   │   └── blog_1_3_mcp_tool_poisoning.md
│   ├── architecture.md            # Figma diagrams & sequence flows
│   ├── 5w_and_how.md              # 5 Ws + 1 H problem statement & threat model
│   └── demo_execution.log         # Verified test execution log
├── src/
│   ├── clients/                   # AWS Bedrock Converse API integration client
│   ├── middleware/                # MCPSecurityValidator (RBAC & DLP)
│   ├── tools/                     # CloudWatch & Terraform tool modules
│   ├── ui/                        # Interactive Web UI Playground (index.html)
│   └── server.py                  # AWS Lambda & FastAPI server handler
├── terraform/                     # 100% Terraform IaC (API Gateway, IAM, Lambda)
├── tests/                         # Pytest suite & live verification scripts
├── Makefile                       # Lifecycle hooks (make deploy / make destroy / make ui)
└── README.md                      # Project documentation

Quick Start Guide

1. Install Dependencies

make install

2. Run Tests

make test

3. Deploy Infrastructure to AWS

make deploy

Outputs:

  • API Endpoint: Dynamic output generated by Terraform
  • CloudWatch Log Group: /aws/mcp/aws-mcp-enterprise-server-dev

4. Launch Interactive Web UI Playground

make ui

Open http://localhost:8080 in your web browser to test tool calls, RBAC roles, and injection defenses visually!

5. Test via Terminal (curl)

# Health Check
curl -s <YOUR_API_ENDPOINT>/health

# Tool Discovery Catalog
curl -s <YOUR_API_ENDPOINT>/mcp/tools

# Valid Tool Call (CloudWatch Query)
curl -s -X POST <YOUR_API_ENDPOINT>/mcp/tools/call \
  -H "Content-Type: application/json" \
  -H "X-User-Role: sre_read_only" \
  -d '{"tool_name": "query_cloudwatch_logs", "arguments": {"log_group": "/aws/lambda/payment-dev", "filter_pattern": "ERROR"}}'

# Command Injection Attack (Returns 403 Forbidden)
curl -s -X POST <YOUR_API_ENDPOINT>/mcp/tools/call \
  -H "Content-Type: application/json" \
  -H "X-User-Role: sre_read_only" \
  -d '{"tool_name": "query_cloudwatch_logs", "arguments": {"log_group": "/aws/lambda/payment-dev; rm -rf /", "filter_pattern": "ERROR"}}'

6. Tear Down AWS Resources

make destroy

Technical Documentation Links

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured