You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: rename aws_profile to proxy_aws_profile and add AWS_MCP_PROXY_PROFILES env var
- Renamed injected tool parameter from aws_profile to proxy_aws_profile
to avoid potential collision with backend tool parameters (EKS MCP,
ECS MCP, customer-hosted servers use the same proxy)
- Added AWS_MCP_PROXY_PROFILES env var support as alternative to --profile
flag. Enables plugin integration where CLI args cannot be modified.
Format: space-separated profile names, first is default.
- --profile flag takes precedence over env var when both are set
- Documented env var in README
- Added unit tests for env var parsing and precedence
|`--service`| AWS service name for SigV4 signing, if omitted we try to infer this from the url | Inferred from endpoint if not provided |No |
100
-
|`--profile`| AWS profile(s) to use. First profile is the default. Additional profiles enable per-call switching via `aws_profile` tool parameter (e.g., `--profile default dev staging`) |Uses `AWS_PROFILE` environment variable if not set|No |
100
+
|`--profile`| AWS profile(s) to use. First profile is the default. Additional profiles enable per-call switching across accounts (e.g., `--profile default dev staging`) |Falls back to `AWS_MCP_PROXY_PROFILES` env var, then default credential chain|No |
101
101
|`--region`| AWS region to use | Uses `AWS_REGION` environment variable if not set |No |
102
102
|`--metadata`| Metadata to inject into MCP requests as key=value pairs (e.g., `--metadata KEY1=value1 KEY2=value2`) |`AWS_REGION` is automatically injected based on `--region` if not provided |No |
103
103
|`--read-only`| Disable tools which may require write permissions (tools which DO NOT require write permissions are annotated with [`readOnlyHint=true`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint)) |`False`|No |
# Multi-profile switching (alternative to --profile flag)
130
+
# Space-separated list: first is default, rest are switchable
131
+
export AWS_MCP_PROXY_PROFILES="default dev staging"
128
132
```
129
133
130
134
### Setup Examples
@@ -167,12 +171,7 @@ Add the following configuration to your MCP client config file (e.g., for Kiro C
167
171
168
172
#### Multi-account access
169
173
170
-
When multiple profiles are passed to `--profile`, individual tool calls can route through different AWS profiles without restarting the proxy. This is useful when an AI agent needs to query resources across multiple AWS accounts in a single session.
171
-
172
-
**How it works:**
173
-
- The first profile is the **default** identity used when a tool call does not specify a profile.
174
-
- Additional profiles are available for per-call switching via the `aws_profile` tool parameter. Each profile gets its own dedicated connection to the backend.
175
-
- If a tool call omits `aws_profile`, the default profile connection is used. If it includes `aws_profile`, the request is routed through the matching per-profile connection instead.
174
+
When multiple profiles are passed to `--profile`, the agent can route individual tool calls through different AWS accounts without restarting the proxy.
176
175
177
176
```json
178
177
{
@@ -194,7 +193,31 @@ When multiple profiles are passed to `--profile`, individual tool calls can rout
194
193
}
195
194
```
196
195
197
-
In the example above, tool calls without an `aws_profile` argument use the `default` profile. A tool call that includes `"aws_profile": "dev-profile"` is routed through a dedicated connection signed with `dev-profile` credentials.
196
+
**How it works:**
197
+
- The first profile (`default`) is used for all calls unless the agent specifies otherwise.
198
+
- The agent can switch to any additional profile (`dev-profile`, `staging-profile`) on a per-call basis. Each profile gets its own dedicated connection.
199
+
- Only profiles in the list are accessible — other profiles in `~/.aws/config` are not exposed.
200
+
- With a single profile (e.g., `--profile default`), no switching is available and behavior is unchanged from previous versions.
201
+
202
+
**Using an environment variable:**
203
+
204
+
As an alternative to `--profile`, set the `AWS_MCP_PROXY_PROFILES` environment variable:
0 commit comments