mcp-aws-manager 0.1.0 → 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 +14 -22
- package/README.md +48 -74
- 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
|
-
npm install -g
|
|
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
|
{
|
|
@@ -61,7 +54,7 @@ This can be useful for clients that support `npx` commands.
|
|
|
61
54
|
"args": [
|
|
62
55
|
"-y",
|
|
63
56
|
"-p",
|
|
64
|
-
"
|
|
57
|
+
"mcp-aws-manager",
|
|
65
58
|
"mcp-aws-manager-mcp"
|
|
66
59
|
]
|
|
67
60
|
}
|
|
@@ -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
|
-
#
|
|
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,76 +9,59 @@ 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
|
|
|
20
21
|
```bash
|
|
21
|
-
npm install -g
|
|
22
|
+
npm install -g mcp-aws-manager
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
1. Ensure AWS credentials/profile and a PEM file are available on your machine.
|
|
27
|
-
2. Run a CLI check (explicit PEM path(s) or auto-discovery from current folder):
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
# explicit PEM path
|
|
31
|
-
mcp-aws-manager --pem-path /path/to/key.pem --profiles default
|
|
25
|
+
## Prerequisites
|
|
32
26
|
|
|
33
|
-
|
|
34
|
-
|
|
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`)
|
|
35
31
|
|
|
36
|
-
|
|
37
|
-
cd /path/that/contains/pem
|
|
38
|
-
mcp-aws-manager
|
|
39
|
-
```
|
|
32
|
+
## Quick Start
|
|
40
33
|
|
|
41
|
-
|
|
34
|
+
Basic discovery:
|
|
42
35
|
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
"mcpServers": {
|
|
46
|
-
"mcp-aws-manager": {
|
|
47
|
-
"command": "mcp-aws-manager-mcp"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
36
|
+
```bash
|
|
37
|
+
mcp-aws-manager --profiles default
|
|
51
38
|
```
|
|
52
39
|
|
|
53
|
-
|
|
40
|
+
Only public IP instances:
|
|
54
41
|
|
|
55
42
|
```bash
|
|
56
|
-
mcp-aws-manager --
|
|
57
|
-
|
|
58
|
-
# if current directory contains .pem files, pemPath is optional
|
|
59
|
-
mcp-aws-manager
|
|
43
|
+
mcp-aws-manager --profiles default --public-only
|
|
60
44
|
```
|
|
61
45
|
|
|
62
|
-
|
|
46
|
+
Collect runtime snapshots:
|
|
63
47
|
|
|
64
|
-
```
|
|
65
|
-
mcp-aws-manager --
|
|
48
|
+
```bash
|
|
49
|
+
mcp-aws-manager --profiles default --runtime-snapshot
|
|
66
50
|
```
|
|
67
51
|
|
|
68
|
-
|
|
52
|
+
Try automatic remediation for unmanaged instances:
|
|
69
53
|
|
|
70
54
|
```bash
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
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
|
|
76
59
|
```
|
|
77
60
|
|
|
78
|
-
|
|
61
|
+
Output CSV file:
|
|
79
62
|
|
|
80
63
|
```bash
|
|
81
|
-
mcp-aws-manager --
|
|
64
|
+
mcp-aws-manager --profiles default --format csv --out ./inventory.csv
|
|
82
65
|
```
|
|
83
66
|
|
|
84
67
|
## MCP (LLM Tool) Usage
|
|
@@ -89,52 +72,43 @@ Run as an MCP stdio server:
|
|
|
89
72
|
mcp-aws-manager-mcp
|
|
90
73
|
```
|
|
91
74
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
See `MCP_CLIENT_SETUP.md` for ready-to-copy config examples.
|
|
95
|
-
|
|
96
|
-
### Exposed MCP Tools
|
|
75
|
+
Exposed MCP tools:
|
|
97
76
|
|
|
98
|
-
- `
|
|
77
|
+
- `discover_ec2_with_ssm` (primary)
|
|
78
|
+
- `discover_public_ec2_with_pem` (compatibility alias, same SSM-only behavior)
|
|
99
79
|
- `mcp_aws_discover_cli_help`
|
|
100
80
|
|
|
101
81
|
Example tool arguments:
|
|
102
82
|
|
|
103
83
|
```json
|
|
104
84
|
{
|
|
105
|
-
"pemPaths": [
|
|
106
|
-
"C:\\Users\\<you>\\.ssh\\key1.pem",
|
|
107
|
-
"C:\\Users\\<you>\\.ssh\\key2.pem"
|
|
108
|
-
],
|
|
109
85
|
"profiles": ["default"],
|
|
86
|
+
"publicOnly": true,
|
|
87
|
+
"runtimeSnapshot": true,
|
|
88
|
+
"autoSsoLogin": true,
|
|
110
89
|
"noProgress": true
|
|
111
90
|
}
|
|
112
91
|
```
|
|
113
92
|
|
|
114
|
-
##
|
|
93
|
+
## Human-in-the-loop Behavior
|
|
115
94
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
-
|
|
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.
|
|
119
102
|
|
|
120
103
|
## Security Notes
|
|
121
104
|
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
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`.
|
|
125
108
|
|
|
126
109
|
## Compatibility Aliases
|
|
127
110
|
|
|
128
|
-
These legacy commands are
|
|
111
|
+
These legacy commands are still available:
|
|
129
112
|
|
|
130
113
|
- `mcp-aws-discover`
|
|
131
|
-
- `mcp-aws-discover-mcp`
|
|
132
|
-
|
|
133
|
-
## Keywords
|
|
134
|
-
|
|
135
|
-
- `mcp`
|
|
136
|
-
- `model-context-protocol`
|
|
137
|
-
- `aws`
|
|
138
|
-
- `ec2`
|
|
139
|
-
- `inventory`
|
|
140
|
-
- `cli`
|
|
114
|
+
- `mcp-aws-discover-mcp`
|