awslabs.iam-mcp-server 1.0.1__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.
- awslabs/__init__.py +17 -0
- awslabs/iam_mcp_server/__init__.py +17 -0
- awslabs/iam_mcp_server/aws_client.py +84 -0
- awslabs/iam_mcp_server/context.py +50 -0
- awslabs/iam_mcp_server/errors.py +150 -0
- awslabs/iam_mcp_server/models.py +197 -0
- awslabs/iam_mcp_server/server.py +769 -0
- awslabs_iam_mcp_server-1.0.1.dist-info/METADATA +482 -0
- awslabs_iam_mcp_server-1.0.1.dist-info/RECORD +13 -0
- awslabs_iam_mcp_server-1.0.1.dist-info/WHEEL +4 -0
- awslabs_iam_mcp_server-1.0.1.dist-info/entry_points.txt +2 -0
- awslabs_iam_mcp_server-1.0.1.dist-info/licenses/LICENSE +175 -0
- awslabs_iam_mcp_server-1.0.1.dist-info/licenses/NOTICE +2 -0
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: awslabs.iam-mcp-server
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: An AWS Labs Model Context Protocol (MCP) server for managing AWS IAM resources including users, roles, policies, and permissions
|
|
5
|
+
Project-URL: homepage, https://awslabs.github.io/mcp/
|
|
6
|
+
Project-URL: docs, https://awslabs.github.io/mcp/servers/iam-mcp-server/
|
|
7
|
+
Project-URL: documentation, https://awslabs.github.io/mcp/servers/iam-mcp-server/
|
|
8
|
+
Project-URL: repository, https://github.com/awslabs/mcp.git
|
|
9
|
+
Project-URL: changelog, https://github.com/awslabs/mcp/blob/main/src/iam-mcp-server/CHANGELOG.md
|
|
10
|
+
Author: Amazon Web Services
|
|
11
|
+
Author-email: AWSLabs MCP <203918161+awslabs-mcp@users.noreply.github.com>
|
|
12
|
+
License: Apache-2.0
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
License-File: NOTICE
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: boto3>=1.34.0
|
|
25
|
+
Requires-Dist: botocore>=1.34.0
|
|
26
|
+
Requires-Dist: loguru>=0.7.0
|
|
27
|
+
Requires-Dist: mcp[cli]>=1.6.0
|
|
28
|
+
Requires-Dist: pydantic>=2.10.6
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# AWS IAM MCP Server
|
|
32
|
+
|
|
33
|
+
A Model Context Protocol (MCP) server for comprehensive AWS Identity and Access Management (IAM) operations. This server provides AI assistants with the ability to manage IAM users, roles, policies, and permissions while following security best practices.
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
### Core IAM Management
|
|
38
|
+
- **User Management**: Create, list, retrieve, and delete IAM users
|
|
39
|
+
- **Role Management**: Create, list, and manage IAM roles with trust policies
|
|
40
|
+
- **Policy Management**: List and manage IAM policies (managed and inline)
|
|
41
|
+
- **Permission Management**: Attach/detach policies to users and roles
|
|
42
|
+
- **Access Key Management**: Create and delete access keys for users
|
|
43
|
+
- **Security Simulation**: Test policy permissions before applying them
|
|
44
|
+
|
|
45
|
+
### Security Features
|
|
46
|
+
- **Policy Simulation**: Test permissions without making changes
|
|
47
|
+
- **Force Delete**: Safely remove users with all associated resources
|
|
48
|
+
- **Permissions Boundary Support**: Set permission boundaries for enhanced security
|
|
49
|
+
- **Trust Policy Validation**: Validate JSON trust policies for roles
|
|
50
|
+
- **Read-Only Mode**: Run server in read-only mode to prevent any modifications
|
|
51
|
+
|
|
52
|
+
### Best Practices Integration
|
|
53
|
+
- Follows AWS IAM security best practices
|
|
54
|
+
- Supports principle of least privilege
|
|
55
|
+
- Provides warnings for sensitive operations
|
|
56
|
+
- Includes comprehensive error handling
|
|
57
|
+
|
|
58
|
+
## Installation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Install using uv (recommended)
|
|
62
|
+
uv tool install awslabs.iam-mcp-server
|
|
63
|
+
|
|
64
|
+
# Or install using pip
|
|
65
|
+
pip install awslabs.iam-mcp-server
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Configuration
|
|
69
|
+
|
|
70
|
+
### AWS Credentials
|
|
71
|
+
The server requires AWS credentials to be configured. You can use any of the following methods:
|
|
72
|
+
|
|
73
|
+
1. **AWS Profile** (recommended):
|
|
74
|
+
```bash
|
|
75
|
+
export AWS_PROFILE=your-profile-name
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. **Environment Variables**:
|
|
79
|
+
```bash
|
|
80
|
+
export AWS_ACCESS_KEY_ID=your-access-key
|
|
81
|
+
export AWS_SECRET_ACCESS_KEY=your-secret-key
|
|
82
|
+
export AWS_REGION=us-east-1
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
3. **IAM Roles** (for EC2/Lambda):
|
|
86
|
+
The server will automatically use IAM roles when running on AWS services.
|
|
87
|
+
|
|
88
|
+
### Required IAM Permissions
|
|
89
|
+
|
|
90
|
+
The AWS credentials used by this server need the following IAM permissions:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"Version": "2012-10-17",
|
|
95
|
+
"Statement": [
|
|
96
|
+
{
|
|
97
|
+
"Effect": "Allow",
|
|
98
|
+
"Action": [
|
|
99
|
+
"iam:ListUsers",
|
|
100
|
+
"iam:GetUser",
|
|
101
|
+
"iam:CreateUser",
|
|
102
|
+
"iam:DeleteUser",
|
|
103
|
+
"iam:ListRoles",
|
|
104
|
+
"iam:GetRole",
|
|
105
|
+
"iam:CreateRole",
|
|
106
|
+
"iam:DeleteRole",
|
|
107
|
+
"iam:ListPolicies",
|
|
108
|
+
"iam:GetPolicy",
|
|
109
|
+
"iam:CreatePolicy",
|
|
110
|
+
"iam:DeletePolicy",
|
|
111
|
+
"iam:AttachUserPolicy",
|
|
112
|
+
"iam:DetachUserPolicy",
|
|
113
|
+
"iam:AttachRolePolicy",
|
|
114
|
+
"iam:DetachRolePolicy",
|
|
115
|
+
"iam:ListAttachedUserPolicies",
|
|
116
|
+
"iam:ListAttachedRolePolicies",
|
|
117
|
+
"iam:ListUserPolicies",
|
|
118
|
+
"iam:ListRolePolicies",
|
|
119
|
+
"iam:GetGroupsForUser",
|
|
120
|
+
"iam:ListAccessKeys",
|
|
121
|
+
"iam:CreateAccessKey",
|
|
122
|
+
"iam:DeleteAccessKey",
|
|
123
|
+
"iam:SimulatePrincipalPolicy",
|
|
124
|
+
"iam:RemoveUserFromGroup",
|
|
125
|
+
"iam:DeleteUserPolicy"
|
|
126
|
+
],
|
|
127
|
+
"Resource": "*"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### MCP Client Configuration
|
|
134
|
+
|
|
135
|
+
#### Amazon Q CLI
|
|
136
|
+
Add to your `~/.aws/amazonq/mcp.json`:
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"mcpServers": {
|
|
141
|
+
"awslabs.iam-mcp-server": {
|
|
142
|
+
"command": "uvx",
|
|
143
|
+
"args": ["awslabs.iam-mcp-server@latest"],
|
|
144
|
+
"env": {
|
|
145
|
+
"AWS_PROFILE": "your-aws-profile",
|
|
146
|
+
"AWS_REGION": "us-east-1",
|
|
147
|
+
"FASTMCP_LOG_LEVEL": "ERROR"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
#### Cline
|
|
155
|
+
Add to your `cline_mcp_settings.json`:
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"mcpServers": {
|
|
160
|
+
"awslabs.iam-mcp-server": {
|
|
161
|
+
"command": "uvx",
|
|
162
|
+
"args": ["awslabs.iam-mcp-server@latest"],
|
|
163
|
+
"env": {
|
|
164
|
+
"AWS_PROFILE": "your-aws-profile",
|
|
165
|
+
"AWS_REGION": "us-east-1",
|
|
166
|
+
"FASTMCP_LOG_LEVEL": "ERROR"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
#### Cursor
|
|
174
|
+
[](cursor://mcp/install?config=ewogICJtY3BTZXJ2ZXJzIjogewogICAgImF3c2xhYnMuaWFtLW1jcC1zZXJ2ZXIiOiB7CiAgICAgICJjb21tYW5kIjogInV2eCIsCiAgICAgICJhcmdzIjogWyJhd3NsYWJzLmlhbS1tY3Atc2VydmVyQGxhdGVzdCJdLAogICAgICAiZW52IjogewogICAgICAgICJBV1NfUFJPRklMRSI6ICJ5b3VyLWF3cy1wcm9maWxlIiwKICAgICAgICAiQVdTX1JFR0lPTiI6ICJ1cy1lYXN0LTEiLAogICAgICAgICJGQVNUTUNQX0xPR19MRVZFTCI6ICJFUlJPUiIKICAgICAgfQogICAgfQogIH0KfQo=)
|
|
175
|
+
|
|
176
|
+
Add to your `.cursor/mcp.json`:
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"mcpServers": {
|
|
181
|
+
"awslabs.iam-mcp-server": {
|
|
182
|
+
"command": "uvx",
|
|
183
|
+
"args": ["awslabs.iam-mcp-server@latest"],
|
|
184
|
+
"env": {
|
|
185
|
+
"AWS_PROFILE": "your-aws-profile",
|
|
186
|
+
"AWS_REGION": "us-east-1",
|
|
187
|
+
"FASTMCP_LOG_LEVEL": "ERROR"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Read-Only Mode
|
|
195
|
+
|
|
196
|
+
The server supports a read-only mode that prevents all mutating operations while still allowing read operations. This is useful for:
|
|
197
|
+
|
|
198
|
+
- **Safety**: Preventing accidental modifications in production environments
|
|
199
|
+
- **Testing**: Allowing safe exploration of IAM resources without risk of changes
|
|
200
|
+
- **Auditing**: Running the server in environments where only read access should be allowed
|
|
201
|
+
|
|
202
|
+
### Enabling Read-Only Mode
|
|
203
|
+
|
|
204
|
+
Add the `--readonly` flag when starting the server:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Using uvx
|
|
208
|
+
uvx awslabs.iam-mcp-server@latest --readonly
|
|
209
|
+
|
|
210
|
+
# Or if installed locally
|
|
211
|
+
python -m awslabs.iam_mcp_server.server --readonly
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### MCP Client Configuration with Read-Only Mode
|
|
215
|
+
|
|
216
|
+
#### Amazon Q CLI
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"mcpServers": {
|
|
220
|
+
"awslabs.iam-mcp-server": {
|
|
221
|
+
"command": "uvx",
|
|
222
|
+
"args": ["awslabs.iam-mcp-server@latest", "--readonly"],
|
|
223
|
+
"env": {
|
|
224
|
+
"AWS_PROFILE": "your-aws-profile",
|
|
225
|
+
"AWS_REGION": "us-east-1"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### Other MCP Clients
|
|
233
|
+
Simply add `"--readonly"` to the args array in your MCP configuration.
|
|
234
|
+
|
|
235
|
+
### Operations Blocked in Read-Only Mode
|
|
236
|
+
|
|
237
|
+
When read-only mode is enabled, the following operations will return an error:
|
|
238
|
+
- `create_user`
|
|
239
|
+
- `delete_user`
|
|
240
|
+
- `create_role`
|
|
241
|
+
- `attach_user_policy`
|
|
242
|
+
- `detach_user_policy`
|
|
243
|
+
- `create_access_key`
|
|
244
|
+
- `delete_access_key`
|
|
245
|
+
|
|
246
|
+
### Operations Available in Read-Only Mode
|
|
247
|
+
|
|
248
|
+
These operations continue to work normally:
|
|
249
|
+
- `list_users`
|
|
250
|
+
- `get_user`
|
|
251
|
+
- `list_roles`
|
|
252
|
+
- `list_policies`
|
|
253
|
+
- `simulate_principal_policy`
|
|
254
|
+
|
|
255
|
+
## Available Tools
|
|
256
|
+
|
|
257
|
+
### User Management
|
|
258
|
+
|
|
259
|
+
#### `list_users`
|
|
260
|
+
List IAM users in the account with optional filtering.
|
|
261
|
+
|
|
262
|
+
**Parameters:**
|
|
263
|
+
- `path_prefix` (optional): Path prefix to filter users (e.g., "/division_abc/")
|
|
264
|
+
- `max_items` (optional): Maximum number of users to return (default: 100)
|
|
265
|
+
|
|
266
|
+
#### `get_user`
|
|
267
|
+
Get detailed information about a specific IAM user including attached policies, groups, and access keys.
|
|
268
|
+
|
|
269
|
+
**Parameters:**
|
|
270
|
+
- `user_name`: The name of the IAM user to retrieve
|
|
271
|
+
|
|
272
|
+
#### `create_user`
|
|
273
|
+
Create a new IAM user.
|
|
274
|
+
|
|
275
|
+
**Parameters:**
|
|
276
|
+
- `user_name`: The name of the new IAM user
|
|
277
|
+
- `path` (optional): The path for the user (default: "/")
|
|
278
|
+
- `permissions_boundary` (optional): ARN of the permissions boundary policy
|
|
279
|
+
|
|
280
|
+
#### `delete_user`
|
|
281
|
+
Delete an IAM user with optional force cleanup.
|
|
282
|
+
|
|
283
|
+
**Parameters:**
|
|
284
|
+
- `user_name`: The name of the IAM user to delete
|
|
285
|
+
- `force` (optional): Force delete by removing all attached resources first (default: false)
|
|
286
|
+
|
|
287
|
+
### Role Management
|
|
288
|
+
|
|
289
|
+
#### `list_roles`
|
|
290
|
+
List IAM roles in the account with optional filtering.
|
|
291
|
+
|
|
292
|
+
**Parameters:**
|
|
293
|
+
- `path_prefix` (optional): Path prefix to filter roles (e.g., "/service-role/")
|
|
294
|
+
- `max_items` (optional): Maximum number of roles to return (default: 100)
|
|
295
|
+
|
|
296
|
+
#### `create_role`
|
|
297
|
+
Create a new IAM role with a trust policy.
|
|
298
|
+
|
|
299
|
+
**Parameters:**
|
|
300
|
+
- `role_name`: The name of the new IAM role
|
|
301
|
+
- `assume_role_policy_document`: The trust policy document in JSON format
|
|
302
|
+
- `path` (optional): The path for the role (default: "/")
|
|
303
|
+
- `description` (optional): Description of the role
|
|
304
|
+
- `max_session_duration` (optional): Maximum session duration in seconds (default: 3600)
|
|
305
|
+
- `permissions_boundary` (optional): ARN of the permissions boundary policy
|
|
306
|
+
|
|
307
|
+
### Policy Management
|
|
308
|
+
|
|
309
|
+
#### `list_policies`
|
|
310
|
+
List IAM policies in the account.
|
|
311
|
+
|
|
312
|
+
**Parameters:**
|
|
313
|
+
- `scope` (optional): Scope of policies to list: "All", "AWS", or "Local" (default: "Local")
|
|
314
|
+
- `only_attached` (optional): Only return policies that are attached (default: false)
|
|
315
|
+
- `path_prefix` (optional): Path prefix to filter policies
|
|
316
|
+
- `max_items` (optional): Maximum number of policies to return (default: 100)
|
|
317
|
+
|
|
318
|
+
#### `attach_user_policy`
|
|
319
|
+
Attach a managed policy to an IAM user.
|
|
320
|
+
|
|
321
|
+
**Parameters:**
|
|
322
|
+
- `user_name`: The name of the IAM user
|
|
323
|
+
- `policy_arn`: The ARN of the policy to attach
|
|
324
|
+
|
|
325
|
+
#### `detach_user_policy`
|
|
326
|
+
Detach a managed policy from an IAM user.
|
|
327
|
+
|
|
328
|
+
**Parameters:**
|
|
329
|
+
- `user_name`: The name of the IAM user
|
|
330
|
+
- `policy_arn`: The ARN of the policy to detach
|
|
331
|
+
|
|
332
|
+
### Access Key Management
|
|
333
|
+
|
|
334
|
+
#### `create_access_key`
|
|
335
|
+
Create a new access key for an IAM user.
|
|
336
|
+
|
|
337
|
+
**Parameters:**
|
|
338
|
+
- `user_name`: The name of the IAM user
|
|
339
|
+
|
|
340
|
+
**⚠️ Security Warning:** The secret access key is only returned once and cannot be retrieved again.
|
|
341
|
+
|
|
342
|
+
#### `delete_access_key`
|
|
343
|
+
Delete an access key for an IAM user.
|
|
344
|
+
|
|
345
|
+
**Parameters:**
|
|
346
|
+
- `user_name`: The name of the IAM user
|
|
347
|
+
- `access_key_id`: The access key ID to delete
|
|
348
|
+
|
|
349
|
+
### Security Analysis
|
|
350
|
+
|
|
351
|
+
#### `simulate_principal_policy`
|
|
352
|
+
Simulate IAM policy evaluation for a principal to test permissions.
|
|
353
|
+
|
|
354
|
+
**Parameters:**
|
|
355
|
+
- `policy_source_arn`: ARN of the user or role to simulate
|
|
356
|
+
- `action_names`: List of actions to simulate
|
|
357
|
+
- `resource_arns` (optional): List of resource ARNs to test against
|
|
358
|
+
- `context_entries` (optional): Context entries for the simulation
|
|
359
|
+
|
|
360
|
+
## Usage Examples
|
|
361
|
+
|
|
362
|
+
### Basic User Management
|
|
363
|
+
```python
|
|
364
|
+
# List all users
|
|
365
|
+
users = await list_users()
|
|
366
|
+
|
|
367
|
+
# Get specific user details
|
|
368
|
+
user_details = await get_user(user_name="john.doe")
|
|
369
|
+
|
|
370
|
+
# Create a new user
|
|
371
|
+
new_user = await create_user(
|
|
372
|
+
user_name="jane.smith",
|
|
373
|
+
path="/developers/"
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
# Delete a user (with force cleanup)
|
|
377
|
+
await delete_user(user_name="old.user", force=True)
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### Role Management
|
|
381
|
+
```python
|
|
382
|
+
# Create a role for EC2 instances
|
|
383
|
+
trust_policy = {
|
|
384
|
+
"Version": "2012-10-17",
|
|
385
|
+
"Statement": [
|
|
386
|
+
{
|
|
387
|
+
"Effect": "Allow",
|
|
388
|
+
"Principal": {"Service": "ec2.amazonaws.com"},
|
|
389
|
+
"Action": "sts:AssumeRole"
|
|
390
|
+
}
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
role = await create_role(
|
|
395
|
+
role_name="EC2-S3-Access-Role",
|
|
396
|
+
assume_role_policy_document=json.dumps(trust_policy),
|
|
397
|
+
description="Role for EC2 instances to access S3"
|
|
398
|
+
)
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### Policy Management
|
|
402
|
+
```python
|
|
403
|
+
# List customer managed policies
|
|
404
|
+
policies = await list_policies(scope="Local", only_attached=True)
|
|
405
|
+
|
|
406
|
+
# Attach a policy to a user
|
|
407
|
+
await attach_user_policy(
|
|
408
|
+
user_name="developer",
|
|
409
|
+
policy_arn="arn:aws:iam::123456789012:policy/DeveloperPolicy"
|
|
410
|
+
)
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Security Testing
|
|
414
|
+
```python
|
|
415
|
+
# Test if a user can perform specific actions
|
|
416
|
+
simulation = await simulate_principal_policy(
|
|
417
|
+
policy_source_arn="arn:aws:iam::123456789012:user/developer",
|
|
418
|
+
action_names=["s3:GetObject", "s3:PutObject"],
|
|
419
|
+
resource_arns=["arn:aws:s3:::my-bucket/*"]
|
|
420
|
+
)
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
## Security Best Practices
|
|
424
|
+
|
|
425
|
+
1. **Principle of Least Privilege**: Always grant the minimum permissions necessary
|
|
426
|
+
2. **Use Roles for Applications**: Prefer IAM roles over users for applications
|
|
427
|
+
3. **Regular Access Reviews**: Periodically review and clean up unused users and permissions
|
|
428
|
+
4. **Access Key Rotation**: Regularly rotate access keys
|
|
429
|
+
5. **Enable MFA**: Use multi-factor authentication where possible
|
|
430
|
+
6. **Permissions Boundaries**: Use permissions boundaries to set maximum permissions
|
|
431
|
+
7. **Policy Simulation**: Test policies before applying them to production
|
|
432
|
+
|
|
433
|
+
## Error Handling
|
|
434
|
+
|
|
435
|
+
The server provides comprehensive error handling with descriptive messages:
|
|
436
|
+
|
|
437
|
+
- **Authentication Errors**: Clear messages for credential issues
|
|
438
|
+
- **Permission Errors**: Specific information about missing permissions
|
|
439
|
+
- **Resource Not Found**: Helpful messages when resources don't exist
|
|
440
|
+
- **Validation Errors**: Detailed feedback on invalid parameters
|
|
441
|
+
|
|
442
|
+
## Development
|
|
443
|
+
|
|
444
|
+
### Running Tests
|
|
445
|
+
```bash
|
|
446
|
+
# Install development dependencies
|
|
447
|
+
uv sync --dev
|
|
448
|
+
|
|
449
|
+
# Run tests
|
|
450
|
+
uv run pytest
|
|
451
|
+
|
|
452
|
+
# Run tests with coverage
|
|
453
|
+
uv run pytest --cov=awslabs.iam_mcp_server
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### Local Development
|
|
457
|
+
```bash
|
|
458
|
+
# Install in development mode
|
|
459
|
+
uv pip install -e .
|
|
460
|
+
|
|
461
|
+
# Run the server directly
|
|
462
|
+
python -m awslabs.iam_mcp_server.server
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## Contributing
|
|
466
|
+
|
|
467
|
+
Contributions are welcome! Please see the main repository's [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.
|
|
468
|
+
|
|
469
|
+
## License
|
|
470
|
+
|
|
471
|
+
This project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.
|
|
472
|
+
|
|
473
|
+
## Support
|
|
474
|
+
|
|
475
|
+
For issues and questions:
|
|
476
|
+
1. Check the [AWS IAM documentation](https://docs.aws.amazon.com/iam/)
|
|
477
|
+
2. Review the [MCP specification](https://modelcontextprotocol.io/)
|
|
478
|
+
3. Open an issue in the [GitHub repository](https://github.com/awslabs/mcp)
|
|
479
|
+
|
|
480
|
+
## Changelog
|
|
481
|
+
|
|
482
|
+
See [CHANGELOG.md](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=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,,
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|