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.
@@ -1,19 +1,18 @@
1
- # MCP Client Setup (stdio)
1
+ # MCP Client Setup (stdio)
2
2
 
3
- This project now includes an MCP stdio server wrapper.
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 still available: `mcp-aws-discover`, `mcp-aws-discover-mcp`
7
+ - Compatibility aliases: `mcp-aws-discover`, `mcp-aws-discover-mcp`
8
8
 
9
- The MCP server exposes these tools:
9
+ Exposed MCP tools:
10
10
 
11
- - `discover_public_ec2_with_pem`
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 (recommended for development)
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 (without global install)
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
- - The current discovery tool is PEM-based and accepts `pemPath` or `pemPaths` (array).
75
- - If neither is provided, it auto-discovers `.pem` files from the working directory.
76
- - AWS credentials/profiles must be available on the machine running the MCP server.
77
- - Do not pass PEM contents through chat; use a local file path in tool arguments.
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 (currently discovery-focused).
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 public IPv4 inventory discovery
13
- - PEM fingerprint-based EC2 KeyPair matching
14
- - Optional SSH reachability checks
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
- ## Quick Start
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
- # multiple explicit PEM paths (comma-separated)
35
- mcp-aws-manager --pem-path /path/to/key1.pem,/path/to/key2.pem --profiles default
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
- # no args: auto-uses all *.pem in current directory
38
- cd /path/that/contains/pem
39
- mcp-aws-manager
40
- ```
32
+ ## Quick Start
41
33
 
42
- For LLM clients, register the MCP command:
34
+ Basic discovery:
43
35
 
44
- ```json
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
- ## CLI Usage
40
+ Only public IP instances:
55
41
 
56
42
  ```bash
57
- mcp-aws-manager --pem-path /path/to/key.pem --profiles default
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
- Windows PowerShell example:
46
+ Collect runtime snapshots:
64
47
 
65
- ```powershell
66
- mcp-aws-manager --pem-path C:\Users\<you>\.ssh\mykey.pem --profiles default
48
+ ```bash
49
+ mcp-aws-manager --profiles default --runtime-snapshot
67
50
  ```
68
51
 
69
- Output format examples:
52
+ Try automatic remediation for unmanaged instances:
70
53
 
71
54
  ```bash
72
- # JSON (default)
73
- mcp-aws-manager --pem-path /path/to/key.pem --profiles default
74
-
75
- # CSV
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
- Optional SSH reachability check:
61
+ Output CSV file:
80
62
 
81
63
  ```bash
82
- mcp-aws-manager --pem-path /path/to/key.pem --profiles default --ssh-check
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
- Then configure your MCP-compatible client (Claude Desktop, Cursor, Cline, etc.) to launch that command.
75
+ Exposed MCP tools:
94
76
 
95
- See `MCP_CLIENT_SETUP.md` for ready-to-copy config examples.
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
- ## Requirements
93
+ ## Human-in-the-loop Behavior
116
94
 
117
- - Node.js `>=18`
118
- - AWS credentials/profile on the machine running the CLI/MCP server
119
- - Local PEM file path(s) (current discovery tool is PEM-based)
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
- - Do not paste PEM contents into LLM chats.
124
- - Pass only local file paths (`pemPath` or `pemPaths`) to the MCP tool.
125
- - Keep AWS credentials and PEM keys on the machine running the tool.
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 also available:
111
+ These legacy commands are still available:
130
112
 
131
113
  - `mcp-aws-discover`
132
- - `mcp-aws-discover-mcp`
114
+ - `mcp-aws-discover-mcp`