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
5 changes: 2 additions & 3 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
## Quickstart
### Running local code
```
uv run src/aws_mcp_proxy/server.py --endpoint <your endpoint>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

uv run aws_mcp_proxy/server.py <your endpoint>
```

### Running local code with MCP inspector
```
npx @modelcontextprotocol/inspector uv run \
src/aws_mcp_proxy/server.py \
--endpoint <your endpoint>
aws_mcp_proxy/server.py <your endpoint>
```
Then click connect in the opened browser window.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The proxy handles SigV4 authentication using local AWS credentials and provides
### Quick start

```bash
uv run src/aws_mcp_proxy/server.py --endpoint <a sigv4 mcp>
uv run aws_mcp_proxy/server.py <a sigv4 mcp>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets be consistent, either or (or maybe something even more descriptive?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about <SigV4 MCP endpoint URL>?

```

#### Details
Expand Down Expand Up @@ -49,10 +49,9 @@ Example with all options
"command": "uv",
"args": [
"--directory",
"/path/to/aws_mcp_proxy/src/aws_mcp_proxy",
"/path/to/aws_mcp_proxy",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While correct, just realized we need documentation on how to run the package version as well. Probs for @wzxxing to add when packaging is added.

"run",
"server.py",
"--endpoint",
"aws_mcp_proxy/server.py",
"<remote-server-url>",
"--service",
"<service-code>",
Expand All @@ -69,7 +68,7 @@ Example with all options

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

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

Expand Down
9 changes: 4 additions & 5 deletions aws_mcp_proxy/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,18 @@ def parse_args():
epilog="""
Examples:
# Run with EKS MCP endpoint
aws-mcp-proxy --endpoint https://eks-mcp.us-west-2.api.aws
aws-mcp-proxy https://eks-mcp.us-west-2.api.aws

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

# Run with write permissions enabled
aws-mcp-proxy --endpoint https://eks-mcp.us-west-2.api.aws --allow-write
aws-mcp-proxy https://eks-mcp.us-west-2.api.aws --allow-write
Comment on lines +78 to +84
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will remove all mentions of eks soon. Not a blocker just an fyi.

""",
)

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

Expand Down
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TestMain:
@patch('aws_mcp_proxy.server.asyncio.run')
@patch('aws_mcp_proxy.server.setup_mcp_mode')
@patch('aws_mcp_proxy.server.FastMCP')
@patch('sys.argv', ['aws-mcp-proxy', '--endpoint', 'https://test.example.com'])
@patch('sys.argv', ['aws-mcp-proxy', 'https://test.example.com'])
def test_main_default(self, mock_fastmcp, mock_setup_mcp, mock_asyncio_run):
"""Test main function with default arguments."""
# Create mock FastMCP instance
Expand Down
6 changes: 3 additions & 3 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ async def test_setup_mcp_mode_tool_registration_error(
await setup_mcp_mode(mock_mcp, mock_args)
assert 'Tool registration failed' in str(exc_info.value)

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

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

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