awslabs.nova-canvas-mcp-server 1.0.0__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/Dockerfile +13 -10
  2. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/PKG-INFO +6 -4
  3. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/README.md +5 -3
  4. awslabs_nova_canvas_mcp_server-1.0.2/awslabs/__init__.py +15 -0
  5. awslabs_nova_canvas_mcp_server-1.0.2/awslabs/nova_canvas_mcp_server/__init__.py +16 -0
  6. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/awslabs/nova_canvas_mcp_server/consts.py +9 -6
  7. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/awslabs/nova_canvas_mcp_server/models.py +9 -6
  8. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/awslabs/nova_canvas_mcp_server/novacanvas.py +9 -6
  9. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/awslabs/nova_canvas_mcp_server/server.py +9 -6
  10. awslabs_nova_canvas_mcp_server-1.0.2/docker-healthcheck.sh +26 -0
  11. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/pyproject.toml +1 -1
  12. awslabs_nova_canvas_mcp_server-1.0.2/tests/__init__.py +14 -0
  13. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/tests/conftest.py +9 -6
  14. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/tests/test_models.py +9 -6
  15. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/tests/test_novacanvas.py +9 -6
  16. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/tests/test_server.py +9 -6
  17. awslabs_nova_canvas_mcp_server-1.0.2/uv-requirements.txt +26 -0
  18. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/uv.lock +4 -3
  19. awslabs_nova_canvas_mcp_server-1.0.0/.pre-commit-config.yaml +0 -14
  20. awslabs_nova_canvas_mcp_server-1.0.0/awslabs/__init__.py +0 -12
  21. awslabs_nova_canvas_mcp_server-1.0.0/awslabs/nova_canvas_mcp_server/__init__.py +0 -13
  22. awslabs_nova_canvas_mcp_server-1.0.0/docker-healthcheck.sh +0 -12
  23. awslabs_nova_canvas_mcp_server-1.0.0/run_tests.sh +0 -156
  24. awslabs_nova_canvas_mcp_server-1.0.0/tests/__init__.py +0 -11
  25. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/.gitignore +0 -0
  26. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/.python-version +0 -0
  27. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/CHANGELOG.md +0 -0
  28. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/LICENSE +0 -0
  29. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/NOTICE +0 -0
  30. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/tests/.gitignore +0 -0
  31. {awslabs_nova_canvas_mcp_server-1.0.0 → awslabs_nova_canvas_mcp_server-1.0.2}/tests/README.md +0 -0
@@ -1,16 +1,19 @@
1
1
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
5
6
  #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
7
8
  #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
11
14
 
12
15
  #FROM public.ecr.aws/sam/build-python3.10:1.137.1-20250411084548
13
- FROM public.ecr.aws/sam/build-python3.10@sha256:e78695db10ca8cb129e59e30f7dc9789b0dbd0181dba195d68419c72bac51ac1 AS uv
16
+ FROM public.ecr.aws/sam/build-python3.10@sha256:d821662474d65f3cf2fc97dba2fa807a3adb580d02895fc4545527812550ea65 AS uv
14
17
 
15
18
  # Install the project into `/app`
16
19
  WORKDIR /app
@@ -28,11 +31,11 @@ ENV UV_PYTHON_PREFERENCE=only-system
28
31
  ENV UV_FROZEN=true
29
32
 
30
33
  # Copy the required files first
31
- COPY pyproject.toml uv.lock ./
34
+ COPY pyproject.toml uv.lock uv-requirements.txt ./
32
35
 
33
36
  # Install the project's dependencies using the lockfile and settings
34
37
  RUN --mount=type=cache,target=/root/.cache/uv \
35
- pip install uv && \
38
+ pip install --require-hashes --requirement uv-requirements.txt && \
36
39
  uv sync --frozen --no-install-project --no-dev --no-editable
37
40
 
38
41
  # Then, add the rest of the project source code and install it
@@ -44,7 +47,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
44
47
  # Make the directory just in case it doesn't exist
45
48
  RUN mkdir -p /root/.local
46
49
 
47
- FROM public.ecr.aws/sam/build-python3.10@sha256:e78695db10ca8cb129e59e30f7dc9789b0dbd0181dba195d68419c72bac51ac1
50
+ FROM public.ecr.aws/sam/build-python3.10@sha256:d821662474d65f3cf2fc97dba2fa807a3adb580d02895fc4545527812550ea65
48
51
 
49
52
  # Place executables in the environment at the front of the path and include other binaries
50
53
  ENV PATH="/app/.venv/bin:$PATH:/usr/sbin"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.nova-canvas-mcp-server
3
- Version: 1.0.0
3
+ Version: 1.0.2
4
4
  Summary: An AWS Labs Model Context Protocol (MCP) server for Amazon Nova Canvas
5
5
  Project-URL: Homepage, https://awslabs.github.io/mcp/
6
6
  Project-URL: Documentation, https://awslabs.github.io/mcp/servers/nova-mcp-server/
@@ -71,7 +71,9 @@ MCP server for generating images using Amazon Nova Canvas
71
71
 
72
72
  ## Installation
73
73
 
74
- Here are some ways you can work with MCP across AWS, and we'll be adding support to more products including Amazon Q Developer CLI soon: (e.g. for Amazon Q Developer CLI MCP, `~/.aws/amazonq/mcp.json`):
74
+ [![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/install-mcp?name=awslabs.nova-canvas-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGF3c2xhYnMubm92YS1jYW52YXMtbWNwLXNlcnZlckBsYXRlc3QiLCJlbnYiOnsiQVdTX1BST0ZJTEUiOiJ5b3VyLWF3cy1wcm9maWxlIiwiQVdTX1JFR0lPTiI6InVzLWVhc3QtMSIsIkZBU1RNQ1BfTE9HX0xFVkVMIjoiRVJST1IifSwiZGlzYWJsZWQiOmZhbHNlLCJhdXRvQXBwcm92ZSI6W119)
75
+
76
+ Configure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit `~/.aws/amazonq/mcp.json`):
75
77
 
76
78
  ```json
77
79
  {
@@ -91,10 +93,10 @@ Here are some ways you can work with MCP across AWS, and we'll be adding support
91
93
  }
92
94
  ```
93
95
 
94
- or docker after a succesful `docker build -t awslabs/nova-canvas-mcp-server .`:
96
+ or docker after a successful `docker build -t awslabs/nova-canvas-mcp-server .`:
95
97
 
96
98
  ```file
97
- # ficticious `.env` file with AWS temporary credentials
99
+ # fictitious `.env` file with AWS temporary credentials
98
100
  AWS_ACCESS_KEY_ID=ASIAIOSFODNN7EXAMPLE
99
101
  AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
100
102
  AWS_SESSION_TOKEN=AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
@@ -38,7 +38,9 @@ MCP server for generating images using Amazon Nova Canvas
38
38
 
39
39
  ## Installation
40
40
 
41
- Here are some ways you can work with MCP across AWS, and we'll be adding support to more products including Amazon Q Developer CLI soon: (e.g. for Amazon Q Developer CLI MCP, `~/.aws/amazonq/mcp.json`):
41
+ [![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/install-mcp?name=awslabs.nova-canvas-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGF3c2xhYnMubm92YS1jYW52YXMtbWNwLXNlcnZlckBsYXRlc3QiLCJlbnYiOnsiQVdTX1BST0ZJTEUiOiJ5b3VyLWF3cy1wcm9maWxlIiwiQVdTX1JFR0lPTiI6InVzLWVhc3QtMSIsIkZBU1RNQ1BfTE9HX0xFVkVMIjoiRVJST1IifSwiZGlzYWJsZWQiOmZhbHNlLCJhdXRvQXBwcm92ZSI6W119)
42
+
43
+ Configure the MCP server in your MCP client configuration (e.g., for Amazon Q Developer CLI, edit `~/.aws/amazonq/mcp.json`):
42
44
 
43
45
  ```json
44
46
  {
@@ -58,10 +60,10 @@ Here are some ways you can work with MCP across AWS, and we'll be adding support
58
60
  }
59
61
  ```
60
62
 
61
- or docker after a succesful `docker build -t awslabs/nova-canvas-mcp-server .`:
63
+ or docker after a successful `docker build -t awslabs/nova-canvas-mcp-server .`:
62
64
 
63
65
  ```file
64
- # ficticious `.env` file with AWS temporary credentials
66
+ # fictitious `.env` file with AWS temporary credentials
65
67
  AWS_ACCESS_KEY_ID=ASIAIOSFODNN7EXAMPLE
66
68
  AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
67
69
  AWS_SESSION_TOKEN=AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
@@ -0,0 +1,15 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ # This file is part of the awslabs namespace.
15
+ # It is intentionally minimal to support PEP 420 namespace packages.
@@ -0,0 +1,16 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """awslabs.nova-canvas-mcp-server"""
15
+
16
+ __version__ = '0.1.6'
@@ -1,13 +1,16 @@
1
1
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
5
6
  #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
7
8
  #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
11
14
  # Constants
12
15
  NOVA_CANVAS_MODEL_ID = 'amazon.nova-canvas-v1:0'
13
16
  DEFAULT_WIDTH = 1024
@@ -1,13 +1,16 @@
1
1
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
5
6
  #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
7
8
  #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
11
14
  """Pydantic models for Amazon Nova Canvas image generation."""
12
15
 
13
16
  import random
@@ -1,13 +1,16 @@
1
1
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
5
6
  #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
7
8
  #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
11
14
  """Amazon Nova Canvas API interaction module.
12
15
 
13
16
  This module provides functions for generating images using Amazon Nova Canvas
@@ -1,13 +1,16 @@
1
1
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
5
6
  #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
7
8
  #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
11
14
  """Nova Canvas MCP Server implementation."""
12
15
 
13
16
  import boto3
@@ -0,0 +1,26 @@
1
+ #!/bin/sh
2
+
3
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ if [ "$(lsof +c 0 -p 1 | grep -e "^awslabs\..*\s1\s.*\sunix\s.*socket$" | wc -l)" -ne "0" ]; then
18
+ echo -n "$(lsof +c 0 -p 1 | grep -e "^awslabs\..*\s1\s.*\sunix\s.*socket$" | wc -l) awslabs.* streams found";
19
+ exit 0;
20
+ else
21
+ echo -n "Zero awslabs.* streams found";
22
+ exit 1;
23
+ fi;
24
+
25
+ echo -n "Never should reach here";
26
+ exit 99;
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "awslabs.nova-canvas-mcp-server"
3
- version = "1.0.0"
3
+ version = "1.0.2"
4
4
  description = "An AWS Labs Model Context Protocol (MCP) server for Amazon Nova Canvas"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -0,0 +1,14 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """Tests for the nova-canvas-mcp-server."""
@@ -1,13 +1,16 @@
1
1
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
5
6
  #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
7
8
  #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
11
14
  """Test fixtures for the nova-canvas-mcp-server tests."""
12
15
 
13
16
  import base64
@@ -1,13 +1,16 @@
1
1
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
5
6
  #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
7
8
  #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
11
14
  """Tests for the models module of the nova-canvas-mcp-server."""
12
15
 
13
16
  import pytest
@@ -1,13 +1,16 @@
1
1
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
5
6
  #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
7
8
  #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
11
14
  """Tests for the novacanvas module of the nova-canvas-mcp-server."""
12
15
 
13
16
  import base64
@@ -1,13 +1,16 @@
1
1
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
5
6
  #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
7
8
  #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
11
14
  """Tests for the server module of the nova-canvas-mcp-server."""
12
15
 
13
16
  import pytest
@@ -0,0 +1,26 @@
1
+ #
2
+ # This file is autogenerated by pip-compile with Python 3.10
3
+ # by the following command:
4
+ #
5
+ # pip-compile --generate-hashes --output-file=uv-requirements.txt --strip-extras uv-requirements-0.7.13.in
6
+ #
7
+ uv==0.7.13 \
8
+ --hash=sha256:05f3c03c4ea55d294f3da725b6c2c2ff544754c18552da7594def4ec3889dcfb \
9
+ --hash=sha256:1afdbfcabc3425b383141ba42d413841c0a48b9ee0f4da65459313275e3cea84 \
10
+ --hash=sha256:33837aca7bdf02d47554d5d44f9e71756ee17c97073b07b4afead25309855bc7 \
11
+ --hash=sha256:4efa555b217e15767f0691a51d435f7bb2b0bf473fdfd59f173aeda8a93b8d17 \
12
+ --hash=sha256:4f828174e15a557d3bc0f809de76135c3b66bcbf524657f8ced9d22fc978b89c \
13
+ --hash=sha256:527a12d0c2f4d15f72b275b6f4561ae92af76dd59b4624796fddd45867f13c33 \
14
+ --hash=sha256:5786a29e286f2cc3cbda13a357fd9a4dd5bf1d7448a9d3d842b26b4f784a3a86 \
15
+ --hash=sha256:59915aec9fd2b845708a76ddc6c0639cfc99b6e2811854ea2425ee7552aff0e9 \
16
+ --hash=sha256:721b058064150fc1c6d88e277af093d1b4f8bb7a59546fe9969d9ff7dbe3f6fd \
17
+ --hash=sha256:866cad0d04a7de1aaa3c5cbef203f9d3feef9655972dcccc3283d60122db743b \
18
+ --hash=sha256:88fcf2bfbb53309531a850af50d2ea75874099b19d4159625d0b4f88c53494b9 \
19
+ --hash=sha256:8c0c29a2089ff9011d6c3abccd272f3ee6d0e166dae9e5232099fd83d26104d9 \
20
+ --hash=sha256:9c457a84cfbe2019ba301e14edd3e1c950472abd0b87fc77622ab3fc475ba012 \
21
+ --hash=sha256:9d2952a1e74c7027347c74cee1cb2be09121a5290db38498b8b17ff585f73748 \
22
+ --hash=sha256:a51006c7574e819308d92a3452b22d5bd45ef8593a4983b5856aa7cb8220885f \
23
+ --hash=sha256:b1af81e57d098b21b28f42ec756f0e26dce2341d59ba4e4f11759bc3ca2c0a99 \
24
+ --hash=sha256:e077dcac19e564cae8b4223b7807c2f617a59938f8142ca77fc6348ae9c6d0aa \
25
+ --hash=sha256:f28e70baadfebe71dcc2d9505059b988d75e903fc62258b102eb87dc4b6994a3
26
+ # via -r uv-requirements-0.7.13.in (contents of `uv==0.7.13`)
@@ -370,13 +370,14 @@ wheels = [
370
370
 
371
371
  [[package]]
372
372
  name = "h11"
373
- version = "0.14.0"
373
+ version = "0.16.0"
374
374
  source = { registry = "https://pypi.org/simple" }
375
- sdist = { url = "https://files.pythonhosted.org/packages/f5/38/3af3d3633a34a3316095b39c8e8fb4853a28a536e55d347bd8d8e9a14b03/h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d", size = 100418, upload-time = "2022-09-25T15:40:01.519Z" }
375
+ sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" }
376
376
  wheels = [
377
- { url = "https://files.pythonhosted.org/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761", size = 58259, upload-time = "2022-09-25T15:39:59.68Z" },
377
+ { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" },
378
378
  ]
379
379
 
380
+
380
381
  [[package]]
381
382
  name = "httpcore"
382
383
  version = "1.0.7"
@@ -1,14 +0,0 @@
1
- repos:
2
- - repo: https://github.com/astral-sh/ruff-pre-commit
3
- rev: v0.9.6
4
- hooks:
5
- - id: ruff
6
- args: [--fix]
7
- - id: ruff-format
8
-
9
- - repo: https://github.com/commitizen-tools/commitizen
10
- rev: v3.13.0
11
- hooks:
12
- - id: commitizen
13
- - id: commitizen-branch
14
- stages: [pre-push]
@@ -1,12 +0,0 @@
1
- # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
11
- # This file is part of the awslabs namespace.
12
- # It is intentionally minimal to support PEP 420 namespace packages.
@@ -1,13 +0,0 @@
1
- # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
11
- """awslabs.nova-canvas-mcp-server"""
12
-
13
- __version__ = '0.1.6'
@@ -1,12 +0,0 @@
1
- #!/bin/sh
2
-
3
- if [ "$(lsof +c 0 -p 1 | grep -e "^awslabs\..*\s1\s.*\sunix\s.*socket$" | wc -l)" -ne "0" ]; then
4
- echo -n "$(lsof +c 0 -p 1 | grep -e "^awslabs\..*\s1\s.*\sunix\s.*socket$" | wc -l) awslabs.* streams found";
5
- exit 0;
6
- else
7
- echo -n "Zero awslabs.* streams found";
8
- exit 1;
9
- fi;
10
-
11
- echo -n "Never should reach here";
12
- exit 99;
@@ -1,156 +0,0 @@
1
- #!/bin/bash
2
- # Script to run the nova-canvas-mcp-server tests
3
-
4
- # Set the Python path to include the current directory and the parent directory
5
- export PYTHONPATH=$PYTHONPATH:$(pwd):$(pwd)/..
6
-
7
- # Check if we're in a virtual environment
8
- if [ -z "$VIRTUAL_ENV" ]; then
9
- echo "Warning: You are not running in a virtual environment."
10
- echo "It's recommended to create and activate a virtual environment before running tests."
11
- echo "You can create one with: python -m venv venv"
12
- echo "And activate it with: source venv/bin/activate (Linux/Mac) or venv\\Scripts\\activate (Windows)"
13
- echo "Continuing without a virtual environment..."
14
- echo ""
15
- fi
16
-
17
- # Always use python -m pytest to ensure we use the correct pytest
18
- PYTEST_CMD="python -m pytest"
19
-
20
- # Check if pytest and other dependencies are installed
21
- echo "Checking for required packages..."
22
- MISSING_PACKAGES=()
23
-
24
- # Check for pytest
25
- python -c "import pytest" 2>/dev/null
26
- if [ $? -ne 0 ]; then
27
- MISSING_PACKAGES+=("pytest pytest-asyncio pytest-cov")
28
- fi
29
-
30
- # Check for boto3 package
31
- python -c "import boto3" 2>/dev/null
32
- if [ $? -ne 0 ]; then
33
- MISSING_PACKAGES+=("boto3")
34
- fi
35
-
36
- # Check for loguru package
37
- python -c "import loguru" 2>/dev/null
38
- if [ $? -ne 0 ]; then
39
- MISSING_PACKAGES+=("loguru")
40
- fi
41
-
42
- # Check for pydantic package
43
- python -c "import pydantic" 2>/dev/null
44
- if [ $? -ne 0 ]; then
45
- MISSING_PACKAGES+=("pydantic")
46
- fi
47
-
48
- # Install missing packages
49
- if [ ${#MISSING_PACKAGES[@]} -gt 0 ]; then
50
- echo "Installing missing packages: ${MISSING_PACKAGES[*]}"
51
-
52
- # Try pip first (more reliable)
53
- if command -v pip &> /dev/null; then
54
- echo "Using pip to install packages..."
55
- pip install ${MISSING_PACKAGES[*]} -v
56
- # Try pip3 if pip is not available
57
- elif command -v pip3 &> /dev/null; then
58
- echo "Using pip3 to install packages..."
59
- pip3 install ${MISSING_PACKAGES[*]} -v
60
- # Try uv as a last resort
61
- elif command -v uv &> /dev/null; then
62
- echo "Using uv to install packages..."
63
- uv pip install ${MISSING_PACKAGES[*]} -v
64
- else
65
- echo "Error: No package manager (pip, pip3, or uv) is available. Please install the missing packages manually."
66
- exit 1
67
- fi
68
-
69
- # Verify installation with more verbose output
70
- echo "Verifying package installations..."
71
- for pkg in "pytest" "boto3" "loguru" "pydantic"; do
72
- echo "Checking for $pkg..."
73
- python -c "import $pkg; print(f'$pkg version: {$pkg.__version__}')" 2>/dev/null
74
- if [ $? -ne 0 ]; then
75
- echo "Failed to install $pkg. Trying to install it individually..."
76
- pip install $pkg -v || pip3 install $pkg -v || echo "Failed to install $pkg. Please install it manually."
77
-
78
- # Check again
79
- python -c "import $pkg" 2>/dev/null
80
- if [ $? -ne 0 ]; then
81
- echo "Still failed to install $pkg. Please install it manually."
82
- echo "You can try: pip install $pkg"
83
- exit 1
84
- fi
85
- fi
86
- done
87
- fi
88
-
89
- # Print debug information
90
- echo "Debug information:"
91
- echo "Python version: $(python --version)"
92
- echo "Python path: $PYTHONPATH"
93
- echo "Current directory: $(pwd)"
94
- echo "Python executable: $(which python)"
95
- echo "Pytest module location: $(python -c "import pytest; print(pytest.__file__)" 2>/dev/null || echo "Not found")"
96
-
97
- # Check if nova_canvas_mcp_server module can be imported
98
- echo "Checking if nova_canvas_mcp_server module can be imported..."
99
- python -c "import awslabs.nova_canvas_mcp_server; print(f'nova_canvas_mcp_server module found at: {awslabs.nova_canvas_mcp_server.__file__}')" 2>/dev/null
100
- if [ $? -ne 0 ]; then
101
- echo "Warning: nova_canvas_mcp_server module cannot be imported. This may cause test failures."
102
- echo "Installing the package in development mode..."
103
-
104
- # Check if uv is available
105
- if command -v uv &> /dev/null; then
106
- uv pip install -e .
107
- # Check if pip is available
108
- elif command -v pip &> /dev/null; then
109
- pip install -e .
110
- else
111
- echo "Neither uv nor pip is available. Creating a symbolic link instead..."
112
- # Create a symbolic link to the module in the current directory
113
- ln -sf $(pwd)/awslabs/nova_canvas_mcp_server $(pwd)/nova_canvas_mcp_server 2>/dev/null
114
- fi
115
-
116
- echo "Trying again..."
117
- python -c "import awslabs.nova_canvas_mcp_server; print(f'nova_canvas_mcp_server module found at: {awslabs.nova_canvas_mcp_server.__file__}')" 2>/dev/null
118
- if [ $? -ne 0 ]; then
119
- echo "Still cannot import nova_canvas_mcp_server module. Tests may fail."
120
- echo "Directory structure:"
121
- ls -la
122
- echo "awslabs directory:"
123
- ls -la awslabs 2>/dev/null || echo "awslabs directory not found"
124
- fi
125
- fi
126
-
127
- # Check if tests directory exists
128
- if [ -d "tests" ]; then
129
- # List test files
130
- echo "Test files found:"
131
- find tests -name "test_*.py" | sort
132
-
133
- # Run the tests
134
- echo "Running tests..."
135
- $PYTEST_CMD -xvs tests/
136
-
137
- # If pytest fails, try using unittest as a fallback
138
- if [ $? -ne 0 ]; then
139
- echo "Pytest failed. Trying to run tests with unittest as a fallback..."
140
- python -m unittest discover -s tests
141
- fi
142
-
143
- # Run tests with coverage
144
- echo "Running tests with coverage..."
145
- $PYTEST_CMD --cov --cov-branch --cov-report=term-missing tests/
146
-
147
- # For GitHub Actions, provide an alternative command that uses python -m pytest
148
- if [ -n "$GITHUB_ACTIONS" ]; then
149
- echo "Running tests with python -m pytest for GitHub Actions..."
150
- python -m pytest --cov --cov-branch --cov-report=term-missing --cov-report=xml:nova-canvas-mcp-server-coverage.xml tests/
151
- fi
152
- else
153
- echo "No tests directory found, skipping tests"
154
- fi
155
-
156
- echo "Test run completed."
@@ -1,11 +0,0 @@
1
- # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
4
- # with the License. A copy of the License is located at
5
- #
6
- # http://www.apache.org/licenses/LICENSE-2.0
7
- #
8
- # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
9
- # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
- # and limitations under the License.
11
- """Tests for the nova-canvas-mcp-server."""