Skip to content

Drop the config file - #5

Merged
winebarrel merged 1 commit into
mainfrom
drop-config-file
Aug 9, 2026
Merged

Drop the config file#5
winebarrel merged 1 commit into
mainfrom
drop-config-file

Conversation

@winebarrel

Copy link
Copy Markdown
Owner

Everything the proxy needs is already in the environment and the shared AWS config, so there is nothing left to configure. The YAML config file, Config/LoadConfig and --config are gone.

Where the settings went

was in the config file now
endpoint -e/--endpoint ($AWSMCPROXY_ENDPOINT), a full URL, not a region
service / signing_region inferred from the endpoint hostname, as before
profiles[].name / aws_profile the AWS profile names in ~/.aws/config and ~/.aws/credentials
profiles[].region that profile's own region, resolved by the SDK the way the AWS CLI resolves it
profiles[].metadata gone

Registering the proxy is now just:

{ "mcpServers": { "awsmcproxy": { "command": "awsmcproxy" } } }

Reading the profile list

aws-sdk-go-v2 has no exported API to enumerate profiles -- LoadSharedConfigProfile loads one by name, and internal/ini cannot be imported from another module -- so the section names are read directly.

The naming rules follow aws-sdk-go-v2 rather than botocore, because the names are handed straight back to the SDK and a name list_profiles reports must be one the SDK accepts. The two differ:

botocore aws-sdk-go-v2
[profile foo] shlex.split, so [profile "my dev"] works TrimPrefix only
[Default] not matched matched (EqualFold)
[profile foo] in the credentials file becomes a profile named profile foo dropped

Tool schemas

The valid profile names are no longer enumerated in each tool's schema. The list is read from the shared config on every use, so a profile added while the proxy is running works without a restart -- freezing the names into the schema at startup would go stale. list_profiles is the discovery path, and it returns names only: a profile name is the whole identity of a profile in the shared config.

profile stays required on every mirrored tool. That is what the proxy is for.

Startup

Listing the tools to mirror needs some identity, and any will do, so the proxy tries the default credential chain first and then each profile in turn, reporting every failure if none connect. That bootstrap connection is closed once the tools are known; the connections that serve tool calls are opened per profile on demand.

Tests

93.1% of the package. The profile-reading rules are covered directly, and the end-to-end tests assert that each profile's own region reaches the server as AWS_REGION metadata while the endpoint's region signs the request.

Still not verified against the real endpoint -- the local AWS session is expired.

Everything the proxy needs is already in the environment and the shared AWS
config, so there is nothing left to configure. Profiles are read from
~/.aws/config and ~/.aws/credentials, each profile's region becomes its
AWS_REGION metadata, and a list_profiles tool tells the agent which names it
can use.

Profile names follow aws-sdk-go-v2's rules rather than botocore's, since the
names are handed straight back to the SDK. The SDK has no exported API to
enumerate them, so the section names are read directly.

The endpoint moves to a kong option, -e/--endpoint ($AWSMCPROXY_ENDPOINT). It
takes a full URL rather than a region.

The valid profile names are no longer enumerated in the tool schemas: the list
is read on every use, so a profile added while the proxy is running works
without a restart.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@winebarrel
winebarrel enabled auto-merge August 9, 2026 03:53
@winebarrel
winebarrel merged commit e7ccb58 into main Aug 9, 2026
3 checks passed
@winebarrel
winebarrel deleted the drop-config-file branch August 9, 2026 03:54
@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.07692% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.12%. Comparing base (9d7cb2b) to head (fa3a168).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
proxy.go 92.59% 2 Missing and 2 partials ⚠️
profiles.go 94.11% 2 Missing and 1 partial ⚠️
handler.go 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
- Coverage   92.60%   91.12%   -1.48%     
==========================================
  Files           5        5              
  Lines         365      372       +7     
==========================================
+ Hits          338      339       +1     
- Misses         15       19       +4     
- Partials       12       14       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant