Drop the config file - #5
Merged
Merged
Conversation
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>
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/LoadConfigand--configare gone.Where the settings went
endpoint-e/--endpoint($AWSMCPROXY_ENDPOINT), a full URL, not a regionservice/signing_regionprofiles[].name/aws_profile~/.aws/configand~/.aws/credentialsprofiles[].regionregion, resolved by the SDK the way the AWS CLI resolves itprofiles[].metadataRegistering the proxy is now just:
{ "mcpServers": { "awsmcproxy": { "command": "awsmcproxy" } } }Reading the profile list
aws-sdk-go-v2 has no exported API to enumerate profiles --
LoadSharedConfigProfileloads one by name, andinternal/inicannot 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_profilesreports must be one the SDK accepts. The two differ:[profile foo]shlex.split, so[profile "my dev"]worksTrimPrefixonly[Default]EqualFold)[profile foo]in the credentials fileprofile fooTool 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_profilesis the discovery path, and it returns names only: a profile name is the whole identity of a profile in the shared config.profilestays 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_REGIONmetadata while the endpoint's region signs the request.Still not verified against the real endpoint -- the local AWS session is expired.