Skip to content

Commit 5be1c50

Browse files
acmlauarangatang
andauthored
Make endpoint positional argument (#12)
* Make endpoint positional argument * Update DEVELOPMENT.md Co-authored-by: Leonardo Araneda Freccero <arangatang@users.noreply.github.com> Signed-off-by: Anna Lau <66322063+acmlau@users.noreply.github.com> --------- Signed-off-by: Anna Lau <66322063+acmlau@users.noreply.github.com> Co-authored-by: Leonardo Araneda Freccero <arangatang@users.noreply.github.com>
1 parent d70345a commit 5be1c50

5 files changed

Lines changed: 14 additions & 17 deletions

File tree

DEVELOPMENT.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
## Quickstart
22
### Running local code
33
```
4-
uv run src/aws_mcp_proxy/server.py --endpoint <your endpoint>
4+
uv run aws_mcp_proxy/server.py <your endpoint>
55
```
66

77
### Running local code with MCP inspector
88
```
99
npx @modelcontextprotocol/inspector uv run \
10-
src/aws_mcp_proxy/server.py \
11-
--endpoint <your endpoint>
10+
aws_mcp_proxy/server.py <your endpoint>
1211
```
1312
Then click connect in the opened browser window.

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The proxy handles SigV4 authentication using local AWS credentials and provides
2121
### Quick start
2222

2323
```bash
24-
uv run src/aws_mcp_proxy/server.py --endpoint <a sigv4 mcp>
24+
uv run aws_mcp_proxy/server.py <a sigv4 mcp>
2525
```
2626

2727
#### Details
@@ -49,10 +49,9 @@ Example with all options
4949
"command": "uv",
5050
"args": [
5151
"--directory",
52-
"/path/to/aws_mcp_proxy/src/aws_mcp_proxy",
52+
"/path/to/aws_mcp_proxy",
5353
"run",
54-
"server.py",
55-
"--endpoint",
54+
"aws_mcp_proxy/server.py",
5655
"<remote-server-url>",
5756
"--service",
5857
"<service-code>",
@@ -69,7 +68,7 @@ Example with all options
6968

7069
In MCP mode, the backend server is configured directly through command-line arguments:
7170

72-
* `--endpoint`: The MCP endpoint URL (required)
71+
* `endpoint`: The MCP endpoint URL (required, first positional argument)
7372
* `--service`: AWS service name for SigV4 signing (optional, inferred from endpoint if not provided)
7473
* `--profile`: AWS profile to use (optional, uses AWS_PROFILE environment variable if not provided)
7574

aws_mcp_proxy/server.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,18 @@ def parse_args():
7575
epilog="""
7676
Examples:
7777
# Run with EKS MCP endpoint
78-
aws-mcp-proxy --endpoint https://eks-mcp.us-west-2.api.aws
78+
aws-mcp-proxy https://eks-mcp.us-west-2.api.aws
7979
8080
# Run with custom service and profile
81-
aws-mcp-proxy --endpoint https://eks-mcp.us-west-2.api.aws --service eks-mcp --profile default
81+
aws-mcp-proxy https://eks-mcp.us-west-2.api.aws --service eks-mcp --profile default
8282
8383
# Run with write permissions enabled
84-
aws-mcp-proxy --endpoint https://eks-mcp.us-west-2.api.aws --allow-write
84+
aws-mcp-proxy https://eks-mcp.us-west-2.api.aws --allow-write
8585
""",
8686
)
8787

8888
parser.add_argument(
89-
'--endpoint',
90-
required=True,
89+
'endpoint',
9190
help='MCP endpoint URL (e.g., https://eks-mcp.us-west-2.api.aws)',
9291
)
9392

tests/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TestMain:
2424
@patch('aws_mcp_proxy.server.asyncio.run')
2525
@patch('aws_mcp_proxy.server.setup_mcp_mode')
2626
@patch('aws_mcp_proxy.server.FastMCP')
27-
@patch('sys.argv', ['aws-mcp-proxy', '--endpoint', 'https://test.example.com'])
27+
@patch('sys.argv', ['aws-mcp-proxy', 'https://test.example.com'])
2828
def test_main_default(self, mock_fastmcp, mock_setup_mcp, mock_asyncio_run):
2929
"""Test main function with default arguments."""
3030
# Create mock FastMCP instance

tests/test_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,14 @@ async def test_setup_mcp_mode_tool_registration_error(
127127
await setup_mcp_mode(mock_mcp, mock_args)
128128
assert 'Tool registration failed' in str(exc_info.value)
129129

130-
@patch('sys.argv', ['test', '--endpoint', 'https://test.example.com'])
130+
@patch('sys.argv', ['test', 'https://test.example.com'])
131131
def test_parse_args_default(self):
132132
"""Test parse_args with default arguments."""
133133
args = parse_args()
134134
assert args.endpoint == 'https://test.example.com'
135135

136136
@patch('aws_mcp_proxy.server.asyncio.run')
137-
@patch('sys.argv', ['test', '--endpoint', 'https://test.example.com'])
137+
@patch('sys.argv', ['test', 'https://test.example.com'])
138138
def test_main_function(self, mock_asyncio_run):
139139
"""Test that main function runs server correctly."""
140140
# Arrange
@@ -147,7 +147,7 @@ def test_main_function(self, mock_asyncio_run):
147147
mock_asyncio_run.assert_called_once()
148148

149149
@patch('aws_mcp_proxy.server.asyncio.run')
150-
@patch('sys.argv', ['test', '--endpoint', 'https://test.example.com'])
150+
@patch('sys.argv', ['test', 'https://test.example.com'])
151151
def test_main_error_handling(self, mock_asyncio_run):
152152
"""Test that main function handles errors gracefully."""
153153
# Arrange

0 commit comments

Comments
 (0)