How to Set Up AWS MCP Server Authentication with Claude Code, Codex, and Cursor
To enable AWS MCP Server authentication with Claude Code, Codex, and Cursor, remove the --skip-auth flag from the 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, 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 optionallyAWS_SESSION_TOKEN - Shared credentials file:
~/.aws/credentials(configured viaaws configure) - IAM instance profile (for EC2) or task role (for ECS)
- Environment variables:
- UV package manager installed to run the
uvxcommand 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.
-
Install the plugin using the Anthropic marketplace command:
/plugin install aws-core@claude-plugins-official -
Edit
plugins/aws-core/.mcp.jsonto remove the--skip-authflag from the args array. -
Reload plugins to apply changes:
/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.
-
Add the repository to your personal marketplace:
codex plugin marketplace add aws/agent-toolkit-for-aws -
Install the
aws-coreplugin:codex plugins install aws-core -
Modify
plugins/aws-core/.mcp.jsonto delete the--skip-authentry. -
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 file.
-
Import the repository via the UI:
- Navigate to Settings → Plugins → Team Marketplaces → Add Marketplace → Import from Repo
- Enter
aws/agent-toolkit-for-aws
-
Install the
aws-coreplugin from the Plugins panel. -
Update
plugins/aws-core/.mcp.jsonto remove the--skip-authflag. -
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:
-
Locate the MCP definition at
plugins/aws-core/.mcp.jsonin your installation directory. -
Remove the authentication bypass by deleting
"--skip-auth"from the args array. -
Verify the proxy version (optional but recommended). Pin to a specific version like
mcp-proxy-for-aws@1.6.3for reproducible builds. -
Export credentials or ensure your IAM role is attached:
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY export AWS_SESSION_TOKEN=IQoJb3JpZ2luX2IQoJb3JpZ2luX2IQoJb3JpZ2luX2IQoJb3JpZ2luX2IQoJb3JpZ2luX2I -
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 to enable authentication:
{
"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:
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, 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-authfromplugins/aws-core/.mcp.jsonto 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-officialand supports/reload-plugins. - Codex uses
codex plugin marketplace addandcodex plugins installcommands. - Cursor imports the repository as a team marketplace using
.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 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.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →