awslabs.iam-mcp-server 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.iam-mcp-server
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: An AWS Labs Model Context Protocol (MCP) server for managing AWS IAM resources including users, roles, policies, and permissions
5
5
  Project-URL: homepage, https://awslabs.github.io/mcp/
6
6
  Project-URL: docs, https://awslabs.github.io/mcp/servers/iam-mcp-server/
@@ -24,7 +24,7 @@ Requires-Python: >=3.10
24
24
  Requires-Dist: boto3>=1.34.0
25
25
  Requires-Dist: botocore>=1.34.0
26
26
  Requires-Dist: loguru>=0.7.0
27
- Requires-Dist: mcp[cli]>=1.6.0
27
+ Requires-Dist: mcp[cli]>=1.11.0
28
28
  Requires-Dist: pydantic>=2.10.6
29
29
  Description-Content-Type: text/markdown
30
30
 
@@ -37,7 +37,9 @@ A Model Context Protocol (MCP) server for comprehensive AWS Identity and Access
37
37
  ### Core IAM Management
38
38
  - **User Management**: Create, list, retrieve, and delete IAM users
39
39
  - **Role Management**: Create, list, and manage IAM roles with trust policies
40
+ - **Group Management**: Create, list, retrieve, and delete IAM groups with member management
40
41
  - **Policy Management**: List and manage IAM policies (managed and inline)
42
+ - **Inline Policy Management**: Full CRUD operations for user and role inline policies
41
43
  - **Permission Management**: Attach/detach policies to users and roles
42
44
  - **Access Key Management**: Create and delete access keys for users
43
45
  - **Security Simulation**: Test policy permissions before applying them
@@ -104,6 +106,16 @@ The AWS credentials used by this server need the following IAM permissions:
104
106
  "iam:GetRole",
105
107
  "iam:CreateRole",
106
108
  "iam:DeleteRole",
109
+ "iam:ListGroups",
110
+ "iam:GetGroup",
111
+ "iam:CreateGroup",
112
+ "iam:DeleteGroup",
113
+ "iam:AddUserToGroup",
114
+ "iam:RemoveUserFromGroup",
115
+ "iam:AttachGroupPolicy",
116
+ "iam:DetachGroupPolicy",
117
+ "iam:ListAttachedGroupPolicies",
118
+ "iam:ListGroupPolicies",
107
119
  "iam:ListPolicies",
108
120
  "iam:GetPolicy",
109
121
  "iam:CreatePolicy",
@@ -116,13 +128,18 @@ The AWS credentials used by this server need the following IAM permissions:
116
128
  "iam:ListAttachedRolePolicies",
117
129
  "iam:ListUserPolicies",
118
130
  "iam:ListRolePolicies",
131
+ "iam:GetUserPolicy",
132
+ "iam:GetRolePolicy",
133
+ "iam:PutUserPolicy",
134
+ "iam:PutRolePolicy",
119
135
  "iam:GetGroupsForUser",
120
136
  "iam:ListAccessKeys",
121
137
  "iam:CreateAccessKey",
122
138
  "iam:DeleteAccessKey",
123
139
  "iam:SimulatePrincipalPolicy",
124
140
  "iam:RemoveUserFromGroup",
125
- "iam:DeleteUserPolicy"
141
+ "iam:DeleteUserPolicy",
142
+ "iam:DeleteRolePolicy"
126
143
  ],
127
144
  "Resource": "*"
128
145
  }
@@ -170,8 +187,13 @@ Add to your `cline_mcp_settings.json`:
170
187
  }
171
188
  ```
172
189
 
173
- #### Cursor
174
- [![Install in Cursor](https://img.shields.io/badge/Install%20in-Cursor-blue?style=flat-square&logo=cursor)](cursor://mcp/install?config=ewogICJtY3BTZXJ2ZXJzIjogewogICAgImF3c2xhYnMuaWFtLW1jcC1zZXJ2ZXIiOiB7CiAgICAgICJjb21tYW5kIjogInV2eCIsCiAgICAgICJhcmdzIjogWyJhd3NsYWJzLmlhbS1tY3Atc2VydmVyQGxhdGVzdCJdLAogICAgICAiZW52IjogewogICAgICAgICJBV1NfUFJPRklMRSI6ICJ5b3VyLWF3cy1wcm9maWxlIiwKICAgICAgICAiQVdTX1JFR0lPTiI6ICJ1cy1lYXN0LTEiLAogICAgICAgICJGQVNUTUNQX0xPR19MRVZFTCI6ICJFUlJPUiIKICAgICAgfQogICAgfQogIH0KfQo=)
190
+ #### One-Click Installation
191
+
192
+ | Cursor | VS Code |
193
+ |:------:|:-------:|
194
+ | [![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/install-mcp?name=awslabs.iam-mcp-server&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyJhd3NsYWJzLmlhbS1tY3Atc2VydmVyQGxhdGVzdCJdLCJlbnYiOnsiQVdTX1BST0ZJTEUiOiJ5b3VyLWF3cy1wcm9maWxlIiwiQVdTX1JFR0lPTiI6InVzLWVhc3QtMSIsIkZBU1RNQ1BfTE9HX0xFVkVMIjoiRVJST1IifX0%3D) | [![Install on VS Code](https://img.shields.io/badge/Install_on-VS_Code-FF9900?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=AWS%20IAM%20MCP%20Server&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22awslabs.iam-mcp-server%40latest%22%5D%2C%22env%22%3A%7B%22AWS_PROFILE%22%3A%22your-aws-profile%22%2C%22AWS_REGION%22%3A%22us-east-1%22%2C%22FASTMCP_LOG_LEVEL%22%3A%22ERROR%22%7D%7D) |
195
+
196
+ #### Manual Configuration
175
197
 
176
198
  Add to your `.cursor/mcp.json`:
177
199
 
@@ -304,6 +326,63 @@ Create a new IAM role with a trust policy.
304
326
  - `max_session_duration` (optional): Maximum session duration in seconds (default: 3600)
305
327
  - `permissions_boundary` (optional): ARN of the permissions boundary policy
306
328
 
329
+ ### Group Management
330
+
331
+ #### `list_groups`
332
+ List IAM groups in the account with optional filtering.
333
+
334
+ **Parameters:**
335
+ - `path_prefix` (optional): Path prefix to filter groups (e.g., "/division_abc/")
336
+ - `max_items` (optional): Maximum number of groups to return (default: 100)
337
+
338
+ #### `get_group`
339
+ Get detailed information about a specific IAM group including members, attached policies, and inline policies.
340
+
341
+ **Parameters:**
342
+ - `group_name`: The name of the IAM group to retrieve
343
+
344
+ #### `create_group`
345
+ Create a new IAM group.
346
+
347
+ **Parameters:**
348
+ - `group_name`: The name of the new IAM group
349
+ - `path` (optional): The path for the group (default: "/")
350
+
351
+ #### `delete_group`
352
+ Delete an IAM group with optional force cleanup.
353
+
354
+ **Parameters:**
355
+ - `group_name`: The name of the IAM group to delete
356
+ - `force` (optional): Force delete by removing all members and policies first (default: false)
357
+
358
+ #### `add_user_to_group`
359
+ Add a user to an IAM group.
360
+
361
+ **Parameters:**
362
+ - `group_name`: The name of the IAM group
363
+ - `user_name`: The name of the IAM user
364
+
365
+ #### `remove_user_from_group`
366
+ Remove a user from an IAM group.
367
+
368
+ **Parameters:**
369
+ - `group_name`: The name of the IAM group
370
+ - `user_name`: The name of the IAM user
371
+
372
+ #### `attach_group_policy`
373
+ Attach a managed policy to an IAM group.
374
+
375
+ **Parameters:**
376
+ - `group_name`: The name of the IAM group
377
+ - `policy_arn`: The ARN of the policy to attach
378
+
379
+ #### `detach_group_policy`
380
+ Detach a managed policy from an IAM group.
381
+
382
+ **Parameters:**
383
+ - `group_name`: The name of the IAM group
384
+ - `policy_arn`: The ARN of the policy to detach
385
+
307
386
  ### Policy Management
308
387
 
309
388
  #### `list_policies`
@@ -357,6 +436,64 @@ Simulate IAM policy evaluation for a principal to test permissions.
357
436
  - `resource_arns` (optional): List of resource ARNs to test against
358
437
  - `context_entries` (optional): Context entries for the simulation
359
438
 
439
+ ### Inline Policy Management
440
+
441
+ #### `put_user_policy`
442
+ Create or update an inline policy for an IAM user.
443
+
444
+ **Parameters:**
445
+ - `user_name`: The name of the IAM user
446
+ - `policy_name`: The name of the inline policy
447
+ - `policy_document`: The policy document in JSON format (string or dict)
448
+
449
+ #### `get_user_policy`
450
+ Retrieve an inline policy for an IAM user.
451
+
452
+ **Parameters:**
453
+ - `user_name`: The name of the IAM user
454
+ - `policy_name`: The name of the inline policy
455
+
456
+ #### `delete_user_policy`
457
+ Delete an inline policy from an IAM user.
458
+
459
+ **Parameters:**
460
+ - `user_name`: The name of the IAM user
461
+ - `policy_name`: The name of the inline policy to delete
462
+
463
+ #### `list_user_policies`
464
+ List all inline policies for an IAM user.
465
+
466
+ **Parameters:**
467
+ - `user_name`: The name of the IAM user
468
+
469
+ #### `put_role_policy`
470
+ Create or update an inline policy for an IAM role.
471
+
472
+ **Parameters:**
473
+ - `role_name`: The name of the IAM role
474
+ - `policy_name`: The name of the inline policy
475
+ - `policy_document`: The policy document in JSON format (string or dict)
476
+
477
+ #### `get_role_policy`
478
+ Retrieve an inline policy for an IAM role.
479
+
480
+ **Parameters:**
481
+ - `role_name`: The name of the IAM role
482
+ - `policy_name`: The name of the inline policy
483
+
484
+ #### `delete_role_policy`
485
+ Delete an inline policy from an IAM role.
486
+
487
+ **Parameters:**
488
+ - `role_name`: The name of the IAM role
489
+ - `policy_name`: The name of the inline policy to delete
490
+
491
+ #### `list_role_policies`
492
+ List all inline policies for an IAM role.
493
+
494
+ **Parameters:**
495
+ - `role_name`: The name of the IAM role
496
+
360
497
  ## Usage Examples
361
498
 
362
499
  ### Basic User Management
@@ -398,6 +535,30 @@ role = await create_role(
398
535
  )
399
536
  ```
400
537
 
538
+ ### Group Management
539
+ ```python
540
+ # Create a new group
541
+ group = await create_group(
542
+ group_name="Developers",
543
+ path="/teams/"
544
+ )
545
+
546
+ # Add users to the group
547
+ await add_user_to_group(
548
+ group_name="Developers",
549
+ user_name="john.doe"
550
+ )
551
+
552
+ # Attach a policy to the group
553
+ await attach_group_policy(
554
+ group_name="Developers",
555
+ policy_arn="arn:aws:iam::123456789012:policy/DeveloperPolicy"
556
+ )
557
+
558
+ # Get group details including members
559
+ group_details = await get_group(group_name="Developers")
560
+ ```
561
+
401
562
  ### Policy Management
402
563
  ```python
403
564
  # List customer managed policies
@@ -420,6 +581,58 @@ simulation = await simulate_principal_policy(
420
581
  )
421
582
  ```
422
583
 
584
+ ### Inline Policy Management
585
+ ```python
586
+ # Create an inline policy for a user
587
+ policy_document = {
588
+ "Version": "2012-10-17",
589
+ "Statement": [
590
+ {
591
+ "Effect": "Allow",
592
+ "Action": ["s3:GetObject", "s3:PutObject"],
593
+ "Resource": "arn:aws:s3:::my-bucket/*"
594
+ }
595
+ ]
596
+ }
597
+
598
+ await put_user_policy(
599
+ user_name="developer",
600
+ policy_name="S3AccessPolicy",
601
+ policy_document=policy_document
602
+ )
603
+
604
+ # Retrieve an inline policy
605
+ policy = await get_user_policy(
606
+ user_name="developer",
607
+ policy_name="S3AccessPolicy"
608
+ )
609
+
610
+ # List all inline policies for a user
611
+ policies = await list_user_policies(user_name="developer")
612
+
613
+ # Create an inline policy for a role
614
+ await put_role_policy(
615
+ role_name="EC2-S3-Access-Role",
616
+ policy_name="S3ReadOnlyPolicy",
617
+ policy_document={
618
+ "Version": "2012-10-17",
619
+ "Statement": [
620
+ {
621
+ "Effect": "Allow",
622
+ "Action": "s3:GetObject",
623
+ "Resource": "*"
624
+ }
625
+ ]
626
+ }
627
+ )
628
+
629
+ # Delete an inline policy
630
+ await delete_user_policy(
631
+ user_name="developer",
632
+ policy_name="S3AccessPolicy"
633
+ )
634
+ ```
635
+
423
636
  ## Security Best Practices
424
637
 
425
638
  1. **Principle of Least Privilege**: Always grant the minimum permissions necessary
@@ -429,6 +642,8 @@ simulation = await simulate_principal_policy(
429
642
  5. **Enable MFA**: Use multi-factor authentication where possible
430
643
  6. **Permissions Boundaries**: Use permissions boundaries to set maximum permissions
431
644
  7. **Policy Simulation**: Test policies before applying them to production
645
+ 8. **Prefer Managed Policies**: Use managed policies over inline policies for reusable permissions
646
+ 9. **Inline Policy Guidelines**: Use inline policies only for permissions unique to a single identity
432
647
 
433
648
  ## Error Handling
434
649
 
@@ -464,11 +679,11 @@ python -m awslabs.iam_mcp_server.server
464
679
 
465
680
  ## Contributing
466
681
 
467
- Contributions are welcome! Please see the main repository's [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.
682
+ Contributions are welcome! Please see the main repository's [CONTRIBUTING.md](https://github.com/awslabs/mcp/blob/main/CONTRIBUTING.md) for guidelines.
468
683
 
469
684
  ## License
470
685
 
471
- This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.
686
+ This project is licensed under the Apache License 2.0. See the [LICENSE](https://github.com/awslabs/mcp/blob/main/src/iam-mcp-server/LICENSE) file for details.
472
687
 
473
688
  ## Support
474
689
 
@@ -479,4 +694,4 @@ For issues and questions:
479
694
 
480
695
  ## Changelog
481
696
 
482
- See [CHANGELOG.md](CHANGELOG.md) for version history and changes.
697
+ See [CHANGELOG.md](https://github.com/awslabs/mcp/blob/main/src/iam-mcp-server/CHANGELOG.md) for version history and changes.
@@ -0,0 +1,13 @@
1
+ awslabs/__init__.py,sha256=dzKGHmVYP-680lDPkXJrDGVhMSb0BD6_Vfu83qcA1aA,675
2
+ awslabs/iam_mcp_server/__init__.py,sha256=EkXrr_NxCPkjPWqoMupbYspWGNRVClM5ycmO42mvEZM,673
3
+ awslabs/iam_mcp_server/aws_client.py,sha256=13lAde77Q3DdOHDqE7YvF93SjdV-S9c_2uy3ChrjpaA,2994
4
+ awslabs/iam_mcp_server/context.py,sha256=Xmxrp6B-T_2OS3WEp2K1VjBHQjIo6dpvbx6V_j8ZXFo,1752
5
+ awslabs/iam_mcp_server/errors.py,sha256=Co6-rVod81qaAl__Ob5ouGly33SBhfpF61am2P5BfmE,5818
6
+ awslabs/iam_mcp_server/models.py,sha256=G7Ft_4MIXtDpGyFkdc8nJ693ZG6cWiticqHn2T1gUBE,12535
7
+ awslabs/iam_mcp_server/server.py,sha256=ApKVC0rvxSYzIsS5GiLYn8saaBv7XzY-xWmDyqjc-BM,54476
8
+ awslabs_iam_mcp_server-1.0.3.dist-info/METADATA,sha256=G5voXg-rTE19IFINbw_nNmY-wyZVbaO48E2FGh88rWE,20472
9
+ awslabs_iam_mcp_server-1.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ awslabs_iam_mcp_server-1.0.3.dist-info/entry_points.txt,sha256=B9fOJVT7l2NUQ1RHLUiskRtB5wADSpSI95cI9gU6dO0,78
11
+ awslabs_iam_mcp_server-1.0.3.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
12
+ awslabs_iam_mcp_server-1.0.3.dist-info/licenses/NOTICE,sha256=Qls-8qZMuKGG2WDBsLbJOBNuQxTkSI6ij_7HTi7I4ys,86
13
+ awslabs_iam_mcp_server-1.0.3.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- awslabs/__init__.py,sha256=dzKGHmVYP-680lDPkXJrDGVhMSb0BD6_Vfu83qcA1aA,675
2
- awslabs/iam_mcp_server/__init__.py,sha256=tnJPNAmwa84Ny3QliNkzX5cLfDTMrM3bXKa9QGfXrLo,665
3
- awslabs/iam_mcp_server/aws_client.py,sha256=13lAde77Q3DdOHDqE7YvF93SjdV-S9c_2uy3ChrjpaA,2994
4
- awslabs/iam_mcp_server/context.py,sha256=X28PtpwuvU1NyWIc8cBx8tyZimGfirXRegyasygBUd8,1620
5
- awslabs/iam_mcp_server/errors.py,sha256=Co6-rVod81qaAl__Ob5ouGly33SBhfpF61am2P5BfmE,5818
6
- awslabs/iam_mcp_server/models.py,sha256=ftCkBwW4IKk0g1pmspI7tXpWEZTu3zSs7nx0DwQvOfI,8424
7
- awslabs/iam_mcp_server/server.py,sha256=8OHhdRMwxE9YlYlynbA-V33ChLCQudrxWsLHk7UVPKo,26615
8
- awslabs_iam_mcp_server-1.0.1.dist-info/METADATA,sha256=i8PWiTrIXj9wYS5docL-O2U4OOgECuFas4UlYq76cBg,14297
9
- awslabs_iam_mcp_server-1.0.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- awslabs_iam_mcp_server-1.0.1.dist-info/entry_points.txt,sha256=B9fOJVT7l2NUQ1RHLUiskRtB5wADSpSI95cI9gU6dO0,78
11
- awslabs_iam_mcp_server-1.0.1.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
12
- awslabs_iam_mcp_server-1.0.1.dist-info/licenses/NOTICE,sha256=Qls-8qZMuKGG2WDBsLbJOBNuQxTkSI6ij_7HTi7I4ys,86
13
- awslabs_iam_mcp_server-1.0.1.dist-info/RECORD,,