Skip to content
Back to search

iam-policy-autopilot

IAM Policy Autopilot is an open source static code analysis tool that helps you quickly create baseline AWS IAM policies that you can refine as your application evolves. This tool is available as a command-line utility and MCP server for use within AI coding assistants for quickly building IAM policies.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/awslabs/iam-policy-autopilot with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/awslabs/iam-policy-autopilot'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/awslabs--iam-policy-autopilot/badge.svg)](/listings/awslabs--iam-policy-autopilot)

HTML

<a href="/listings/awslabs--iam-policy-autopilot"><img src="/api/listings/awslabs--iam-policy-autopilot/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

Installation

Option 1: Using uv (Recommended)

Install [uv](https://docs.astral.sh/uv/getting-started/installation/) from Astral.

No additional installation needed - you can run IAM Policy Autopilot directly using `uvx iam-policy-autopilot`.

Option 2: Using pip

Install [pip](https://pip.pypa.io/en/stable/installation/).

pip install iam-policy-autopilot

Option 3: Direct installation (MacOS/Linux only)

To install the latest release directly, run the following script to download and install as a system utility.

curl -sSL https://github.com/awslabs/iam-policy-autopilot/raw/refs/heads/main/install.sh | sudo sh

This will install the latest release directly to `/usr/local/bin/iam-policy-autopilot`.

AWS Configuration

IAM Policy Autopilot requires AWS credentials to apply policy fixes and upload policies for AccessDenied debugging.

Install [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) and configure your AWS credentials.

For more information on AWS credential configuration, see the [AWS CLI Configuration Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html).

MCP Server Configuration

Configure the MCP server in your MCP client configuration to enable your AI coding assistant to generate IAM policies.

For Kiro

Get Kiro from [https://kiro.dev/](https://kiro.dev/)

**If using uv/uvx:**

Add the following configuration to your project-level `.kiro/settings/mcp.json`:

{
  "mcpServers": {
    "iam-policy-autopilot": {
      "command": "uvx",
      "args": ["iam-policy-autopilot", "mcp-server"],
      "env": {
        "AWS_PROFILE": "your-profile-name",
        "AWS_REGION": "us-east-1"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

**If using pip:**

{
  "mcpServers": {
    "iam-policy-autopilot": {
      "command": "iam-policy-autopilot",
      "args": ["mcp-server"],
      "env": {
        "AWS_PROFILE": "your-profile-name",
        "AWS_REGION": "us-east-1"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

For Kiro CLI

Get Kiro CLI from [https://kiro.dev/cli](https://kiro.dev/cli)

Kiro Cli uses the same configuration as Kiro mentioned above, additionally, MCPs for Kiro CLI can also be setup via:

**If using uv/uvx:**

kiro-cli mcp add \
  --name iam-policy-autopilot \
  --command "uvx" \
  --args "iam-policy-autopilot","mcp-server"

**If using pip:**

kiro-cli mcp add \
  --name iam-policy-autopilot \
  --command "iam-policy-autopilot" \
  --args "mcp-server"

For Claude Desktop

Add to your Claude Desktop configuration file:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`

**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

**Linux**: `~/.config/Claude/claude_desktop_config.json`

**If using uv/uvx:**

{
  "mcpServers": {
    "iam-policy-autopilot": {
      "command": "uvx",
      "args": ["iam-policy-autopilot", "mcp-server"],
      "env": {
        "AWS_PROFILE": "your-profile-name",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

**If using pip:**

{
  "mcpServers": {
    "iam-policy-autopilot": {
      "command": "iam-policy-autopilot",
      "args": ["mcp-server"],
      "env": {
        "AWS_PROFILE": "your-profile-name",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

Kiro Power Configuration

IAM Policy Autopilot has an associated [Kiro power](https://kiro.dev/blog/introducing-powers/) configuration inside the `power-iam-policy-autopilot` directory. This can be used to install a corresponding Kiro power in your Kiro editor.

Enabling the IAM Policy Autopilot Kiro Power

To enable the IAM Policy Autopilot Kiro Power, first install the `uv` package manager by [following these instructions](https://docs.astral.sh/uv/getting-started/installation/). Then, do the following steps within Kiro:

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 470 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. [![awslabs/iam-policy-autopilot License](https://img.shields.io/badge/license-Apache%202-blue)](https://github.com/awslabs/iam-policy-autopilot/blob/main/LICENSE)
  2. [![GitHub CI Status](https://img.shields.io/github/actions/workflow/status/awslabs/iam-policy-autopilot/build_and_publish.yml?label=CI&logo=GitHub)](https://github.com/awslabs/iam-policy-autopilot/actions/workflows/build_and_publish.yml) [![PyPI - Version](https://img.shields.io/pypi/v/iam-policy-autopilot?logo=Python&logoColor=white)](https://pypi.org/project/iam-policy-autopilot/)
  3. # IAM Policy Autopilot
  4. An open source Model Context Protocol (MCP) server and command-line tool that helps your AI coding assistants quickly create baseline IAM policies that you can refine as your application evolves, so you can build faster. IAM Policy Autopilot analyzes your application code locally to generate identity-based policies for application roles, enabling faster IAM policy creation and reducing access troubleshooting time. IAM Policy Autopilot supports policy generation for applications built in Python, Go, TypeScript, JavaScript, and Java, and can also generate policies from a Terraform plan file in JSON format — see [Supported Languages and SDKs for policy generation](#supported-languages-and-sdks-for-policy-generation).
  5. We want to hear from you. Ask questions or share ideas in [Discussions](https://github.com/awslabs/iam-policy-autopilot/discussions), report bugs through [Issues](https://github.com/awslabs/iam-policy-autopilot/issues), or contribute directly with a [Pull Request](https://github.com/awslabs/iam-policy-autopilot/pulls).
  6. ## Table of Contents
  7. - [Who is IAM Policy Autopilot for?](#who-is-iam-policy-autopilot-for)
  8. - [How is IAM Policy Autopilot helpful?](#how-is-iam-policy-autopilot-helpful)
  9. - [Best Practices and Considerations](#best-practices-and-considerations)
  10. - [Getting Started](#getting-started)
  11. - [Network Requirements](#network-requirements)
  12. - [CLI Usage](#cli-usage)
  13. - [Supported Languages and SDKs for policy generation](#supported-languages-and-sdks-for-policy-generation)
  14. - [Build Instructions](#build-instructions)
  15. - [Workspace Structure](#workspace-structure)
  16. - [Development](#development)
  17. - [Security](#security)
  18. - [License](#license)
  19. ## Who is IAM Policy Autopilot for?
  20. IAM Policy Autopilot is for builders on AWS using AI coding assistants, including developers, product managers, technical experimenters, and business leaders.
  21. ## How is IAM Policy Autopilot helpful?
  22. IAM Policy Autopilot is:
  23. ### Fast
  24. IAM Policy Autopilot accelerates development by generating baseline identity-based IAM policies. Your AI coding assistant can call IAM Policy Autopilot to analyze AWS SDK calls within your application. IAM Policy Autopilot then automatically creates the baseline IAM permissions for your application roles.
  25. ### Reliable
  26. IAM Policy Autopilot's deterministic code analysis helps create reliable and valid IAM policies that reduce policy troubleshooting. By using valid policies created with the MCP server, you reduce time spent on policy-related debugging and accelerate application deployment by avoiding permission-related delays.
  27. ### Up-to-date
  28. IAM Policy Autopilot stays up to date with the latest AWS services and features so that builders and coding assistants have access to the latest AWS IAM permissions knowledge. It helps keep your application role's permissions current with AWS's evolving capabilities.
  29. ## Best Practices and Considerations
  30. ### Review and refine policies generated by IAM Policy Autopilot
  31. IAM Policy Autopilot generates baseline policies to provide a starting point that you can refine as your application matures. Review the generated policies to ensure they align with your security requirements before deploying them. Use the `--explain` feature with action patterns (e.g., `--explain 's3:*'`) to understand which operations led to an action being included in the generated policies.
  32. ### Understand the IAM Policy Autopilot scope
  33. IAM Policy Autopilot produces IAM identity-based policies, but doesn't support resource-based policies such as S3 bucket policies or KMS key policies, Resource Control Policies (RCPs), Service Control Policies (SCPs), and permission boundaries. These are the limitations that you need to keep in mind. For example, if your code calls `s3.getObject(bucketName)` where `bucketName` is determined at runtime, IAM Policy Autopilot currently doesn't predict which bucket will be accessed.
  34. ### Understand the boundary between IAM Policy Autopilot and your coding assistant
  35. IAM Policy Autopilot generates policies with specific actions based on deterministic analysis of your code. When you use the MCP server integration, your AI coding assistant receives this policy and might modify it when creating infrastructure-as-code templates. For example, you might see the assistant add specific resource Amazon Resource Names (ARNs) or include KMS key IDs based on additional context from your code. These changes come from your coding assistant's interpretation of your broader code context, not from the static analysis provided by IAM Policy Autopilot. Always review content generated by your coding assistant before deployment to verify that it meets your security requirements.
  36. ### Use service hints for accurate policies
  37. IAM Policy Autopilot's static analysis may include permissions for AWS services your application doesn't use. This happens when method names in your code match AWS SDK calls from multiple services. For example, a method called `listAccounts()` might generate permissions for both [AWS Organizations](https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListAccounts.html) and [Amazon Chime](https://docs.aws.amazon.com/chime/latest/APIReference/API_ListAccounts.html) services.
  38. **Recommended approach**: Use the `--service-hints` option to specify only the AWS services your application actually uses. This helps IAM Policy Autopilot scope down which SDK calls to analyze, but the final policy may still include actions from other services if they're required by the operations you perform:
  39. ```bash
  40. # More accurate - specify only services you use
  41. iam-policy-autopilot generate-policies ./src/app.py --service-hints s3 iam organizations --pretty
  42. # Less accurate - may include unnecessary permissions
  43. iam-policy-autopilot generate-policies ./src/app.py --pretty
  44. ```
  45. This significantly reduces unnecessary permissions and generates more targeted policies. Note that the final policy may still include actions from services not in your hints if they're required for the operations you perform (e.g., KMS actions for S3 encryption).
  46. **Note**: When using the MCP server integration with AI coding assistants, the assistant is expected to automatically provide appropriate service hints based on your code context. The `--service-hints` option is primarily for CLI usage.
  47. ### Supported Languages and SDKs for policy generation
  48. | Language | SDK |
  49. |---|---|
  50. | Go | [AWS SDK for Go v2](https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/welcome.html) |
  51. | Java | [AWS SDK for Java v2](https://docs.aws.amazon.com/sdk-for-java/v2/) |
  52. | JavaScript | [AWS SDK for JavaScript v3](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/) |
  53. | TypeScript | [AWS SDK for JavaScript v3](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/) |
  54. | Python | [Boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html), [Botocore](https://botocore.amazonaws.com/v1/documentation/api/latest/index.html) |
  55. You can also generate policies from a [Terraform plan](https://developer.hashicorp.com/terraform/cli/commands/plan) file in JSON format, mapping the plan's resource changes to the actions the Terraform AWS provider performs — see [CLI Usage](#cli-usage). Native `.tf` configuration files are not yet supported as a direct input.
  56. ## Getting Started
  57. ### Installation
  58. #### Option 1: Using uv (Recommended)
  59. Install [uv](https://docs.astral.sh/uv/getting-started/installation/) from Astral.
  60. No additional installation needed - you can run IAM Policy Autopilot directly using `uvx iam-policy-autopilot`.
  61. #### Option 2: Using pip
  62. Install [pip](https://pip.pypa.io/en/stable/installation/).
  63. ```bash
  64. pip install iam-policy-autopilot
  65. ```
  66. #### Option 3: Direct installation (MacOS/Linux only)
  67. To install the latest release directly, run the following script to download and install as a system utility.
  68. ```bash
  69. curl -sSL https://github.com/awslabs/iam-policy-autopilot/raw/refs/heads/main/install.sh | sudo sh
  70. ```
  71. This will install the latest release directly to `/usr/local/bin/iam-policy-autopilot`.
  72. ### AWS Configuration
  73. IAM Policy Autopilot requires AWS credentials to apply policy fixes and upload policies for AccessDenied debugging.
  74. Install [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) and configure your AWS credentials.
  75. For more information on AWS credential configuration, see the [AWS CLI Configuration Guide](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html).
  76. ### MCP Server Configuration
  77. Configure the MCP server in your MCP client configuration to enable your AI coding assistant to generate IAM policies.
  78. #### For Kiro
  79. Get Kiro from [https://kiro.dev/](https://kiro.dev/)
  80. **If using uv/uvx:**
  81. Add the following configuration to your project-level `.kiro/settings/mcp.json`:
  82. ```json
  83. {
  84. "mcpServers": {
  85. "iam-policy-autopilot": {
  86. "command": "uvx",
  87. "args": ["iam-policy-autopilot", "mcp-server"],
  88. "env": {
  89. "AWS_PROFILE": "your-profile-name",
  90. "AWS_REGION": "us-east-1"
  91. },
  92. "disabled": false,
  93. "autoApprove": []
  94. }
  95. }
  96. }
  97. ```
  98. **If using pip:**
  99. ```json
  100. {
  101. "mcpServers": {
  102. "iam-policy-autopilot": {
  103. "command": "iam-policy-autopilot",
  104. "args": ["mcp-server"],
  105. "env": {
  106. "AWS_PROFILE": "your-profile-name",
  107. "AWS_REGION": "us-east-1"
  108. },
  109. "disabled": false,
  110. "autoApprove": []
  111. }
  112. }
  113. }
  114. ```
  115. #### For Kiro CLI
  116. Get Kiro CLI from [https://kiro.dev/cli](https://kiro.dev/cli)
  117. Kiro Cli uses the same configuration as Kiro mentioned above, additionally, MCPs for Kiro CLI can also be setup via:
  118. **If using uv/uvx:**
  119. ```
  120. kiro-cli mcp add \
  121. --name iam-policy-autopilot \
  122. --command "uvx" \
  123. --args "iam-policy-autopilot","mcp-server"
  124. ```
  125. **If using pip:**
  126. ```
  127. kiro-cli mcp add \
  128. --name iam-policy-autopilot \
  129. --command "iam-policy-autopilot" \
  130. --args "mcp-server"
  131. ```
  132. #### For Claude Desktop
  133. Add to your Claude Desktop configuration file:
  134. **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
  135. **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
  136. **Linux**: `~/.config/Claude/claude_desktop_config.json`
  137. **If using uv/uvx:**
  138. ```json
  139. {
  140. "mcpServers": {
  141. "iam-policy-autopilot": {
  142. "command": "uvx",
  143. "args": ["iam-policy-autopilot", "mcp-server"],
  144. "env": {
  145. "AWS_PROFILE": "your-profile-name",
  146. "AWS_REGION": "us-east-1"
  147. }
  148. }
  149. }
  150. }
  151. ```
  152. **If using pip:**
  153. ```json
  154. {
  155. "mcpServers": {
  156. "iam-policy-autopilot": {
  157. "command": "iam-policy-autopilot",
  158. "args": ["mcp-server"],
  159. "env": {
  160. "AWS_PROFILE": "your-profile-name",
  161. "AWS_REGION": "us-east-1"
  162. }
  163. }
  164. }
  165. }
  166. ```
  167. ### Kiro Power Configuration
  168. IAM Policy Autopilot has an associated [Kiro power](https://kiro.dev/blog/introducing-powers/) configuration inside the `power-iam-policy-autopilot` directory. This can be used to install a corresponding Kiro power in your Kiro editor.
  169. #### Enabling the IAM Policy Autopilot Kiro Power
  170. To enable the IAM Policy Autopilot Kiro Power, first install the `uv` package manager by [following these instructions](https://docs.astral.sh/uv/getting-started/installation/). Then, do the following steps within Kiro:
  171. 1. Go to the "Powers" menu in the menubar on the left-hand-side.
  172. 2. Click `Add Custom Power` -> `Import power from Github`
  173. 3. In the text prompt that then appears, enter `https://github.com/awslabs/iam-policy-autopilot/tree/main/power-iam-policy-autopilot`.
  174. 4. Kiro should automatically install a new Kiro power called `IAM Policy Autopilot` within your Kiro code editor. This power should be visible in the `Powers` menu.
  175. If the above steps for installing the power from a GitHub repository URL does not work, you can also clone the repository and import the power directly, by doing the following:
  176. 1. Clone the git repository `https://github.com/awslabs/iam-policy-autopilot`, and remember the directory to where you cloned the repo.
  177. 2. Go to the "Powers" menu in the menubar on the left-hand-side.
  178. 3. Click `Add Custom Power` -> `Import power from a folder`
  179. 4. In the text prompt that then appears, select the `power-iam-policy-autopilot` folder in your cloned repository. For instance, if the repository is cloned to `~/workplace/iam-policy-autopilot`, you should select or enter `~/workplace/iam-policy-autopilot/power-iam-policy-autopilot`.
  180. 5. Kiro should automatically install a new Kiro power called `IAM Policy Autopilot` within your Kiro code editor. This power should be visible in the `Powers` menu.
  181. #### Why use IAM Policy Autopilot's Kiro Power?
  182. Kiro powers generally offer [a more refined experience than traditional MCP servers](https://kiro.dev/blog/introducing-powers/) because they enable MCP tools to be loaded more selectively & deliberately, reducing LLM token usage and avoiding LLM context overcrowding.
  183. IAM Policy Autopilot's Kiro power specifically enhances the traditional MCP experience, for multiple reasons:
  184. 1. This Kiro Power provides your LLM agent with **more steering guidance**, offering it more information on the specific use cases and best practices of our MCP tooling.
  185. 2. This Kiro power prompts your LLM agent to give a **tutorial of the MCP tools** offered by IAM Policy Autopilot, allowing you to better understand how our MCP tooling assists your use case.
  186. 3. This Kiro Power provides your LLM agent with **step-by-step onboarding validation**, allowing it to detect any problems with installations and provide remediation steps for those problems.
  187. ## Network Requirements
  188. IAM Policy Autopilot makes HTTPS requests at runtime to the AWS service reference endpoint to fetch up-to-date AWS service metadata used for policy generation. This endpoint must be reachable from the machine running the tool.
  189. ### Corporate networks and proxies
  190. If your network uses a web proxy, set the `HTTPS_PROXY` environment variable:
  191. ```bash
  192. export HTTPS_PROXY=http://proxy.example.com:8080
  193. ```
  194. See the [reqwest proxy documentation](https://docs.rs/reqwest/latest/reqwest/#proxies) for supported proxy URL formats.
  195. ### SSL inspection
  196. IAM Policy Autopilot uses your operating system's native certificate store for TLS verification. If your network performs SSL/TLS inspection (traffic re-signing), the inspection CA certificate must be installed in your OS certificate store. Consult your IT team if you are unsure whether this is already configured.
  197. ### Firewall allowlisting
  198. If outbound HTTPS traffic is restricted, allow access to:
  199. | Endpoint | Protocol | Purpose |
  200. |---|---|---|
  201. | `servicereference.us-east-1.amazonaws.com` | HTTPS | AWS service metadata for policy generation |
  202. ## CLI Usage
  203. The `iam-policy-autopilot` CLI tool provides three main commands:
  204. ```
  205. Generate IAM policies from source code and fix AccessDenied errors
  206. Usage: iam-policy-autopilot <COMMAND>
  207. Commands:
  208. fix-access-denied Fix AccessDenied errors by analyzing and optionally applying IAM policy changes
  209. generate-policies Generates complete IAM policy documents from source code or a Terraform plan
  210. mcp-server Start MCP server
  211. help Print this message or the help of the given subcommand(s)
  212. Options:
  213. -h, --help Print help (see more with '--help')
  214. -V, --version Print version
  215. ```
  216. ### Commands
  217. **generate-policies** - Generates complete IAM policy documents from application source code or a Terraform plan
  218. ```bash
  219. iam-policy-autopilot generate-policies <inputs> [OPTIONS]
  220. ```
  221. The inputs are either application source code or a Terraform plan in JSON form.
  222. The input kind is detected automatically and the two cannot be mixed in a single
  223. invocation.
  224. Example (source code):
  225. ```bash
  226. iam-policy-autopilot generate-policies \
  227. ./src/app.py \
  228. --region us-east-1 \
  229. --account 123456789012 \
  230. --pretty
  231. ```
  232. Example (Terraform plan). The plan must be in JSON form; produce it from a saved
  233. plan with `terraform show -json`:
  234. ```bash
  235. terraform plan -out=plan.tfplan # write the (binary) plan
  236. terraform show -json plan.tfplan > plan.json # render it to JSON
  237. iam-policy-autopilot generate-policies plan.json --pretty
  238. ```
  239. Options:
  240. - `--region <REGION>` - AWS region for resource ARNs
  241. - `--account <ACCOUNT>` - AWS account ID for resource ARNs
  242. - `--service-hints <SERVICES>` - Limit analysis to only the services your application actually uses if you know them. This helps reduce unnecessary permissions.
  243. - `--max-policy-size <CHARACTERS>` - Maximum policy size in non-whitespace JSON characters. Accepts non-negative values. Statements that do not fit start a new policy. Oversized single-statement policies are still emitted with a warning; generation continues. Defaults to `6144`, the AWS IAM managed policy size limit.
  244. - `--allow-overpermissive-wildcards-to-limit-total-output-size <CHARACTERS>` - Set a best-effort combined policy size target. Exact actions are used first; if the target is exceeded, word-aligned action wildcards may be introduced, which can grant additional actions. The target must be at least `--max-policy-size`.
  245. - `--upload-policies <PREFIX>` - Upload generated policies to AWS IAM with the specified prefix
  246. - `--pretty` - Pretty-print JSON output
  247. **fix-access-denied** - Fix AccessDenied errors by analyzing and optionally applying IAM policy changes
  248. ```bash
  249. iam-policy-autopilot fix-access-denied <access-denied-error-message> [OPTIONS]
  250. ```
  251. Example:
  252. ```bash
  253. iam-policy-autopilot fix-access-denied \
  254. "User: arn:aws:iam::123456789012:user/test is not authorized to perform: s3:GetObject on resource: arn:aws:s3:::my-bucket/file.txt"
  255. ```
  256. Options:
  257. - `--yes` - Auto-apply policy changes without confirmation
  258. **mcp-server** - Start MCP server locally
  259. ```bash
  260. iam-policy-autopilot mcp-server [OPTIONS]
  261. ```
  262. Options:
  263. - `--transport <TRANSPORT>` - Transport type: `stdio` (default) or `http`
  264. Example with HTTP transport:
  265. ```bash
  266. # Start server at http://127.0.0.1:8001/mcp
  267. iam-policy-autopilot mcp-server --transport http
  268. ```
  269. ## Build Instructions
  270. ### Prerequisites
  271. - [Rust](https://rustup.rs/) (latest stable version)
  272. - Git
  273. - Python 3
  274. - [CMake](https://cmake.org/) (Windows only)
  275. ### Setup
  276. Clone the repository with submodules:
  277. ```bash
  278. git clone --recurse-submodules https://github.com/awslabs/iam-policy-autopilot.git
  279. cd iam-policy-autopilot
  280. ```
  281. Build the project:
  282. ```bash
  283. cargo build --release
  284. ```
  285. The compiled binary will be located at `target/release/iam-policy-autopilot`.
  286. ### Using the Built Binary with MCP
  287. If you build from source, you can configure MCP clients to use the compiled binary:
  288. ```json
  289. {
  290. "mcpServers": {
  291. "iam-policy-autopilot": {
  292. "command": "/path/to/iam-policy-autopilot",
  293. "args": ["mcp-server"]
  294. }
  295. }
  296. }
  297. ```
  298. ## Workspace Structure
  299. This workspace contains several crates that work together:
  300. - **`iam-policy-autopilot-policy-generation/`** - Core library providing SDK extraction and enrichment capabilities
  301. - **`iam-policy-autopilot-access-denied/`** - Core library for parsing AccessDenied errors and synthesizing IAM policies
  302. - **`iam-policy-autopilot-tools/`** - Policy upload utilities and AWS integration tools
  303. - **`iam-policy-autopilot-cli/`** - Unified CLI tool providing all commands
  304. - **`iam-policy-autopilot-mcp-server/`** - MCP server integration for IDE and tool integration
  305. ## Development
  306. ### Running Tests
  307. ```bash
  308. # Run all tests
  309. cargo test --workspace
  310. # Run tests for specific crate
  311. cargo test -p iam-policy-autopilot-cli
  312. cargo test -p iam-policy-autopilot-access-denied
  313. cargo test -p iam-policy-autopilot-policy-generation
  314. # Run integration tests
  315. cargo test -p iam-policy-autopilot-cli --test integration_tests
  316. ```
  317. ### Building Release Version
  318. ```bash
  319. cargo build --release
  320. ```
  321. The compiled binary will be located at `target/release/iam-policy-autopilot`.
  322. ## Security
  323. See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
  324. ## License
  325. This project is licensed under the Apache-2.0 License.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.