# How to Set Up AWS MCP Server Authentication with Claude Code, Codex, and Cursor

> Learn to set up AWS MCP Server authentication using Claude Code, Codex, and Cursor. Configure your .mcp.json file and provide AWS credentials for secure access. Master AWS authentication today.

- Repository: [Amazon Web Services/agent-toolkit-for-aws](https://github.com/aws/agent-toolkit-for-aws)
- Tags: how-to-guide
- Published: 2026-06-26

---

**To enable AWS MCP Server authentication with Claude Code, Codex, and Cursor, remove the `--skip-auth` flag from the [`plugins/aws-core/.mcp.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/plugins/aws-core/.mcp.json) configuration file and provide valid AWS credentials via environment variables, shared credential files, or IAM roles.**

The AWS Agent Toolkit (`aws/agent-toolkit-for-aws`) ships with a pre-configured MCP (Model Context Protocol) server that enables AI agents to invoke AWS services. By default, authentication is disabled using the `--skip-auth` flag to allow immediate testing. For production use, you must explicitly enable credential-based authentication to secure API calls and enable CloudTrail logging.

## Understanding the Default Authentication Bypass

The `aws-core` plugin disables authentication out-of-the-box. In [`plugins/aws-core/.mcp.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/plugins/aws-core/.mcp.json), the MCP server definition includes the `--skip-auth` argument in the command array, which prevents the proxy from validating AWS credentials.

When you remove this flag, the MCP server enforces standard AWS credential resolution, checking for IAM roles, environment variables, or the shared credentials file (`~/.aws/credentials`) according to the standard AWS SDK credential provider chain.

## Prerequisites for AWS MCP Server Authentication

Before enabling authentication, ensure your environment meets these requirements:

- **AWS credentials configured** via one of the following methods:
  - Environment variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and optionally `AWS_SESSION_TOKEN`
  - Shared credentials file: `~/.aws/credentials` (configured via `aws configure`)
  - IAM instance profile (for EC2) or task role (for ECS)
- **UV package manager** installed to run the `uvx` command specified in the MCP configuration
- **Plugin installed** for your specific agent (Claude Code, Codex, or Cursor)

## Agent-Specific Configuration Steps

Each AI agent discovers and loads the AWS MCP server differently. Configure authentication after installing the plugin according to your environment.

### Claude Code

Claude Code discovers plugins from the Anthropic marketplace. After installation, the agent reads the MCP configuration to determine how to invoke the AWS proxy.

1. Install the plugin using the Anthropic marketplace command:
   
   ```text
   /plugin install aws-core@claude-plugins-official
   ```

2. Edit [`plugins/aws-core/.mcp.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/plugins/aws-core/.mcp.json) to remove the `--skip-auth` flag from the args array.

3. Reload plugins to apply changes:
   
   ```text
   /reload-plugins
   ```

Claude Code automatically inherits credentials from your local AWS configuration or attached IAM role.

### Codex (OpenAI)

Codex loads plugins from a personal marketplace. The authentication setup follows the same pattern as Claude Code but uses Codex-specific CLI commands.

1. Add the repository to your personal marketplace:
   
   ```bash
   codex plugin marketplace add aws/agent-toolkit-for-aws
   ```

2. Install the `aws-core` plugin:
   
   ```bash
   codex plugins install aws-core
   ```

3. Modify [`plugins/aws-core/.mcp.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/plugins/aws-core/.mcp.json) to delete the `--skip-auth` entry.

4. Restart Codex or reload the plugin list to pick up the authenticated MCP configuration.

Codex uses the same credential sources as the AWS CLI, checking `~/.aws/credentials` and environment variables.

### Cursor

Cursor imports the repository as a team marketplace, automatically detecting the plugin via the [`.cursor-plugin/marketplace.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/.cursor-plugin/marketplace.json) file.

1. Import the repository via the UI:
   - Navigate to **Settings → Plugins → Team Marketplaces → Add Marketplace → Import from Repo**
   - Enter `aws/agent-toolkit-for-aws`

2. Install the `aws-core` plugin from the Plugins panel.

3. Update [`plugins/aws-core/.mcp.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/plugins/aws-core/.mcp.json) to remove the `--skip-auth` flag.

4. Restart Cursor to reload the MCP server with authentication enabled.

## Step-by-Step Authentication Enablement

Follow this sequence to activate secure authentication across any agent:

1. **Locate the MCP definition** at [`plugins/aws-core/.mcp.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/plugins/aws-core/.mcp.json) in your installation directory.

2. **Remove the authentication bypass** by deleting `"--skip-auth"` from the args array.

3. **Verify the proxy version** (optional but recommended). Pin to a specific version like `mcp-proxy-for-aws@1.6.3` for reproducible builds.

4. **Export credentials** or ensure your IAM role is attached:
   
   ```bash
   export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
   export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
   export AWS_SESSION_TOKEN=IQoJb3JpZ2luX2IQoJb3JpZ2luX2IQoJb3JpZ2luX2IQoJb3JpZ2luX2IQoJb3JpZ2luX2I
   ```

5. **Restart the agent** to reload the MCP configuration.

Once configured, the MCP server authenticates each request using the provided credentials, enabling full API logging to CloudWatch and CloudTrail as implemented in `aws/agent-toolkit-for-aws`.

## Configuration Code Examples

### Editing the MCP Server Definition

Update [`plugins/aws-core/.mcp.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/plugins/aws-core/.mcp.json) to enable authentication:

```json
{
  "mcpServers": {
    "aws-mcp": {
      "command": "uvx",
      "args": [
        "mcp-proxy-for-aws@1.6.3",
        "https://aws-mcp.us-east-1.api.aws/mcp",
        "--metadata",
        "INSTALL_SOURCE=agent-toolkit"
      ]
    }
  }
}

```

Note the absence of `--skip-auth` in the args array.

### Environment Variables for Local Development

Set temporary credentials in your shell before launching the agent:

```bash
export AWS_ACCESS_KEY_ID=AKIA************
export AWS_SECRET_ACCESS_KEY=***************
export AWS_SESSION_TOKEN=IQo************   # Required for temporary credentials

```

### Cursor Marketplace Import Configuration

The repository registers plugins via [`.cursor-plugin/marketplace.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/.cursor-plugin/marketplace.json), which Cursor reads when importing `aws/agent-toolkit-for-aws` as a team marketplace. After import, you must still manually edit the MCP configuration files to remove `--skip-auth`.

## Summary

- **Remove `--skip-auth`** from [`plugins/aws-core/.mcp.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/plugins/aws-core/.mcp.json) to enforce credential validation.
- **Provide AWS credentials** via environment variables, `~/.aws/credentials`, or IAM roles before starting your agent.
- **Claude Code** installs via `/plugin install aws-core@claude-plugins-official` and supports `/reload-plugins`.
- **Codex** uses `codex plugin marketplace add` and `codex plugins install` commands.
- **Cursor** imports the repository as a team marketplace using [`.cursor-plugin/marketplace.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/.cursor-plugin/marketplace.json).
- **Restart the agent** after configuration changes to load the authenticated MCP server.
- **CloudTrail integration** activates automatically once authentication is enabled, providing enterprise-grade auditability.

## Frequently Asked Questions

### Where is the MCP server configuration file located?

The MCP server configuration resides at [`plugins/aws-core/.mcp.json`](https://github.com/aws/agent-toolkit-for-aws/blob/main/plugins/aws-core/.mcp.json) within the `aws/agent-toolkit-for-aws` repository. This file defines the `uvx` command and arguments used to launch the proxy, including the `--skip-auth` flag that must be removed to enable authentication.

### Can I use IAM roles instead of access keys for authentication?

Yes. The MCP server uses the standard AWS SDK credential provider chain. If running on EC2 or ECS, attach an IAM instance profile or task role, and the MCP server will automatically assume those permissions without requiring explicit access keys in environment variables.

### What happens if I keep the `--skip-auth` flag enabled?

Leaving `--skip-auth` in the MCP configuration allows the agent to call AWS APIs without credential validation. This mode is intended only for testing and disables CloudTrail logging and enterprise access controls, creating a security risk in production environments.

### How do I verify that authentication is working correctly?

After removing `--skip-auth` and restarting the agent, attempt an AWS API call through the MCP server. If credentials are missing or invalid, the request will fail with an authentication error. Successful authenticated requests appear in your CloudTrail event history with the identity of the principal making the call.