Skip to main content
Glama
patelketul1230

Enterprise Secure AWS MCP Server

Enterprise Secure AWS Model Context Protocol (MCP) Server

Produktionsreifer Model Context Protocol (MCP) Server, bereitgestellt auf AWS Lambda & API Gateway, mit 100 % Terraform IaC, Zero-Trust-IAM RBAC und Abwehrmaßnahmen gemäß der OWASP-LLM-Top-10.


AWS-Architekturübersicht

AWS Enterprise MCP Server Figma Architecture Diagram


Related MCP server: MCP Airlock

Funktionsumfang

  • Standard-MCP-Spezifikationen: Volle Unterstützung für Tool Discovery (/mcp/tools) und Tool Execution (/mcp/tools/call) des Anthropic Model Context Protocol (MCP).

  • IAM-Rollenbasierte Zugriffskontrolle (RBAC): Beschränkt die Tool-Ausführung anhand der Rolle (sre_read_only, security_auditor, sre_admin).

  • OWASP-LLM02-Abwehr: Edge-Säuberung, die Subshell-Metazeichen-Injektionen ([;&|'$]) blockiert.

  • OWASP-LLM06-Abwehr: Automatisches Schwärzen der Ausgabepuffer, die AWS-Zugriffsschlüssel (AKIA...) und personenbezogene Daten (PII) entfernt.

  • Interaktive Web-UI-Playground: Dark-Mode-Schnittstelle, die auf http://localhost:8080 läuft (make ui).

  • Keine Cloud-Kosten im Leerlauf: Provisioniert über Terraform mittels Ein-Befehl-Deployment (make deploy) und sofortigem Abbau (make destroy).


Web-UI-Plattform Demo

Nachfolgend sehen Sie die automatisierte High-Definition-Interactive-Demonstration, die die RBAC-Zugriffsverweigerung, die Abwehr von Befehlsinjektionen und die erfolgreiche Ausführung des Server-Neustarts unter der Rolle sre_admin zeigt:

AWS MCP Server Web UI Security Testing Demo


Voraussetzungen & Systems-

Einrichtung

Stellen Sie vor dem Einrichten des Projekts sicher, dass in Ihrer Umgebung Python 3.11+, Terraform und die AWS CLI installiert sind.

1. Systemabhängigkeiten (Linux / Ubuntu / Debian)

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

2. Umgebungseinrichtung

Klonen Sie das Repository und installieren Sie die Projektabhängigkeiten in einer isolierten virtuellen Umgebung (.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-Struktur

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

Schnellstart-Anleitung

1. Abhängigkeiten installieren

make install

2. Tests ausführen

make test

3. Infrastruktur in AWS bereitstellen

make deploy

Ausgaben:

  • API-Endpunkt: Dynamische, von Terraform generierte Ausgabe

  • CloudWatch Logging Group: /aws/mcp/aws-mcp-enterprise-server-dev

4. Interaktiven Web-UI-Playground starten

make ui

Öffnen Sie http://localhost:8080 in Ihrem Browser, um Tool-Aufrufe, RBAC-Rollen und Injektionsabwehrmaßnahmen visuell zu testen!

5. Testen über das 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. AWS-Ressourcen abbauen

make destroy

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables AI models to interact with AWS Lambda functions via the MCP protocol, allowing access to private resources, real-time data, and custom computation in a secure environment.
    2
    109
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    Enables secure, zero-trust access to MCP tools through short-lived, signed capability leases that bind tool execution to specific sessions, intents, and constraints. Prevents prompt injection attacks and privilege escalation with dynamic risk scoring, policy enforcement, and tamper-evident audit logging.
    4
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Bridges MCP clients and AWS Lambda functions, enabling generative AI models to invoke Lambda functions as tools without code changes.
    Apache 2.0