Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Optional arguments you can add:
- `--profile`: AWS profile to use (uses AWS_PROFILE environment variable if not provided)
- `--read-only`: Disable tools which 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))

NOTE: `remote-server-url` should be your remote mcp server's URL (including the `/mcp` part). `service-code` should be the service code for your own mcp service, such as `eks-mcp`.
NOTE: `remote-server-url` should be your remote mcp server's URL (including the `/mcp` part). `service-code` should be the service code for the MCP to be connected.

Example with all options
```json
Expand Down
10 changes: 5 additions & 5 deletions aws_mcp_proxy/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,20 @@ def parse_args():
formatter_class=argparse.RawDescriptionHelpFormatter,
epilog="""
Examples:
# Run with EKS MCP endpoint
aws-mcp-proxy https://eks-mcp.us-west-2.api.aws
# Run with your endpoint
aws-mcp-proxy <SigV4 MCP endpoint URL>
Comment thread
kyoncal marked this conversation as resolved.

# Run with custom service and profile
aws-mcp-proxy https://eks-mcp.us-west-2.api.aws --service eks-mcp --profile default
aws-mcp-proxy <SigV4 MCP endpoint URL> --service <aws-service> --profile default

# Run with write permissions enabled
aws-mcp-proxy https://eks-mcp.us-west-2.api.aws --read-only
aws-mcp-proxy <SigV4 MCP endpoint URL> --read-only
""",
)

parser.add_argument(
'endpoint',
help='MCP endpoint URL (e.g., https://eks-mcp.us-west-2.api.aws)',
help='SigV4 MCP endpoint URL',
)

parser.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion aws_mcp_proxy/sigv4_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def create_sigv4_auth(


def create_sigv4_client(
service: str = 'eks-mcp',
service: str,
profile: Optional[str] = None,
region: Optional[str] = None,
headers: Optional[Dict[str, str]] = None,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def test_create_sigv4_client_no_credentials(self, mock_session):

# Act & Assert
with pytest.raises(ValueError) as exc_info:
create_sigv4_client()
create_sigv4_client(service='test-service')
assert 'No AWS credentials found' in str(exc_info.value)

def test_main_module_execution(self):
Expand Down
14 changes: 8 additions & 6 deletions tests/test_sigv4_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@ def test_create_sigv4_client_default(self, mock_client_class, mock_create_auth):
mock_client_class.return_value = mock_client

# Test client creation
result = create_sigv4_client()
result = create_sigv4_client(service='test-service')

# Verify client was created correctly
mock_create_auth.assert_called_once_with('eks-mcp', None, None)
mock_create_auth.assert_called_once_with('test-service', None, None)

# Check that AsyncClient was called with correct parameters
call_args = mock_client_class.call_args
Expand All @@ -330,7 +330,7 @@ def test_create_sigv4_client_with_custom_headers(self, mock_client_class, mock_c

# Test client creation with custom headers
custom_headers = {'Custom-Header': 'custom-value'}
result = create_sigv4_client(headers=custom_headers)
result = create_sigv4_client(service='test-service', headers=custom_headers)

# Verify client was created with merged headers
call_args = mock_client_class.call_args
Expand Down Expand Up @@ -373,7 +373,9 @@ def test_create_sigv4_client_with_kwargs(self, mock_client_class, mock_create_au
mock_client_class.return_value = mock_client

# Test client creation with additional kwargs
result = create_sigv4_client(verify=False, proxies={'http': 'http://proxy:8080'})
result = create_sigv4_client(
service='test-service', verify=False, proxies={'http': 'http://proxy:8080'}
)

# Verify client was created with additional kwargs
call_args = mock_client_class.call_args
Expand Down Expand Up @@ -403,11 +405,11 @@ def test_create_sigv4_client_with_prompt_context(self, mock_client_class, mock_c
}

result = create_sigv4_client(
service='eks-mcp', headers=prompt_context_headers, region='us-west-2'
service='test-service', headers=prompt_context_headers, region='us-west-2'
)

# Verify client was created correctly with prompt context
mock_create_auth.assert_called_once_with('eks-mcp', None, 'us-west-2')
mock_create_auth.assert_called_once_with('test-service', None, 'us-west-2')

# Check that AsyncClient was called with correct parameters including prompt headers
call_args = mock_client_class.call_args
Expand Down
14 changes: 7 additions & 7 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def test_create_transport_with_sigv4(self, mock_create_sigv4_client):
mock_client = MagicMock()
mock_create_sigv4_client.return_value = mock_client

url = 'https://eks-mcp.us-west-2.api.aws/mcp'
service = 'eks-mcp'
url = 'https://test-service.us-west-2.api.aws/mcp'
service = 'test-service'
profile = 'test-profile'

result = create_transport_with_sigv4(url, service, profile)
Expand Down Expand Up @@ -65,8 +65,8 @@ def test_create_transport_with_sigv4(self, mock_create_sigv4_client):
@patch('aws_mcp_proxy.utils.create_sigv4_client')
def test_create_transport_with_sigv4_no_profile(self, mock_create_sigv4_client):
"""Test creating transport without profile."""
url = 'https://eks-mcp.us-west-2.api.aws/mcp'
service = 'eks-mcp'
url = 'https://test-service.us-west-2.api.aws/mcp'
service = 'test-service'

result = create_transport_with_sigv4(url, service)

Expand All @@ -89,7 +89,7 @@ class TestValidateRequiredArgs:

def test_validate_service_name_with_service(self):
"""Test validation when service is provided."""
endpoint = 'https://eks-mcp.us-west-2.api.aws'
endpoint = 'https://test-service.us-west-2.api.aws'
service = 'custom-service'

result = determine_service_name(endpoint, service)
Expand All @@ -98,8 +98,8 @@ def test_validate_service_name_with_service(self):

def test_validate_service_name_without_service_success(self):
"""Test validation when service is not provided but can be parsed."""
endpoint = 'https://eks-mcp.us-west-2.api.aws'
expected_service = 'eks-mcp'
endpoint = 'https://test-service.us-west-2.api.aws'
expected_service = 'test-service'

result = determine_service_name(endpoint)

Expand Down