convez.ai
MCP ServerDevOps & InfraestruturaIntermediário
kernelpanic09

MCP Server AWS

kernelpanic09/mcp-server-aws

Acesso seguro a AWS via Claude com leitura por padrão

Ver no GitHub
BomPluginScore · de 0 a 100

Servidor MCP que integra Claude e outros agentes de IA com recursos AWS (EC2, S3, IAM, CloudWatch, EKS, custos). Oferece consultas seguras apenas-leitura por padrão, com operações de escrita opcionais e controladas por token de confirmação.

Instalação

$npx convez-ai kernelpanic09/mcp-server-aws

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
0
Forks
0
Acompanhando
0
Saúde
85%
Último commit
há 1 mês
Versão
v1.0.0
Issues abertas
0
Contribuidores
1

Casos de uso

  • Consultar estado de instâncias EC2 e recursos AWS em linguagem natural
  • Monitorar custos e métricas CloudWatch sem escrever código
  • Auditar permissões IAM e políticas de segurança automaticamente
  • Gerenciar EKS e buckets S3 através de conversas com Claude

Veredito

Ferramenta sólida e bem-mantida que democratiza acesso a AWS via IA. Implementação cuidadosa de segurança (leitura-primeiro, confirmação para escrita) torna-a confiável para ambientes produção. Excelente para times que querem consultas naturais em infraestrutura.

README

A tradução para o português deste README ainda está na fila.

mcp-server-aws

CI License: MIT Release Last commit Python MCP

An MCP server that lets Claude and other AI clients query AWS resources over stdio.

Connect it to Claude Desktop or Claude Code and you can ask questions like "which EC2 instances are running in us-west-2?" or "what did I spend on RDS last month?" without writing any glue code. Everything is read-only by default. Write operations require an explicit flag at startup and a confirmation token for destructive actions.


Installation

pip install mcp-server-aws

Or with uv:

uv pip install mcp-server-aws

Quick start

Install with uv:

uv pip install mcp-server-aws

Or for local development:

git clone https://github.com/kernelpanic09/mcp-server-aws
cd mcp-server-aws
uv pip install -e ".[dev]"

Make sure AWS credentials are available (env vars, ~/.aws/credentials, or an instance role). Then add the server to your AI client.

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "aws": {
      "command": "mcp-server-aws",
      "args": []
    }
  }
}

Claude Code

Create or merge into .claude/mcp.json in your project:

{
  "mcpServers": {
    "aws": {
      "command": "mcp-server-aws",
      "args": [],
      "env": {
        "AWS_PROFILE": "your-profile"
      }
    }
  }
}

Options

mcp-server-aws [--allow-writes] [--region REGION] [--profile PROFILE] [--max-items N]
FlagDefaultNotes
--allow-writesoffEnables tag, stop, and restart tools
--regionus-east-1Default region for calls that don't specify one
--profileboto3 defaultAWS credential profile
--max-items100Max items per paginated list

Available tools

EC2

ToolDescription
list_ec2_instancesList instances with optional filters
describe_ec2_instanceFull details for one instance
stop_ec2_instanceStop an instance (write, confirmation required)
get_stop_confirmation_tokenGet the token needed to stop an instance

S3

ToolDescription
list_s3_bucketsAll buckets with region and creation date
get_s3_bucket_policyBucket policy as parsed JSON

IAM

ToolDescription
list_iam_usersUsers with last-login timestamps
list_iam_rolesAll roles
get_iam_roleRole details with trust policy and attached policies

Observability

ToolDescription
get_cloudwatch_metricFetch metric datapoints
query_cloudwatch_logsRun a Logs Insights query

Compute

ToolDescription
list_eks_clustersEKS cluster names in a region
describe_eks_clusterCluster version, endpoint, VPC config
list_lambda_functionsFunctions with runtime and memory
list_rds_instancesRDS instances with engine and connection info

Cost

ToolDescription
get_cost_and_usageCost Explorer query by date range and dimension

Networking

ToolDescription
describe_security_groupInbound and outbound rules for a security group

CloudFormation

ToolDescription
list_cloudformation_stacksActive stacks (excludes deleted)
describe_cloudformation_stackStack with outputs and parameters

Write tools (require --allow-writes)

ToolDescription
tag_resourceAdd or update tags on any ARN-addressable resource
restart_ecs_serviceForce a new ECS service deployment
get_ecs_restart_confirmation_tokenGet the token needed to restart a service

Resources

URIDescription
aws://account/identityAccount ID and caller identity
aws://regionsAll enabled regions
aws://cost/current-monthCurrent month's spend by service

Safety

The server is read-only by default. All write tools check the --allow-writes flag at call time and return a structured error if it's not set. No credentials are ever logged or returned in tool output.

Destructive operations (stopping instances, restarting services) require a confirmation token. The token encodes the operation and target, so you can't reuse a token across different resources.

Every tool call writes a structured JSON audit line to stderr:

{"ts": "2024-01-15T10:23:45+00:00", "tool": "list_ec2_instances", "params": {"region": "us-east-1"}, "result": "12 instances"}

See docs/safety.md for the IAM policy recommendation and full security model.


Example prompts

Once connected:

  • "Find me all EC2 instances tagged env=prod that are stopped."
  • "What's the most expensive AWS service this month?"
  • "Show me IAM users who haven't logged in since January."
  • "Are any RDS instances publicly accessible?"
  • "Search /aws/lambda/my-function logs for errors in the last hour."
  • "List all CloudFormation stacks in eu-west-1 that are in ROLLBACK state."
  • "Describe the trust policy for the EKS node role. Does anything look off?"
  • "What security groups allow inbound SSH from 0.0.0.0/0?"

IAM policy

Minimal read-only policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeInstances",
        "ec2:DescribeRegions",
        "ec2:DescribeSecurityGroups",
        "s3:ListAllMyBuckets",
        "s3:GetBucketLocation",
        "s3:GetBucketPolicy",
        "iam:ListUsers",
        "iam:ListRoles",
        "iam:GetRole",
        "iam:ListAttachedRolePolicies",
        "logs:StartQuery",
        "logs:GetQueryResults",
        "cloudwatch:GetMetricStatistics",
        "eks:ListClusters",
        "eks:DescribeCluster",
        "lambda:ListFunctions",
        "ce:GetCostAndUsage",
        "cloudformation:ListStacks",
        "cloudformation:DescribeStacks",
        "rds:DescribeDBInstances",
        "sts:GetCallerIdentity"
      ],
      "Resource": "*"
    }
  ]
}

Development

# Install dev dependencies
make install

# Run tests
make test

# Format and lint
make fmt
make lint

# Type check
make typecheck

# Run the server locally
make run
make run-with-writes

Tests use moto for AWS mocking - no real AWS account needed.


Roadmap

Features worth adding:

  • Secrets Manager: read secret metadata (not values) and rotation status
  • KMS: list keys, key policies, key rotation status
  • Route 53: list hosted zones and records
  • VPC: describe VPCs, subnets, route tables
  • SSM Parameter Store: read parameters by path (non-SecureString only)
  • ECS: list clusters, services, tasks
  • ECR: list repositories and image tags
  • Step Functions: list and describe state machines
  • SNS/SQS: list topics/queues, queue depth
  • Config: query AWS Config rules and compliance state
  • Trusted Advisor: read advisor findings
  • Multi-account: assume-role support for querying member accounts in an org

Related Projects

  • agents-platform - an AI agent orchestration platform that can consume MCP servers like this one to give agents tool access to infrastructure without granting them broad shell permissions.
  • terraform-aws-modules - includes an iam-roles module that can provision the read-only IAM role this server needs, with permission boundaries and the right trust policy already wired in.
  • k8s-ai-operator - exposes Bedrock models as cluster resources; complements this server's read-only AWS access for in-cluster agent workflows.
  • bedrock-cli - a terminal client for Bedrock Knowledge Bases, Agents, and Guardrails when you want a CLI instead of an MCP transport.

License

MIT. See LICENSE.

Ver o original no GitHub

Bom para

Relacionados