awslabs.cfn-mcp-server 0.0.1__tar.gz → 1.0.1__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_cfn_mcp_server-1.0.1/CHANGELOG.md +19 -0
  2. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/Dockerfile +2 -2
  3. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/PKG-INFO +27 -6
  4. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/README.md +25 -5
  5. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/awslabs/cfn_mcp_server/aws_client.py +5 -1
  6. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/awslabs/cfn_mcp_server/errors.py +1 -1
  7. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/awslabs/cfn_mcp_server/server.py +2 -14
  8. awslabs_cfn_mcp_server-1.0.1/docker-healthcheck.sh +12 -0
  9. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/pyproject.toml +2 -1
  10. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/tests/test_main.py +0 -17
  11. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/uv.lock +3 -1
  12. awslabs_cfn_mcp_server-0.0.1/CHANGELOG.md +0 -12
  13. awslabs_cfn_mcp_server-0.0.1/docker-healthcheck.sh +0 -12
  14. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/.gitignore +0 -0
  15. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/.pre-commit-config.yaml +0 -0
  16. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/.python-version +0 -0
  17. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/LICENSE +0 -0
  18. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/NOTICE +0 -0
  19. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/awslabs/__init__.py +0 -0
  20. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/awslabs/cfn_mcp_server/__init__.py +0 -0
  21. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/awslabs/cfn_mcp_server/cloud_control_utils.py +0 -0
  22. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/awslabs/cfn_mcp_server/context.py +0 -0
  23. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/awslabs/cfn_mcp_server/schema_manager.py +0 -0
  24. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/run_tests.sh +0 -0
  25. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/tests/__init__.py +0 -0
  26. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/tests/test_aws_client.py +0 -0
  27. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/tests/test_cloud_control_utils.py +0 -0
  28. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/tests/test_errors.py +0 -0
  29. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/tests/test_init.py +0 -0
  30. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/tests/test_schema_manager.py +0 -0
  31. {awslabs_cfn_mcp_server-0.0.1 → awslabs_cfn_mcp_server-1.0.1}/tests/test_server.py +0 -0
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2025-05-26
9
+
10
+ ### Removed
11
+
12
+ - **BREAKING CHANGE:** Server Sent Events (SSE) support has been removed in accordance with the Model Context Protocol specification's [backwards compatibility guidelines](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#backwards-compatibility)
13
+ - This change prepares for future support of [Streamable HTTP](https://modelcontextprotocol.io/specification/draft/basic/transports#streamable-http) transport
14
+
15
+ ## Unreleased
16
+
17
+ ### Added
18
+
19
+ - Initial project setup
@@ -10,7 +10,7 @@
10
10
  # and limitations under the License.
11
11
 
12
12
  #FROM public.ecr.aws/sam/build-python3.10:1.137.1-20250411084548
13
- FROM public.ecr.aws/sam/build-python3.10@sha256:04cdbe84bec08d17d621192bc3f0a9e4a85a83f2ac99aa9241659dfac0d845ea AS uv
13
+ FROM public.ecr.aws/sam/build-python3.10@sha256:e78695db10ca8cb129e59e30f7dc9789b0dbd0181dba195d68419c72bac51ac1 AS uv
14
14
 
15
15
  # Install the project into `/app`
16
16
  WORKDIR /app
@@ -44,7 +44,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
44
44
  # Make the directory just in case it doesn't exist
45
45
  RUN mkdir -p /root/.local
46
46
 
47
- FROM public.ecr.aws/sam/build-python3.10@sha256:04cdbe84bec08d17d621192bc3f0a9e4a85a83f2ac99aa9241659dfac0d845ea
47
+ FROM public.ecr.aws/sam/build-python3.10@sha256:e78695db10ca8cb129e59e30f7dc9789b0dbd0181dba195d68419c72bac51ac1
48
48
 
49
49
  # Place executables in the environment at the front of the path and include other binaries
50
50
  ENV PATH="/app/.venv/bin:$PATH:/usr/sbin"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.cfn-mcp-server
3
- Version: 0.0.1
3
+ Version: 1.0.1
4
4
  Summary: An AWS Labs Model Context Protocol (MCP) server for doing common cloudformation tasks and for managing your resources in your AWS account
5
5
  Project-URL: homepage, https://awslabs.github.io/mcp/
6
6
  Project-URL: docs, https://awslabs.github.io/mcp/servers/cfn-mcp-server/
@@ -22,6 +22,7 @@ Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: 3.13
23
23
  Requires-Python: >=3.10
24
24
  Requires-Dist: boto3>=1.34.0
25
+ Requires-Dist: botocore>=1.34.0
25
26
  Requires-Dist: loguru>=0.7.0
26
27
  Requires-Dist: mcp[cli]>=1.6.0
27
28
  Requires-Dist: pydantic>=2.10.6
@@ -59,11 +60,10 @@ Here are some ways you can work with MCP across AWS, and we'll be adding support
59
60
  "awslabs.cfn-mcp-server": {
60
61
  "command": "uvx",
61
62
  "args": [
62
- "awslabs.aws-cfn-mcp-server@latest",
63
- "--readonly" // Optional paramter if you would like to restrict the MCP to only read actions
63
+ "awslabs.cfn-mcp-server@latest"
64
64
  ],
65
65
  "env": {
66
- "AWS_PROFILE": "your-named-profile",
66
+ "AWS_PROFILE": "your-named-profile"
67
67
  },
68
68
  "disabled": false,
69
69
  "autoApprove": []
@@ -72,10 +72,31 @@ Here are some ways you can work with MCP across AWS, and we'll be adding support
72
72
  }
73
73
  ```
74
74
 
75
- or docker after a succesful `docker build -t awslabs/cfn-mcp-server .`:
75
+ If you would like to prevent the MCP from taking any mutating actions (i.e. Create/Update/Delete Resource), you can specify the readonly flag as demonstrated below:
76
+
77
+ ```json
78
+ {
79
+ "mcpServers": {
80
+ "awslabs.cfn-mcp-server": {
81
+ "command": "uvx",
82
+ "args": [
83
+ "awslabs.cfn-mcp-server@latest",
84
+ "--readonly"
85
+ ],
86
+ "env": {
87
+ "AWS_PROFILE": "your-named-profile"
88
+ },
89
+ "disabled": false,
90
+ "autoApprove": []
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ or docker after a successful `docker build -t awslabs/cfn-mcp-server .`:
76
97
 
77
98
  ```file
78
- # ficticious `.env` file with AWS temporary credentials
99
+ # fictitious `.env` file with AWS temporary credentials
79
100
  AWS_ACCESS_KEY_ID=ASIAIOSFODNN7EXAMPLE
80
101
  AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
81
102
  AWS_SESSION_TOKEN=AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
@@ -30,11 +30,10 @@ Here are some ways you can work with MCP across AWS, and we'll be adding support
30
30
  "awslabs.cfn-mcp-server": {
31
31
  "command": "uvx",
32
32
  "args": [
33
- "awslabs.aws-cfn-mcp-server@latest",
34
- "--readonly" // Optional paramter if you would like to restrict the MCP to only read actions
33
+ "awslabs.cfn-mcp-server@latest"
35
34
  ],
36
35
  "env": {
37
- "AWS_PROFILE": "your-named-profile",
36
+ "AWS_PROFILE": "your-named-profile"
38
37
  },
39
38
  "disabled": false,
40
39
  "autoApprove": []
@@ -43,10 +42,31 @@ Here are some ways you can work with MCP across AWS, and we'll be adding support
43
42
  }
44
43
  ```
45
44
 
46
- or docker after a succesful `docker build -t awslabs/cfn-mcp-server .`:
45
+ If you would like to prevent the MCP from taking any mutating actions (i.e. Create/Update/Delete Resource), you can specify the readonly flag as demonstrated below:
46
+
47
+ ```json
48
+ {
49
+ "mcpServers": {
50
+ "awslabs.cfn-mcp-server": {
51
+ "command": "uvx",
52
+ "args": [
53
+ "awslabs.cfn-mcp-server@latest",
54
+ "--readonly"
55
+ ],
56
+ "env": {
57
+ "AWS_PROFILE": "your-named-profile"
58
+ },
59
+ "disabled": false,
60
+ "autoApprove": []
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ or docker after a successful `docker build -t awslabs/cfn-mcp-server .`:
47
67
 
48
68
  ```file
49
- # ficticious `.env` file with AWS temporary credentials
69
+ # fictitious `.env` file with AWS temporary credentials
50
70
  AWS_ACCESS_KEY_ID=ASIAIOSFODNN7EXAMPLE
51
71
  AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
52
72
  AWS_SESSION_TOKEN=AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
@@ -9,6 +9,7 @@
9
9
  # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
10
10
  # and limitations under the License.
11
11
 
12
+ import botocore.config
12
13
  import sys
13
14
  from awslabs.cfn_mcp_server.errors import ClientError
14
15
  from boto3 import Session
@@ -16,6 +17,9 @@ from os import environ
16
17
 
17
18
 
18
19
  session = Session(profile_name=environ.get('AWS_PROFILE'))
20
+ session_config = botocore.config.Config(
21
+ user_agent_extra='cfn-mcp-server/1.0.0',
22
+ )
19
23
 
20
24
 
21
25
  def get_aws_client(service_name, region_name=None):
@@ -47,7 +51,7 @@ def get_aws_client(service_name, region_name=None):
47
51
  print(
48
52
  f'Creating new {service_name} client for region {region_name} with auto-detected credentials'
49
53
  )
50
- client = session.client(service_name, region_name=region_name)
54
+ client = session.client(service_name, region_name=region_name, config=session_config)
51
55
 
52
56
  print('Created client for service with credentials')
53
57
  return client
@@ -86,6 +86,6 @@ class ServerError(Exception):
86
86
  def __init__(self, log):
87
87
  """Call super."""
88
88
  # Call the base class constructor with the parameters it needs
89
- super().__init__('An internal error occured while processing your request')
89
+ super().__init__('An internal error occurred while processing your request')
90
90
  print(log)
91
91
  self.type = 'server'
@@ -31,11 +31,7 @@ mcp = FastMCP(
31
31
  1. Read and List all of your AWS resources by the CloudFormation type name (e.g. AWS::S3::Bucket)
32
32
  2. Create/Update/Delete your AWS resources
33
33
  """,
34
- dependencies=[
35
- 'pydantic',
36
- 'loguru',
37
- 'boto3',
38
- ],
34
+ dependencies=['pydantic', 'loguru', 'boto3', 'botocore'],
39
35
  )
40
36
 
41
37
 
@@ -358,8 +354,6 @@ def main():
358
354
  parser = argparse.ArgumentParser(
359
355
  description='An AWS Labs Model Context Protocol (MCP) server for doing common cloudformation tasks and for managing your resources in your AWS account'
360
356
  )
361
- parser.add_argument('--sse', action='store_true', help='Use SSE transport')
362
- parser.add_argument('--port', type=int, default=8888, help='Port to run the server on')
363
357
  parser.add_argument(
364
358
  '--readonly',
365
359
  action=argparse.BooleanOptionalAction,
@@ -368,13 +362,7 @@ def main():
368
362
 
369
363
  args = parser.parse_args()
370
364
  Context.initialize(args.readonly)
371
-
372
- # Run server with appropriate transport
373
- if args.sse:
374
- mcp.settings.port = args.port
375
- mcp.run(transport='sse')
376
- else:
377
- mcp.run()
365
+ mcp.run()
378
366
 
379
367
 
380
368
  if __name__ == '__main__':
@@ -0,0 +1,12 @@
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,6 +1,6 @@
1
1
  [project]
2
2
  name = "awslabs.cfn-mcp-server"
3
- version = "0.0.1"
3
+ version = "1.0.1"
4
4
  description = "An AWS Labs Model Context Protocol (MCP) server for doing common cloudformation tasks and for managing your resources in your AWS account"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -9,6 +9,7 @@ dependencies = [
9
9
  "pydantic>=2.10.6",
10
10
  "mcp[cli]>=1.6.0",
11
11
  "boto3>=1.34.0",
12
+ "botocore>=1.34.0",
12
13
  ]
13
14
  license = {text = "Apache-2.0"}
14
15
  license-files = ["LICENSE", "NOTICE" ]
@@ -26,23 +26,6 @@ class TestMain:
26
26
 
27
27
  # Check that mcp.run was called with the correct arguments
28
28
  mock_run.assert_called_once()
29
- assert mock_run.call_args[1].get('transport') is None
30
-
31
- @patch('awslabs.cfn_mcp_server.server.mcp.run')
32
- @patch('sys.argv', ['awslabs.cfn-mcp-server', '--sse', '--port', '9999'])
33
- def test_main_sse(self, mock_run):
34
- """Test main function with SSE transport."""
35
- # Call the main function
36
- main()
37
-
38
- # Check that mcp.run was called with the correct arguments
39
- mock_run.assert_called_once()
40
- assert mock_run.call_args[1].get('transport') == 'sse'
41
-
42
- # Check that the port was set correctly
43
- from awslabs.cfn_mcp_server.server import mcp
44
-
45
- assert mcp.settings.port == 9999
46
29
 
47
30
  def test_module_execution(self):
48
31
  """Test the module execution when run as __main__."""
@@ -37,10 +37,11 @@ wheels = [
37
37
 
38
38
  [[package]]
39
39
  name = "awslabs-cfn-mcp-server"
40
- version = "0.0.0"
40
+ version = "1.0.0"
41
41
  source = { editable = "." }
42
42
  dependencies = [
43
43
  { name = "boto3" },
44
+ { name = "botocore" },
44
45
  { name = "loguru" },
45
46
  { name = "mcp", extra = ["cli"] },
46
47
  { name = "pydantic" },
@@ -61,6 +62,7 @@ dev = [
61
62
  [package.metadata]
62
63
  requires-dist = [
63
64
  { name = "boto3", specifier = ">=1.34.0" },
65
+ { name = "botocore", specifier = ">=1.34.0" },
64
66
  { name = "loguru", specifier = ">=0.7.0" },
65
67
  { name = "mcp", extras = ["cli"], specifier = ">=1.6.0" },
66
68
  { name = "pydantic", specifier = ">=2.10.6" },
@@ -1,12 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## Unreleased
9
-
10
- ### Added
11
-
12
- - Initial project setup
@@ -1,12 +0,0 @@
1
- #!/bin/sh
2
-
3
- if [ "$(lsof +c 0 -p 1 | grep -e grep -e "^awslabs\..*\s1\s.*\unix\s.*socket$" | wc -l)" -ne "0" ]; then
4
- echo -n "$(lsof +c 0 -p 1 | grep -e grep -e "^awslabs\..*\s1\s.*\unix\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;