mcp-aws-manager 0.1.1 → 0.2.0
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.
- package/MCP_CLIENT_SETUP.md +12 -20
- package/README.md +47 -65
- package/bin/mcp-aws-manager-mcp.js +155 -220
- package/bin/mcp-aws-manager.js +788 -872
- package/package.json +3 -5
package/MCP_CLIENT_SETUP.md
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
# MCP Client Setup (stdio)
|
|
1
|
+
# MCP Client Setup (stdio)
|
|
2
2
|
|
|
3
|
-
This project
|
|
3
|
+
This project provides an MCP stdio wrapper around the SSM-only CLI.
|
|
4
4
|
|
|
5
5
|
- Preferred CLI command: `mcp-aws-manager`
|
|
6
6
|
- Preferred MCP server command: `mcp-aws-manager-mcp`
|
|
7
|
-
- Compatibility aliases
|
|
7
|
+
- Compatibility aliases: `mcp-aws-discover`, `mcp-aws-discover-mcp`
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Exposed MCP tools:
|
|
10
10
|
|
|
11
|
-
- `
|
|
11
|
+
- `discover_ec2_with_ssm` (primary)
|
|
12
|
+
- `discover_public_ec2_with_pem` (compatibility alias, same behavior)
|
|
12
13
|
- `mcp_aws_discover_cli_help`
|
|
13
14
|
|
|
14
|
-
## 1) Local Repo (
|
|
15
|
-
|
|
16
|
-
Use this when running directly from this repository.
|
|
15
|
+
## 1) Local Repo (development)
|
|
17
16
|
|
|
18
17
|
```json
|
|
19
18
|
{
|
|
@@ -31,14 +30,10 @@ Use this when running directly from this repository.
|
|
|
31
30
|
|
|
32
31
|
## 2) Global npm Install
|
|
33
32
|
|
|
34
|
-
After publishing/installing globally:
|
|
35
|
-
|
|
36
33
|
```bash
|
|
37
34
|
npm install -g mcp-aws-manager
|
|
38
35
|
```
|
|
39
36
|
|
|
40
|
-
Client config:
|
|
41
|
-
|
|
42
37
|
```json
|
|
43
38
|
{
|
|
44
39
|
"mcpServers": {
|
|
@@ -49,9 +44,7 @@ Client config:
|
|
|
49
44
|
}
|
|
50
45
|
```
|
|
51
46
|
|
|
52
|
-
## 3) npx (
|
|
53
|
-
|
|
54
|
-
This can be useful for clients that support `npx` commands.
|
|
47
|
+
## 3) npx (no global install)
|
|
55
48
|
|
|
56
49
|
```json
|
|
57
50
|
{
|
|
@@ -71,8 +64,7 @@ This can be useful for clients that support `npx` commands.
|
|
|
71
64
|
|
|
72
65
|
## Notes
|
|
73
66
|
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
- For scoped public npm packages, publish with `npm publish --access public` (or set `publishConfig.access`).
|
|
67
|
+
- Discovery is SSM-only; PEM path arguments are no longer required.
|
|
68
|
+
- Keep AWS credentials/profiles available on the host running MCP.
|
|
69
|
+
- When `requiresUserAction=true` is returned, surface `requiredActions` to the user and retry after intervention.
|
|
70
|
+
- For auto remediation, pass `autoRemediateSsm` and an instance profile name/arn.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# mcp-aws-manager
|
|
1
|
+
# mcp-aws-manager
|
|
2
2
|
|
|
3
|
-
AWS operations CLI and MCP server package (
|
|
3
|
+
AWS operations CLI and MCP server package (SSM-only mode).
|
|
4
4
|
|
|
5
5
|
## What It Provides
|
|
6
6
|
|
|
@@ -9,11 +9,12 @@ AWS operations CLI and MCP server package (currently discovery-focused).
|
|
|
9
9
|
|
|
10
10
|
Current implementation focuses on:
|
|
11
11
|
|
|
12
|
-
- EC2
|
|
13
|
-
-
|
|
14
|
-
- Optional
|
|
12
|
+
- EC2 inventory discovery (multi profile / multi region)
|
|
13
|
+
- SSM management and online-state visibility
|
|
14
|
+
- Optional SSM runtime snapshot collection (`RunCommand`)
|
|
15
|
+
- Optional SSM auto-remediation (instance profile association)
|
|
16
|
+
- Human-in-the-loop guidance via `ACTION_REQUIRED` messages
|
|
15
17
|
- JSON/CSV output (CLI)
|
|
16
|
-
- MCP tool wrapper for AI clients (stdio)
|
|
17
18
|
|
|
18
19
|
## Install
|
|
19
20
|
|
|
@@ -21,65 +22,46 @@ Current implementation focuses on:
|
|
|
21
22
|
npm install -g mcp-aws-manager
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
Ensure AWS credentials/profile and a PEM file are available on your machine.
|
|
27
|
-
|
|
28
|
-
Run a CLI check (explicit PEM path(s) or auto-discovery from current folder):
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
# explicit PEM path
|
|
32
|
-
mcp-aws-manager --pem-path /path/to/key.pem --profiles default
|
|
25
|
+
## Prerequisites
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
- Node.js `>=18`
|
|
28
|
+
- AWS credentials/profile (or IAM role) on the machine running the CLI/MCP server
|
|
29
|
+
- For runtime snapshots: SSM permissions (`ssm:SendCommand`, `ssm:GetCommandInvocation`)
|
|
30
|
+
- For auto remediation: EC2/IAM permissions (`ec2:AssociateIamInstanceProfile`, optionally `ec2:ReplaceIamInstanceProfileAssociation`, `iam:PassRole`)
|
|
36
31
|
|
|
37
|
-
|
|
38
|
-
cd /path/that/contains/pem
|
|
39
|
-
mcp-aws-manager
|
|
40
|
-
```
|
|
32
|
+
## Quick Start
|
|
41
33
|
|
|
42
|
-
|
|
34
|
+
Basic discovery:
|
|
43
35
|
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
"mcpServers": {
|
|
47
|
-
"mcp-aws-manager": {
|
|
48
|
-
"command": "mcp-aws-manager-mcp"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
36
|
+
```bash
|
|
37
|
+
mcp-aws-manager --profiles default
|
|
52
38
|
```
|
|
53
39
|
|
|
54
|
-
|
|
40
|
+
Only public IP instances:
|
|
55
41
|
|
|
56
42
|
```bash
|
|
57
|
-
mcp-aws-manager --
|
|
58
|
-
|
|
59
|
-
# if current directory contains .pem files, pemPath is optional
|
|
60
|
-
mcp-aws-manager
|
|
43
|
+
mcp-aws-manager --profiles default --public-only
|
|
61
44
|
```
|
|
62
45
|
|
|
63
|
-
|
|
46
|
+
Collect runtime snapshots:
|
|
64
47
|
|
|
65
|
-
```
|
|
66
|
-
mcp-aws-manager --
|
|
48
|
+
```bash
|
|
49
|
+
mcp-aws-manager --profiles default --runtime-snapshot
|
|
67
50
|
```
|
|
68
51
|
|
|
69
|
-
|
|
52
|
+
Try automatic remediation for unmanaged instances:
|
|
70
53
|
|
|
71
54
|
```bash
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
mcp-aws-manager --pem-path /path/to/key.pem --profiles default --format csv
|
|
55
|
+
mcp-aws-manager \
|
|
56
|
+
--profiles default \
|
|
57
|
+
--auto-remediate-ssm \
|
|
58
|
+
--ssm-instance-profile-name MySsmInstanceProfile
|
|
77
59
|
```
|
|
78
60
|
|
|
79
|
-
|
|
61
|
+
Output CSV file:
|
|
80
62
|
|
|
81
63
|
```bash
|
|
82
|
-
mcp-aws-manager --
|
|
64
|
+
mcp-aws-manager --profiles default --format csv --out ./inventory.csv
|
|
83
65
|
```
|
|
84
66
|
|
|
85
67
|
## MCP (LLM Tool) Usage
|
|
@@ -90,43 +72,43 @@ Run as an MCP stdio server:
|
|
|
90
72
|
mcp-aws-manager-mcp
|
|
91
73
|
```
|
|
92
74
|
|
|
93
|
-
|
|
75
|
+
Exposed MCP tools:
|
|
94
76
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
### Exposed MCP Tools
|
|
98
|
-
|
|
99
|
-
- `discover_public_ec2_with_pem`
|
|
77
|
+
- `discover_ec2_with_ssm` (primary)
|
|
78
|
+
- `discover_public_ec2_with_pem` (compatibility alias, same SSM-only behavior)
|
|
100
79
|
- `mcp_aws_discover_cli_help`
|
|
101
80
|
|
|
102
81
|
Example tool arguments:
|
|
103
82
|
|
|
104
83
|
```json
|
|
105
84
|
{
|
|
106
|
-
"pemPaths": [
|
|
107
|
-
"C:\\Users\\<you>\\.ssh\\key1.pem",
|
|
108
|
-
"C:\\Users\\<you>\\.ssh\\key2.pem"
|
|
109
|
-
],
|
|
110
85
|
"profiles": ["default"],
|
|
86
|
+
"publicOnly": true,
|
|
87
|
+
"runtimeSnapshot": true,
|
|
88
|
+
"autoSsoLogin": true,
|
|
111
89
|
"noProgress": true
|
|
112
90
|
}
|
|
113
91
|
```
|
|
114
92
|
|
|
115
|
-
##
|
|
93
|
+
## Human-in-the-loop Behavior
|
|
116
94
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
-
|
|
95
|
+
When fully automatic execution is not possible, the CLI/MCP returns actionable guidance:
|
|
96
|
+
|
|
97
|
+
- `ACTION_REQUIRED: [SSO_LOGIN_NEEDED] ...`
|
|
98
|
+
- `ACTION_REQUIRED: [SSM_ROLE_OR_AGENT_REQUIRED] ...`
|
|
99
|
+
- `ACTION_REQUIRED: [IAM_PROFILE_ASSOCIATION_FAILED] ...`
|
|
100
|
+
|
|
101
|
+
The MCP wrapper surfaces these in a structured `requiredActions` list.
|
|
120
102
|
|
|
121
103
|
## Security Notes
|
|
122
104
|
|
|
123
|
-
-
|
|
124
|
-
-
|
|
125
|
-
-
|
|
105
|
+
- Prefer IAM role + SSM over SSH key based access.
|
|
106
|
+
- Restrict RunCommand scopes with IAM policies and resource conditions.
|
|
107
|
+
- Review remediation permissions before enabling `--auto-remediate-ssm`.
|
|
126
108
|
|
|
127
109
|
## Compatibility Aliases
|
|
128
110
|
|
|
129
|
-
These legacy commands are
|
|
111
|
+
These legacy commands are still available:
|
|
130
112
|
|
|
131
113
|
- `mcp-aws-discover`
|
|
132
|
-
- `mcp-aws-discover-mcp`
|
|
114
|
+
- `mcp-aws-discover-mcp`
|