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.
@@ -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
- npm install -g @soybin/mcp-aws-manager
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
  {
@@ -61,7 +54,7 @@ This can be useful for clients that support `npx` commands.
61
54
  "args": [
62
55
  "-y",
63
56
  "-p",
64
- "@soybin/mcp-aws-manager",
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
- - 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
- # @soybin/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,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 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
 
20
21
  ```bash
21
- npm install -g @soybin/mcp-aws-manager
22
+ npm install -g mcp-aws-manager
22
23
  ```
23
24
 
24
- ## Quick Start
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
- # multiple explicit PEM paths (comma-separated)
34
- 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`)
35
31
 
36
- # no args: auto-uses all *.pem in current directory
37
- cd /path/that/contains/pem
38
- mcp-aws-manager
39
- ```
32
+ ## Quick Start
40
33
 
41
- 3. For LLM clients, register the MCP command:
34
+ Basic discovery:
42
35
 
43
- ```json
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
- ## CLI Usage
40
+ Only public IP instances:
54
41
 
55
42
  ```bash
56
- mcp-aws-manager --pem-path /path/to/key.pem --profiles default
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
- Windows PowerShell example:
46
+ Collect runtime snapshots:
63
47
 
64
- ```powershell
65
- mcp-aws-manager --pem-path C:\Users\<you>\.ssh\mykey.pem --profiles default
48
+ ```bash
49
+ mcp-aws-manager --profiles default --runtime-snapshot
66
50
  ```
67
51
 
68
- Output format examples:
52
+ Try automatic remediation for unmanaged instances:
69
53
 
70
54
  ```bash
71
- # JSON (default)
72
- mcp-aws-manager --pem-path /path/to/key.pem --profiles default
73
-
74
- # CSV
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
- Optional SSH reachability check:
61
+ Output CSV file:
79
62
 
80
63
  ```bash
81
- mcp-aws-manager --pem-path /path/to/key.pem --profiles default --ssh-check
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
- Then configure your MCP-compatible client (Claude Desktop, Cursor, Cline, etc.) to launch that command.
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
- - `discover_public_ec2_with_pem`
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
- ## Requirements
93
+ ## Human-in-the-loop Behavior
115
94
 
116
- - Node.js `>=18`
117
- - AWS credentials/profile on the machine running the CLI/MCP server
118
- - 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.
119
102
 
120
103
  ## Security Notes
121
104
 
122
- - Do not paste PEM contents into LLM chats.
123
- - Pass only local file paths (`pemPath` or `pemPaths`) to the MCP tool.
124
- - 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`.
125
108
 
126
109
  ## Compatibility Aliases
127
110
 
128
- These legacy commands are also available:
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`