# AWS MCP server security: what it can access and how to limit it

> The AWS MCP Server runs API calls with your IAM credentials. See its tools, the aws:ViaAWSMCPService key, and how to limit it in Claude Code and Codex.

The AWS MCP Server is a managed remote server run by AWS, generally available in US East (N. Virginia) and Europe (Frankfurt). Its `call_aws` tool can execute any of the 15,000+ AWS API operations with your existing IAM credentials, so the server can do whatever those credentials can do. Limit it with IAM, using the `aws:ViaAWSMCPService` context key, and not only with agent settings.

## Who runs it and how you sign in

AWS maintains it as part of the Agent Toolkit for AWS. It uses IAM and SigV4 authentication. MCP clients speak OAuth, so AWS ships an open source proxy, [mcp-proxy-for-aws](https://github.com/aws/mcp-proxy-for-aws), that runs on your Mac and signs requests with your local AWS credentials. AWS’s own Claude Code example is:

```bash
claude mcp add-json aws-mcp --scope user '{"command":"uvx","args":["mcp-proxy-for-aws==1.6.0","https://aws-mcp.us-east-1.api.aws/mcp","--metadata","AWS_REGION=us-west-2"]}'
```

Check the proxy repository for the current version. The pinned version in AWS’s post was 1.6.0 when written. There is no extra charge for the server.

## What the tools can do

| Tool | What it does |
| --- | --- |
| `call_aws` | Runs AWS API operations using your IAM credentials |
| `search_documentation`, `read_documentation` | Fetch AWS documentation. These no longer need authentication |
| `run_script` | Runs a short Python script server-side in a sandbox that inherits your IAM permissions and has no network access |

AWS’s demo shows the tool names carrying an `aws___` prefix, as in `aws___search_documentation`. Run `/mcp` in Claude Code to see the exact names, then write rules from them. Reads, writes and deletes are all one tool, `call_aws`, so a rule on the tool name cannot separate them.

## Where the limit belongs

AWS’s docs say the server uses your credentials, so you need the same permissions as for a direct API call. The `aws-mcp:InvokeMcp`, `aws-mcp:CallReadOnlyTool` and `aws-mcp:CallReadWriteTool` actions no longer have any effect, including in Deny statements. Use these two context keys instead.

| Key | Type | Meaning |
| --- | --- | --- |
| `aws:ViaAWSMCPService` | Boolean | `true` when the request came through an AWS-managed MCP server |
| `aws:CalledViaAWSMCP` | String | Service principal of the MCP server, such as `aws-mcp.amazonaws.com` |

A policy from AWS’s security blog allows S3 reads and denies deletes when the call came through MCP.

```json
{
  "Effect": "Deny",
  "Action": ["s3:DeleteObject", "s3:DeleteBucket"],
  "Resource": "*",
  "Condition": { "Bool": { "aws:ViaAWSMCPService": "true" } }
}
```

An organization can deny `"Action": "*"` under the same condition in a service control policy to switch MCP access off. AWS says you can set IAM or SCP policies so a user can mutate while the MCP server is read-only.

## Risks

- A broad role plus `call_aws` gives the model an API client for your account.
- Documentation and API responses are text the model reads, and resource names and tags can carry instructions.
- Use a role made for agent work, with temporary credentials, in a sandbox account if you can.

## Limit it in Claude Code and Codex

Allow tools you trust and ask on the rest. Because one tool does everything, `ask` is the useful setting.

```json
{
  "permissions": {
    "ask": ["mcp__aws-mcp__*"]
  }
}
```

Codex runs the same proxy as a stdio server. The Codex keys below come from OpenAI’s docs, and the arguments from AWS’s example.

```toml
[mcp_servers.aws-mcp]
command = "uvx"
args = ["mcp-proxy-for-aws==1.6.0", "https://aws-mcp.us-east-1.api.aws/mcp", "--metadata", "AWS_REGION=us-west-2"]
default_tools_approval_mode = "prompt"
```

AWS’s older open source servers in [awslabs/mcp](https://github.com/awslabs/mcp) are separate, stdio only, and some install configs there set `--allow-write` and `--allow-sensitive-data-access`. Review those flags.

## Checklist

1. Run it under a role with the least permissions the task needs.
2. Add an IAM Deny on `aws:ViaAWSMCPService` for deletes and IAM changes.
3. Watch CloudTrail, and the CloudWatch metrics AWS publishes under the `AWS-MCP` namespace.
4. Ask before every call in the agent.
5. Read the [MCP security hub](https://www.excellent.so/guides/mcp-server-security) and [Keeping keys out of agent logs](https://www.excellent.so/guides/keep-keys-and-email-out-of-agent-logs).

Checked against the vendor documentation on November 25, 2026. [AWS MCP Server GA post](https://aws.amazon.com/blogs/aws/the-aws-mcp-server-is-now-generally-available/) · [IAM for managed AWS MCP servers](https://aws.amazon.com/blogs/security/understanding-iam-for-managed-aws-mcp-servers/) · [AWS MCP IAM troubleshooting](https://docs.aws.amazon.com/agent-toolkit/latest/userguide/security_iam_troubleshoot.html) · [awslabs/mcp](https://github.com/awslabs/mcp)

## What Excellent covers

Excellent does not inspect MCP servers themselves. Its free scan reads supported logs on the Mac and reports findings for review. It reads the session logs of Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code, so it can show what an agent did after it called a tool. It does not read Cursor’s, OpenClaw’s or Claude Cowork’s logs. For a local report without installing an app, [run the free scan](https://www.excellent.so/scan). Its script uses Python 3.9 or later when your Mac has it and the shell when it doesn’t, reads the logs locally and makes no network requests. [See a sample report](https://www.excellent.so/r/sample).

Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Commands sent into an already running Codex shell fall outside that check. [Agent coverage](https://www.excellent.so/agents) · [Pricing](https://www.excellent.so/pricing). Pro is US-only for now.

Source: https://www.excellent.so/guides/aws-mcp-server
