AWS Builder Center
How to connect your coding agent to AWS

How to connect your coding agent to AWS

Connect your AI coding agent to your AWS project with the Agent Toolkit for AWS, so it can check the current AWS docs and help you build cloud projects.

Series: Build your website on AWS (4 articles)

  1. 2
    How to connect your coding agent to AWS This article
Developer Advocate @ AWS
A coding agent can write code and create files on your computer. What it can't do by itself is work in your AWS project or know what has changed in AWS services since its model was trained.
In this guide we'll connect your agent to your AWS project with the  Agent Toolkit for AWS . It works with the agent you already use, like Claude Code, Codex, Kiro, or Cursor. At the end, we'll check that the connection works without creating anything in your project.
You'll need a coding agent installed on your computer and an AWS account with a project. If you don't have an account yet,  create one and your first project .

Create a folder for your project

The code you build lives in a folder on your computer, and your agent works inside it. Create a folder for what you're building and open it in your agent. We'll call ours  portfolio , but use your project's name. If you already have code for your project, open that folder instead.
If your agent runs in the terminal, like Claude Code, create the folder, go into it, and start the agent from there:
Bash
mkdir portfolio
cd portfolio
We open the folder first because part of the setup is saved in it. The rest, your AWS sign-in, the connection to AWS, and the skills, is installed for your user on this computer, so it works in any folder you open later.

Copy the setup prompt

Sign in to the  AWS Console  and make sure your project's name shows in the upper right corner. At the top of Console Home, choose Copy agent prompt.
Console Home with the Copy agent prompt button

AWS generates the prompt for your project, so it already includes your project's Region. Use the one from your own console.
Setup Agent Toolkit for AWS dialog with the copied prompt and the steps your agent will follow


What the prompt sets up

Before you paste it, here's what the prompt adds to your agent:
  • Sign-in from your browser. The agent runs   aws login  , which opens your browser so you can sign in to AWS. Your agent then gets temporary access to your project, and you don't have to create or save access keys.
  • The AWS MCP Server. Model Context Protocol (MCP) is how a coding agent gets extra tools. The  AWS MCP Server  adds tools to search the current AWS documentation and to make AWS calls for you, with the same permissions you have when you sign in.
  • Skills. Instructions for specific AWS tasks, like building a serverless app ( aws-serverless ), writing infrastructure as code ( aws-cdk ), or setting up permissions ( aws-iam ). Your agent loads a skill when what you ask matches it. AWS adds skills over time, so your list might look different.
  • A rule for this folder. A file in your project folder that tells the agent how AWS projects work, for example, that it should only create resources in your project's Region. If you're curious, you can read the  full rule .
The setup does this for every coding agent it finds on your computer, so if you use more than one, they all get connected.

Connect your agent

Paste the prompt into your agent's chat. If your agent runs in the terminal, paste it into the agent, not into the regular shell.
Setup prompt pasted into the coding agent

The agent runs most of the setup on its own, but it might ask your permission before running a command. Read what the command does before you allow it. It also stops when it needs something from you:
  • A profile name. A profile is the name your AWS sign-in is saved under on your computer. The agent suggests one named after your project, like  portfolio .
  • Missing tools. If the AWS CLI or other tools the setup needs aren't installed, the agent installs them.
  • Signing in. Your browser opens AWS sign-in. Since you're already signed in to the console, choose your project under Active sessions, then go back to your agent.
Agent asking which profile name to use, with portfolio suggested

Choose AWS sessions page with the Portfolio project under Active sessions

When the agent says setup is complete, review what it has done, close the conversation, and start a new one so it loads the new connection and skills. If your agent runs in the terminal, exit it and start it again from the same folder.
Agent message confirming setup is complete


Check the connection

Start a new conversation in the same folder and paste this prompt:
Check that the AWS MCP Server is connected and that I'm signed in to AWS. Confirm the Region configured for this project. Do not create or change any AWS resources.
The response should confirm that the AWS MCP Server is connected, that you're signed in, and your project's Region.
At the end, the agent asks how much guidance you want while you build: low, medium, or high. If you're new to AWS, high is a good place to start, since the agent explains what it's doing as it goes.
Agent response confirming the AWS MCP Server connection, sign-in, and Region

Your sign-in lasts up to 12 hours. After that, run  aws login --profile  with your profile name again, or ask your agent to sign you in.

Keep your skills up to date

The AWS MCP Server runs on AWS, so you don't need to update it. Skills are saved on your computer, and AWS updates them as services change. To get the latest version of every skill you have installed, run:
Bash
aws agent-toolkit update-skill --all

What you did

Your coding agent is now connected to your AWS project. When you ask it to build something, it checks the current AWS docs and skills before it recommends an approach, so you're not working from what the model remembers. And when something in your project isn't working, it can look at your resources and logs and help you figure out why.

Series: Build your website on AWS (4 articles)

  1. 2
    How to connect your coding agent to AWS This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article