

# Setting up the AWS MCP Server

If you already have an AWS account, skip to [Set up the AWS MCP Server](#mcp-set-up-process). If you are new to AWS, [sign up for an AWS account](https://portal.aws.amazon.com/billing/signup) and then continue with the setup process.

## Set up the AWS MCP Server
<a name="mcp-set-up-process"></a>

AWS MCP Server supports two authentication methods. The following describes both options, followed by a decision guide to help you choose.
+ **Option A: OAuth (simple)** — Connect to AWS MCP Server using OAuth. If you are a human user, you authenticate in your browser. If you are running an automated agent, it authenticates by requesting a token. Works for web clients (such as Claude.ai and ChatGPT.com) and most IDE, terminal, or desktop-based clients. Use this option if you are new to AWS and use a single account, or if you interact through web clients.
+ **Option B: SigV4 (advanced)** — Authenticate using the AWS CLI, then use the MCP Proxy for AWS to sign requests with SigV4 credentials. Use this option if you use terminal or IDE-based coding agents (such as Claude Code, Kiro, and Codex), or if you need to switch between AWS accounts frequently.

### Choosing an authentication method
<a name="choosing-auth-method"></a>

Use the following questions to determine which authentication method fits your use case:


**Authentication method decision guide**  

| Question | Use | 
| --- | --- | 
| Do you want to get started without installing uvx, installing the AWS CLI, or configuring local credentials? | OAuth | 
| Does your client only support remote MCP servers (no local process)? | OAuth | 
| Does your agent need access across multiple AWS accounts in the same session? | SigV4 | 
| Do you need read-only mode (hide write-capable tools from the agent entirely)? | SigV4 | 
| Does your organization restrict the signin:AuthorizeOAuth2Access and signin:CreateOAuth2Token permissions needed for browser-based OAuth login? | SigV4 | 
| Do you need to set a default AWS Region for your agentic session (without specifying it in every query)? | SigV4 | 
| Does your client not support the OAuth flow but can run a local MCP proxy? | SigV4 | 

**Topics**
+ [Choosing an authentication method](#choosing-auth-method)
+ [Step 1: (If applicable) Remove conflicting MCP servers](#step-1-remove-conflicting-servers)
+ [Step 2: Configure authentication and connect](#step-2-choose-auth-method)
+ [Step 3: Test your connection](#step-3-test-connection)

### Step 1: (If applicable) Remove conflicting MCP servers
<a name="step-1-remove-conflicting-servers"></a>

If you are currently using the AWS API MCP Server or AWS Knowledge MCP Server, we recommend switching to the AWS MCP Server. The AWS MCP Server is a managed remote MCP server that reduces setup and maintenance effort and offers enhanced security controls through IAM condition keys.

To switch, remove the older servers from your MCP client configuration to avoid tool conflicts that can confuse AI agents and reduce performance.

**To remove existing AWS MCP servers:**  


1. Open your MCP client configuration file (for example, `~/.kiro/settings/mcp.json` for Kiro).

1. Remove any entries for these servers:
   + `aws-api-mcp-server`
   + `aws-knowledge-mcp-server`

1. Save the configuration file.

1. Restart your MCP client to apply the changes.

### Step 2: Configure authentication and connect
<a name="step-2-choose-auth-method"></a>

AWS MCP Server supports the following AWS Regions:
+ US East (N. Virginia) – `us-east-1`: `https://aws-mcp.us-east-1.api.aws/mcp`
+ US West (Oregon) – `us-west-2`: `https://aws-mcp.us-west-2.api.aws/mcp`
+ Asia Pacific (Singapore) – `ap-southeast-1`: `https://aws-mcp.ap-southeast-1.api.aws/mcp`
+ Asia Pacific (Sydney) – `ap-southeast-2`: `https://aws-mcp.ap-southeast-2.api.aws/mcp`
+ Asia Pacific (Tokyo) – `ap-northeast-1`: `https://aws-mcp.ap-northeast-1.api.aws/mcp`
+ Europe (Frankfurt) – `eu-central-1`: `https://aws-mcp.eu-central-1.api.aws/mcp`
+ Europe (Ireland) – `eu-west-1`: `https://aws-mcp.eu-west-1.api.aws/mcp`
+ Europe (London) – `eu-west-2`: `https://aws-mcp.eu-west-2.api.aws/mcp`

The setup examples in this section use the `us-east-1` endpoint. To connect to a different AWS Region, substitute that Region in the endpoint URL (for example, `https://aws-mcp.eu-west-1.api.aws/mcp`).

------
#### [ Option A: OAuth (simple) ]

With OAuth, you can connect directly to AWS MCP Server without installing or running local proxy software. Your MCP client handles the OAuth flow automatically.

**Prerequisites**  


1. Grant OAuth permissions to your IAM role or user by attaching the managed policy:

   ```bash
   aws iam attach-role-policy \
     --role-name MyRole \
     --policy-arn arn:aws:iam::aws:policy/AWSMCPSignInOAuthAccessPolicy
   ```

**Configure your MCP client**  


The following clients fully support OAuth with the default endpoint URL:

Claude Code CLI  

```bash
claude mcp add aws-mcp https://aws-mcp.us-east-1.api.aws/mcp --transport http
```

Claude Code for Web  
Add the URL `https://aws-mcp.us-east-1.api.aws/mcp` in your web client MCP settings.

Kiro CLI (2.11 or later)  

```bash
kiro-cli mcp add --name aws-mcp --url https://aws-mcp.us-east-1.api.aws/mcp
```

Devin Desktop  
Add as a remote MCP server with URL: `https://aws-mcp.us-east-1.api.aws/mcp`

Devin CLI  

```bash
devin mcp add -s user aws-mcp https://aws-mcp.us-east-1.api.aws/mcp
```

The following clients support OAuth when you append `?oauth=initialize` to the endpoint URL:

Claude Desktop  
Add as a remote MCP server with URL: `https://aws-mcp.us-east-1.api.aws/mcp?oauth=initialize`

Cursor  
Add as a remote MCP server with URL: `https://aws-mcp.us-east-1.api.aws/mcp?oauth=initialize`

Kiro IDE  
Add as a remote MCP server with URL: `https://aws-mcp.us-east-1.api.aws/mcp?oauth=initialize`

Visual Studio Code  
Add the server to `.vscode/mcp.json` in your workspace, or run *MCP: Open User Configuration* from the Command Palette to configure it for every workspace. Visual Studio Code uses a `servers` top-level key rather than `mcpServers`:  

```json
{
  "servers": {
    "aws-mcp": {
      "type": "http",
      "url": "https://aws-mcp.us-east-1.api.aws/mcp?oauth=initialize"
    }
  }
}
```

Gemini CLI  

```bash
gemini mcp add aws-mcp https://aws-mcp.us-east-1.api.aws/mcp?oauth=initialize --transport http
```

Codex CLI and Codex Desktop  

```bash
codex mcp add aws-mcp --url https://aws-mcp.us-east-1.api.aws/mcp?oauth=initialize
```

GitHub Copilot CLI  
Add the server to `~/.copilot/mcp-config.json` to configure it for all projects, or to `.github/mcp.json` (or `.mcp.json` at your repository root) to configure it for a single project:  

```json
{
  "mcpServers": {
    "aws-mcp": {
      "type": "http",
      "url": "https://aws-mcp.us-east-1.api.aws/mcp?oauth=initialize",
      "tools": ["*"]
    }
  }
}
```
Run `/mcp` in a Copilot CLI session to confirm that the server is listed. For more information, see [Add MCP servers to Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers) in the GitHub documentation.

When you first invoke a tool, your MCP client opens a browser window to AWS Sign-in. Sign in with your existing credentials and authorize access. After you grant consent, access tokens remain valid for 1 hour. AWS Sign-in automatically refreshes them for up to 12 hours.

If your client is not listed above, use the default endpoint URL (`https://aws-mcp.us-east-1.api.aws/mcp`). Without `?oauth=initialize`, the client relies on MCP OAuth discovery to start the authorization flow automatically. If tool calls fail due to credential errors, append `?oauth=initialize` to the URL to instruct the server to explicitly trigger the OAuth flow.

For detailed OAuth setup, governance options, and token management, see [OAuth 2.1 authentication for AWS MCP Server](oauth-authentication.md).

**Note**  
Multi-profile switching for cross-account workflows is not supported with OAuth. If you need to work with multiple AWS accounts in a single session, use the SigV4 authentication option instead.

------
#### [ Option B: SigV4 (advanced) ]

Use the [MCP Proxy for AWS](https://github.com/aws/mcp-proxy-for-aws) to authenticate requests with [SigV4](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html). With this option, you can switch between multiple profiles for cross-account workflows.

**Prerequisites**  


1. Install the AWS CLI (`2.32.0` or later) by following [ Installing the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

1. Sign in and configure credentials:

   ```bash
   aws login
   ```

   The command auto-rotates credentials every 15 minutes for sessions up to 12 hours.

1. Verify your credentials:

   ```bash
   aws sts get-caller-identity
   ```

1. Install uv (if not already installed):

   ```bash
   # macOS and Linux
   curl -LsSf https://astral.sh/uv/install.sh | sh
   
   # Windows
   powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
   ```

For other credential methods (SSO, IAM access keys, cross-account roles), see [Sign in with the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sign-in.html).

**Configure your MCP client**  


The endpoint Region determines which MCP server you connect to, while the `AWS_REGION` metadata parameter sets the default Region for AWS operations. Without `AWS_REGION`, operations default to `us-east-1`.

Kiro CLI or Kiro IDE  

```json
{
  "mcpServers": {
    "aws-mcp": {
      "command": "uvx",
      "timeout": 100000,
      "transport": "stdio",
      "args": [
        "mcp-proxy-for-aws-cli@latest",
        "https://aws-mcp.us-east-1.api.aws/mcp",
        "--metadata", "AWS_REGION=us-west-2"
      ]
    }
  }
}
```

Cursor IDE, Claude Desktop, or Devin Desktop  

```json
{
  "mcpServers": {
    "aws-mcp": {
      "command": "uvx",
      "args": [
        "mcp-proxy-for-aws-cli@latest",
        "https://aws-mcp.us-east-1.api.aws/mcp",
        "--metadata", "AWS_REGION=us-west-2"
      ]
    }
  }
}
```

Visual Studio Code  
Add the following to `.vscode/mcp.json` in your workspace. Visual Studio Code uses a `servers` top-level key rather than the `mcpServers` key that most other clients use:  

```json
{
  "servers": {
    "aws-mcp": {
      "command": "uvx",
      "args": [
        "mcp-proxy-for-aws-cli@latest",
        "https://aws-mcp.us-east-1.api.aws/mcp",
        "--metadata", "AWS_REGION=us-west-2"
      ]
    }
  }
}
```
You can also run *MCP: Add Server* from the Command Palette and choose the `stdio` server type to create this entry interactively.

Claude Code CLI  

```bash
claude mcp add-json aws-mcp '{"type":"stdio","command":"uvx","args":["mcp-proxy-for-aws-cli@latest","https://aws-mcp.us-east-1.api.aws/mcp","--metadata","AWS_REGION=us-west-2"],"env":{}}'
```

Codex CLI  

```bash
codex mcp add aws-mcp uvx mcp-proxy-for-aws-cli@latest https://aws-mcp.us-east-1.api.aws/mcp --metadata AWS_REGION=us-west-2
```

Devin CLI  

```bash
devin mcp add -s user aws-mcp -- uvx mcp-proxy-for-aws-cli@latest https://aws-mcp.us-east-1.api.aws/mcp --metadata AWS_REGION=us-west-2
```

GitHub Copilot CLI  
Add the following to `~/.copilot/mcp-config.json`. Copilot CLI uses the `mcpServers` key, and identifies a locally run server with `"type": "local"`:  

```json
{
  "mcpServers": {
    "aws-mcp": {
      "type": "local",
      "command": "uvx",
      "args": [
        "mcp-proxy-for-aws-cli@latest",
        "https://aws-mcp.us-east-1.api.aws/mcp",
        "--metadata", "AWS_REGION=us-west-2"
      ],
      "tools": ["*"]
    }
  }
}
```
The `tools` field lists which of the server's tools Copilot CLI can call. Use `["*"]` to allow all of them.

**Tip**  
To work with multiple AWS accounts in a single session, configure additional named profiles. See [Multi-profile support](multi-account-access.md) for setup instructions. Multi-profile switching is only available with SigV4 authentication.

------

### Step 3: Test your connection
<a name="step-3-test-connection"></a>

1. Start your MCP client (Kiro CLI, Cursor, Claude Desktop, or a similar client).

1. Wait for the MCP server to initialize (this might take a few minutes on the first connection).

1. Test the connection by asking your AI assistant:

   *Example: What AWS Regions are available?*

1. Verify that tools are loaded by running (in Kiro CLI):

   `/tools`

   Or to see installed MCP servers:

   `/mcp`

You should see tools like `aws___search_documentation` and `aws___retrieve_skill` listed. For more information about the tools, see [Understanding the MCP Server tools](understanding-mcp-server-tools.md).

## Troubleshooting authentication errors
<a name="troubleshooting-auth-errors"></a>

Authentication errors can prevent the MCP server from initializing. When this happens, your AI agent cannot use AWS MCP tools. If your AI agent is not using AWS MCP tools, an expired or missing credential is the most likely cause.

Use the following table to identify and resolve common authentication errors.


**Common authentication errors**  

| Error | Cause | Resolution | 
| --- | --- | --- | 
| ExpiredTokenException: Your AWS session token has expired. | Your temporary AWS credentials have expired. This is the most common authentication error. Short-lived session tokens (default 1 hour) typically expire during development. | Refresh your credentials based on your authentication method:+ `aws login` users: Run `aws login` again to start a new session. Consider switching to this method if you experience frequent expiry, because it auto-rotates credentials every 15 minutes.<br />+ SSO users: Run `aws sso login --profile your-profile-name` to refresh your SSO session.<br />+ Assume-role users: Refresh the source profile credentials. The SDK then automatically re-assumes the role.<br />After refreshing, restart your MCP client to re-initialize the server. | 
| UnrecognizedClientException: The security token included in the request is not recognized. | Your credentials are invalid. This can happen when credentials have been revoked, are from a different AWS partition, are malformed, or belong to a deleted IAM user or role. | Verify your credentials are valid:1. Run `aws sts get-caller-identity` to check if your credentials are recognized.<br />2. If the command fails, reconfigure your credentials using `aws login` or `aws configure sso`.<br />3. Ensure you are using credentials for the correct AWS partition (for example, `aws` vs. `aws-cn`). | 
| InvalidSignatureException: The request signature we calculated does not match the signature you provided. | The SigV4 signature does not match. Common causes include credentials scoped to the wrong service or Region, clock skew on your machine, or a request body modified after signing. | Try the following steps:1. Verify your system clock is accurate. Run `date` and compare with an authoritative time source. SigV4 requires your clock to be within 5 minutes of AWS servers.<br />2. Ensure your credentials are configured for the correct AWS Region and service.<br />3. Reconfigure your credentials and restart your MCP client. | 
| 400 error page after OAuth sign-in | Your IAM principal does not have the required OAuth permissions (signin:AuthorizeOAuth2Access and signin:CreateOAuth2Token). | Attach the `AWSMCPSignInOAuthAccessPolicy` managed policy to your IAM role or user:<pre>aws iam attach-role-policy \<br />  --role-name MyRole \<br />  --policy-arn arn:aws:iam::aws:policy/AWSMCPSignInOAuthAccessPolicy</pre><br />For more information, see [AWS managed policies for AWS MCP Server](security-iam-awsmanpol.md). | 
| `No AWS credentials available. Configure credentials or use --skip-auth to send unsigned requests.`<br />Your MCP client might show this message with the error code `JSON-RPC error: -32603`. | The MCP Proxy for AWS could not find AWS credentials when your MCP client started it, so the server could not initialize. Either you have not configured credentials for your default profile, or your MCP configuration does not pass --profile or set AWS\_PROFILE for the profile that has your credentials. | Make credentials available to the proxy, and then restart your MCP client:1. Sign in. Run `aws login`, or for SSO, run `aws sso login --profile your-profile-name`. For setup instructions, see [Step 2: Configure authentication and connect](#step-2-choose-auth-method).<br />2. If your credentials are in a named profile instead of the default profile (for example, after `aws sso login --profile your-profile-name`), also point the proxy at that profile. Signing in again does not fix the error until you do. In the server `args`, add `--profile your-profile-name` after the endpoint URL, or set `AWS_PROFILE` in the server `env`. If you signed in with `aws login` to your default profile, skip this step.<br />If you only need to search documentation and discover skills, you can instead add `--skip-auth` to the server `args`. This flag makes the proxy send requests unsigned when no AWS credentials are found, instead of failing at startup. The proxy still signs requests when credentials are available. Without credentials, only features that don't require authentication work, such as documentation search and skills. Tools that call AWS APIs in your account require credentials. | 

**Note**  
To learn more about how AWS IAM authorizes AWS MCP Server requests, including how to use IAM condition context keys to restrict agent actions, see [Understanding IAM for managed AWS MCP servers](https://aws.amazon.com/blogs/security/understanding-iam-for-managed-aws-mcp-servers/) on the AWS Security Blog.