AWS Infrastructure MCP Server
Provides tools for interacting with Amazon Web Services (AWS), enabling diagnostics and management of Lambda functions, CloudWatch logs/metrics, DynamoDB tables, IAM roles, and Bedrock-based incident analysis.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AWS Infrastructure MCP ServerCheck my payment Lambda errors and analyze the likely root cause."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AWS Infrastructure MCP Server
A local FastMCP server (Python 3.12+, stdio transport) that exposes AWS diagnostic tools for serverless applications directly to IDE AI agents. It connects Cursor, VS Code Copilot, or Claude Code to CloudWatch, Lambda, DynamoDB, IAM, and Bedrock through the Model Context Protocol.
Architecture & Design Choices
Transport & Stack
Component | Choice |
Runtime | Python 3.12+ |
MCP framework | FastMCP 3.x |
Package manager | uv |
AWS SDK | boto3 |
Schema validation | Pydantic 2.x |
Transport | stdio (IDE spawns the server process) |
Authentication
Uses boto3's default credential chain with no custom auth logic. The chain checks, in order: environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) → ~/.aws/credentials → ~/.aws/config → instance metadata. Set AWS_PROFILE to target a specific named profile.
Tool Surface
15 tools across 4 modules:
CloudWatch & Lambda — Service Diagnostics (tools/cloudwatch.py, tools/lambda_ops.py)
Tool | Description |
| List Lambda functions, optionally filtered by name prefix |
| Pull recent CloudWatch log events for a Lambda's log group |
| Filter log events to ERROR/exception/Traceback lines only |
| Retrieve invocations, errors, duration, and throttle metrics |
| Synchronous invocation ( |
DynamoDB — Data Health (tools/dynamodb.py)
Tool | Description |
| List DynamoDB tables, optionally filtered by name prefix |
| Return key schema, attributes, GSIs, item count, size, status |
| Query by primary key condition; hard-capped at 25 items |
| Scan with optional filter; hard-capped at 25 items |
| Query CloudWatch for ReadThrottleEvents, WriteThrottleEvents, UserErrors |
IAM — Security Governance (tools/iam.py)
Tool | Description |
| List IAM roles, optionally filtered by name prefix |
| Return trust policy and all attached/inline policy documents |
| Map each Lambda function to its execution role ARN |
| Flag three high-risk patterns (see below) |
validate_least_privilege checks:
Wildcard permissions — statements with
"Action": "*"or"Resource": "*"Dangerous managed policies —
AdministratorAccessorPowerUserAccessattachedUnscoped data access — S3 or DynamoDB read/write actions without specific resource ARNs
Bedrock — AI Root-Cause Analysis (tools/bedrock.py)
Tool | Description |
| Send diagnostic context to Bedrock; returns structured analysis |
Accepts raw text (logs, stack traces, metric summaries). Returns a validated Pydantic object:
class IncidentAnalysis(BaseModel):
severity: Literal["LOW", "MEDIUM", "HIGH", "CRITICAL"]
root_cause_summary: str
affected_components: list[str]
recommended_fix: strThe model_id parameter accepts any Bedrock-available model (for example: meta.llama3-2-3b).
Security Boundary
All tools are read-only except
invoke_lambda(synchronous invocation only).No tool creates, updates, or deletes Lambda functions, DynamoDB items, IAM policies, or any other AWS resource.
A global credential scrubber (
utils/scrubber.py) redacts AWS access key IDs, secret access keys, and session tokens from all tool outputs before data reaches the LLM context. Applied to log messages, invocation responses, and error outputs.
Project Structure
mcpserver/
├── app.py # FastMCP instance (single shared object)
├── server.py # Entry point — imports tool modules, runs stdio
├── tools/
│ ├── __init__.py
│ ├── cloudwatch.py # get_lambda_logs, get_lambda_errors, get_lambda_metrics
│ ├── lambda_ops.py # list_lambdas, invoke_lambda
│ ├── dynamodb.py # list_tables, describe_table, query_table, scan_table, get_table_metrics
│ ├── iam.py # list_roles, get_role_policy, validate_least_privilege, list_lambda_roles
│ └── bedrock.py # analyze_incident + IncidentAnalysis schema
├── utils/
│ ├── __init__.py
│ └── scrubber.py # Credential redaction regex patterns
├── tests/
│ ├── test_scrubber.py
│ ├── test_cloudwatch.py
│ ├── test_lambda_ops.py
│ ├── test_dynamodb.py
│ ├── test_iam.py
│ └── test_bedrock.py
├── pyproject.toml
└── uv.lockInstallation & Local Setup
Prerequisites:
Python 3.12+
uv package manager
AWS CLI configured (
~/.aws/credentialsor environment variables)
# Clone and install dependencies
cd mcpserver
uv sync
# Run the server locally (stdio)
uv run python server.pyIDE Configuration
VS Code / Cursor
Create .vscode/mcp.json in the project root:
{
"servers": {
"aws-infra-mcp": {
"type": "stdio",
"command": "uv",
"args": ["--directory", "/absolute/path/to/mcpserver", "run", "server.py"]
}
}
}Replace /absolute/path/to/mcpserver with the actual path to this directory. On Windows, use forward slashes (C:/Users/.../mcpserver).
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"aws-infra-mcp": {
"command": "uv",
"args": ["--directory", "/absolute/path/to/mcpserver", "run", "server.py"]
}
}
}Testing Strategy
Tests use a single-seam design: each @mcp.tool() function is tested at its public boundary with boto3 mocked beneath it using unittest.mock.patch. Tests verify the tool's transformation logic — log filtering, hard cap enforcement, credential scrubbing, Pydantic validation — without requiring live AWS credentials or making network calls.
57 unit tests across 6 test files:
# Run the full suite
uv run pytest
# Run a single cluster's tests
uv run pytest tests/test_iam.py -vThis server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
AI agent run monitoring with incident replay and SLA receipts.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Real-time Amazon, WIPO & PACER data for AI agents — 19 tools via the MCP protocol.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/getsuga-tenshou/mcpserver'
If you have feedback or need assistance with the MCP directory API, please join our Discord server