awslabs.aws-network-mcp-server 0.0.5__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 (93) hide show
  1. awslabs_aws_network_mcp_server-0.0.5/.gitignore +59 -0
  2. awslabs_aws_network_mcp_server-0.0.5/.python-version +1 -0
  3. awslabs_aws_network_mcp_server-0.0.5/CHANGELOG.md +12 -0
  4. awslabs_aws_network_mcp_server-0.0.5/Dockerfile +85 -0
  5. awslabs_aws_network_mcp_server-0.0.5/LICENSE +175 -0
  6. awslabs_aws_network_mcp_server-0.0.5/NOTICE +2 -0
  7. awslabs_aws_network_mcp_server-0.0.5/PKG-INFO +249 -0
  8. awslabs_aws_network_mcp_server-0.0.5/README.md +219 -0
  9. awslabs_aws_network_mcp_server-0.0.5/awslabs/__init__.py +17 -0
  10. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/__init__.py +17 -0
  11. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/server.py +101 -0
  12. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/__init__.py +13 -0
  13. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/__init__.py +37 -0
  14. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/detect_cloudwan_inspection.py +140 -0
  15. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/get_all_cloudwan_routes.py +116 -0
  16. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/get_cloudwan_attachment_details.py +111 -0
  17. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/get_cloudwan_details.py +103 -0
  18. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/get_cloudwan_logs.py +161 -0
  19. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/get_cloudwan_peering_details.py +117 -0
  20. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/get_cloudwan_routes.py +154 -0
  21. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/list_cloudwan_peerings.py +83 -0
  22. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/list_core_networks.py +75 -0
  23. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/cloud_wan/simulate_cloud_wan_route_change.py +188 -0
  24. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/general/__init__.py +19 -0
  25. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/general/find_ip_address.py +134 -0
  26. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/general/get_eni_details.py +149 -0
  27. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/general/get_path_trace_methodology.py +376 -0
  28. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/network_firewall/__init__.py +19 -0
  29. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/network_firewall/get_firewall_rules.py +133 -0
  30. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/network_firewall/get_network_firewall_flow_logs.py +212 -0
  31. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/network_firewall/list_network_firewalls.py +70 -0
  32. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/transit_gateway/__init__.py +31 -0
  33. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/transit_gateway/detect_transit_gateway_inspection.py +200 -0
  34. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/transit_gateway/get_all_transit_gateway_routes.py +193 -0
  35. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/transit_gateway/get_transit_gateway_details.py +124 -0
  36. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/transit_gateway/get_transit_gateway_flow_logs.py +253 -0
  37. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/transit_gateway/get_transit_gateway_routes.py +176 -0
  38. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/transit_gateway/list_transit_gateway_peerings.py +72 -0
  39. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/transit_gateway/list_transit_gateways.py +67 -0
  40. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/vpc/__init__.py +19 -0
  41. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/vpc/get_vpc_flow_logs.py +257 -0
  42. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/vpc/get_vpc_network_details.py +123 -0
  43. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/vpc/list_vpcs.py +73 -0
  44. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/vpn/__init__.py +17 -0
  45. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/tools/vpn/list_vpn_connections.py +68 -0
  46. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/utils/__init__.py +13 -0
  47. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/utils/aws_common.py +44 -0
  48. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/utils/formatters.py +122 -0
  49. awslabs_aws_network_mcp_server-0.0.5/awslabs/aws_network_mcp_server/utils/vcp_details.py +326 -0
  50. awslabs_aws_network_mcp_server-0.0.5/docker-healthcheck.sh +26 -0
  51. awslabs_aws_network_mcp_server-0.0.5/pyproject.toml +141 -0
  52. awslabs_aws_network_mcp_server-0.0.5/tests/__init__.py +13 -0
  53. awslabs_aws_network_mcp_server-0.0.5/tests/conftest.py +32 -0
  54. awslabs_aws_network_mcp_server-0.0.5/tests/test_server.py +205 -0
  55. awslabs_aws_network_mcp_server-0.0.5/tests/tools/__init__.py +13 -0
  56. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/__init__.py +13 -0
  57. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/conftest.py +56 -0
  58. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/test_detect_cloudwan_inspection.py +168 -0
  59. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/test_get_all_cloudwan_routes.py +130 -0
  60. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/test_get_cloudwan_attachment_details.py +208 -0
  61. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/test_get_cloudwan_details.py +76 -0
  62. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/test_get_cloudwan_logs.py +266 -0
  63. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/test_get_cloudwan_peering_details.py +181 -0
  64. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/test_get_cloudwan_routes.py +201 -0
  65. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/test_list_core_networks.py +114 -0
  66. awslabs_aws_network_mcp_server-0.0.5/tests/tools/cloud_wan/test_simulate_cloud_wan_route_change.py +287 -0
  67. awslabs_aws_network_mcp_server-0.0.5/tests/tools/general/__init__.py +13 -0
  68. awslabs_aws_network_mcp_server-0.0.5/tests/tools/general/test_find_ip_address.py +229 -0
  69. awslabs_aws_network_mcp_server-0.0.5/tests/tools/general/test_get_eni_details.py +308 -0
  70. awslabs_aws_network_mcp_server-0.0.5/tests/tools/network_firewall/__init__.py +13 -0
  71. awslabs_aws_network_mcp_server-0.0.5/tests/tools/network_firewall/test_get_firewall_rules.py +258 -0
  72. awslabs_aws_network_mcp_server-0.0.5/tests/tools/network_firewall/test_get_network_firewall_flow_logs.py +414 -0
  73. awslabs_aws_network_mcp_server-0.0.5/tests/tools/network_firewall/test_list_network_firewalls.py +97 -0
  74. awslabs_aws_network_mcp_server-0.0.5/tests/tools/transit_gateway/__init__.py +13 -0
  75. awslabs_aws_network_mcp_server-0.0.5/tests/tools/transit_gateway/test_detect_transit_gateway_inspection.py +299 -0
  76. awslabs_aws_network_mcp_server-0.0.5/tests/tools/transit_gateway/test_get_all_transit_gateway_routes.py +347 -0
  77. awslabs_aws_network_mcp_server-0.0.5/tests/tools/transit_gateway/test_get_tgw_details.py +156 -0
  78. awslabs_aws_network_mcp_server-0.0.5/tests/tools/transit_gateway/test_get_transit_gateway_flow_logs.py +258 -0
  79. awslabs_aws_network_mcp_server-0.0.5/tests/tools/transit_gateway/test_get_transit_gateway_routes.py +364 -0
  80. awslabs_aws_network_mcp_server-0.0.5/tests/tools/transit_gateway/test_list_transit_gateway_peerings.py +153 -0
  81. awslabs_aws_network_mcp_server-0.0.5/tests/tools/transit_gateway/test_list_transit_gateways.py +112 -0
  82. awslabs_aws_network_mcp_server-0.0.5/tests/tools/vpc/__init__.py +13 -0
  83. awslabs_aws_network_mcp_server-0.0.5/tests/tools/vpc/test_get_vpc_flow_logs.py +255 -0
  84. awslabs_aws_network_mcp_server-0.0.5/tests/tools/vpc/test_get_vpc_network_details.py +273 -0
  85. awslabs_aws_network_mcp_server-0.0.5/tests/tools/vpc/test_list_vpcs.py +118 -0
  86. awslabs_aws_network_mcp_server-0.0.5/tests/tools/vpn/__init__.py +13 -0
  87. awslabs_aws_network_mcp_server-0.0.5/tests/tools/vpn/test_list_vpn_connections.py +141 -0
  88. awslabs_aws_network_mcp_server-0.0.5/tests/utils/__init__.py +13 -0
  89. awslabs_aws_network_mcp_server-0.0.5/tests/utils/test_aws_common.py +174 -0
  90. awslabs_aws_network_mcp_server-0.0.5/tests/utils/test_formatters.py +248 -0
  91. awslabs_aws_network_mcp_server-0.0.5/tests/utils/test_vcp_details.py +411 -0
  92. awslabs_aws_network_mcp_server-0.0.5/uv-requirements.txt +23 -0
  93. awslabs_aws_network_mcp_server-0.0.5/uv.lock +2495 -0
@@ -0,0 +1,59 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+
25
+ # Virtual environments
26
+ .venv
27
+ env/
28
+ venv/
29
+ ENV/
30
+
31
+ # IDE
32
+ .idea/
33
+ .vscode/
34
+ *.swp
35
+ *.swo
36
+
37
+ # Testing
38
+ .tox/
39
+ .coverage
40
+ .coverage.*
41
+ htmlcov/
42
+ .pytest_cache/
43
+
44
+ # Ruff
45
+ .ruff_cache/
46
+
47
+ # Build
48
+ *.manifest
49
+ *.spec
50
+ .pybuilder/
51
+ target/
52
+
53
+ # Environments
54
+ .env
55
+ .env.local
56
+ .env.*.local
57
+
58
+ # PyPI
59
+ .pypirc
@@ -0,0 +1,12 @@
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
@@ -0,0 +1,85 @@
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
+
15
+ # dependabot should continue to update this to the latest hash.
16
+ FROM public.ecr.aws/amazonlinux/amazonlinux@sha256:e27a70c006c68f0d194cc9b9624714d6ed8d979a94f60f7d31392f4c8294155b AS uv
17
+
18
+ # Install build dependencies needed for compiling packages
19
+ RUN dnf install -y shadow-utils python3 python3-devel gcc && \
20
+ dnf clean all
21
+
22
+ # Install the project into `/app`
23
+ WORKDIR /app
24
+
25
+ # Enable bytecode compilation
26
+ ENV UV_COMPILE_BYTECODE=1
27
+
28
+ # Copy from the cache instead of linking since it's a mounted volume
29
+ ENV UV_LINK_MODE=copy
30
+
31
+ # Prefer the system python
32
+ ENV UV_PYTHON_PREFERENCE=only-managed
33
+
34
+ # Run without updating the uv.lock file like running with `--frozen`
35
+ ENV UV_FROZEN=true
36
+
37
+ # Copy the required files first
38
+ COPY pyproject.toml uv.lock uv-requirements.txt ./
39
+
40
+ # Python optimization and uv configuration
41
+ ENV PIP_NO_CACHE_DIR=1 \
42
+ PIP_DISABLE_PIP_VERSION_CHECK=1
43
+
44
+ # Install the project's dependencies using the lockfile and settings
45
+ RUN --mount=type=cache,target=/root/.cache/uv \
46
+ python3 -m ensurepip && \
47
+ python3 -m pip install --require-hashes --requirement uv-requirements.txt --no-cache-dir && \
48
+ uv sync --python 3.13 --frozen --no-install-project --no-dev --no-editable
49
+
50
+ # Then, add the rest of the project source code and install it
51
+ # Installing separately from its dependencies allows optimal layer caching
52
+ COPY . /app
53
+ RUN --mount=type=cache,target=/root/.cache/uv \
54
+ uv sync --python 3.13 --frozen --no-dev --no-editable
55
+
56
+ # Make the directory just in case it doesn't exist
57
+ RUN mkdir -p /root/.local
58
+
59
+ FROM public.ecr.aws/amazonlinux/amazonlinux@sha256:e27a70c006c68f0d194cc9b9624714d6ed8d979a94f60f7d31392f4c8294155b
60
+
61
+ # Place executables in the environment at the front of the path and include other binaries
62
+ ENV PATH="/app/.venv/bin:$PATH:/usr/sbin" \
63
+ PYTHONUNBUFFERED=1
64
+
65
+ # Install other tools as needed for the MCP server
66
+ # Add non-root user and ability to change directory into /root
67
+ RUN dnf install -y shadow-utils procps && \
68
+ dnf clean all && \
69
+ groupadd --force --system app && \
70
+ useradd app -g app -d /app && \
71
+ chmod o+x /root
72
+
73
+ # Get the project from the uv layer
74
+ COPY --from=uv --chown=app:app /root/.local /root/.local
75
+ COPY --from=uv --chown=app:app /app/.venv /app/.venv
76
+
77
+ # Get healthcheck script
78
+ COPY ./docker-healthcheck.sh /usr/local/bin/docker-healthcheck.sh
79
+
80
+ # Run as non-root
81
+ USER app
82
+
83
+ # When running the container, add --db-path and a bind mount to the host's db file
84
+ HEALTHCHECK --interval=60s --timeout=10s --start-period=10s --retries=3 CMD ["docker-healthcheck.sh"]
85
+ ENTRYPOINT ["awslabs.aws-network-mcp-server"]
@@ -0,0 +1,175 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
@@ -0,0 +1,2 @@
1
+ awslabs.aws-network-mcp-server
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
@@ -0,0 +1,249 @@
1
+ Metadata-Version: 2.4
2
+ Name: awslabs.aws-network-mcp-server
3
+ Version: 0.0.5
4
+ Summary: An AWS Labs Model Context Protocol (MCP) server for aws-network
5
+ Project-URL: homepage, https://awslabs.github.io/mcp/
6
+ Project-URL: docs, https://awslabs.github.io/mcp/servers/aws-network-mcp-server/
7
+ Project-URL: documentation, https://awslabs.github.io/mcp/servers/aws-network-mcp-server/
8
+ Project-URL: repository, https://github.com/awslabs/mcp.git
9
+ Project-URL: changelog, https://github.com/awslabs/mcp/blob/main/src/aws-network-mcp-server/CHANGELOG.md
10
+ Author: Amazon Web Services
11
+ Author-email: AWSLabs MCP <203918161+awslabs-mcp@users.noreply.github.com>, Jose Juhala <juhala@amazon.fi>
12
+ License: Apache-2.0
13
+ License-File: LICENSE
14
+ License-File: NOTICE
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: boto3>=1.40.74
25
+ Requires-Dist: fastmcp>=2.14.0
26
+ Requires-Dist: loguru>=0.7.0
27
+ Requires-Dist: mcp[cli]>=1.23.0
28
+ Requires-Dist: pydantic>=2.10.6
29
+ Description-Content-Type: text/markdown
30
+
31
+ # AWS Core Network MCP Server
32
+
33
+ A Model Context Protocol (MCP) server providing comprehensive tools for troubleshooting and analyzing AWS core networking services including Cloud WAN, Transit Gateway, VPC, Network Firewall, and VPN connections.
34
+
35
+ ### Key Features
36
+
37
+ - **Systematic troubleshooting**: Built-in methodology for network path tracing and connectivity analysis
38
+ - **Multi-service coverage**: Unified interface for Cloud WAN, Transit Gateway, VPC, Network Firewall, and VPN
39
+ - **Flow log analysis**: Query and filter VPC, Transit Gateway, and Network Firewall flow logs from CloudWatch
40
+ - **Inspection detection**: Automatically identify firewalls in traffic paths for security analysis
41
+ - **Multi-region support**: Search for resources across all AWS regions
42
+ - **Read-only operations**: Safe troubleshooting without risk of configuration changes
43
+
44
+ ### AWS Core Network capabilities
45
+
46
+ - **Path tracing**: Systematic methodology for analyzing network connectivity issues
47
+ - **IP discovery**: Locate network interfaces by IP address across regions
48
+ - **Security analysis**: Examine security groups, NACLs, and firewall rules
49
+ - **Routing analysis**: Trace traffic paths through VPC, Transit Gateway, and Cloud WAN
50
+ - **Traffic verification**: Query flow logs to confirm actual traffic patterns
51
+ - **Inspection detection**: Identify AWS Network Firewall and third-party firewalls in traffic paths
52
+
53
+ ### Tools
54
+
55
+ #### General Tools
56
+ 1. `get_path_trace_methodology`: Get comprehensive network troubleshooting methodology (ALWAYS call this first)
57
+ 2. `find_ip_address`: Locate ENI by IP address with multi-region search support
58
+ 3. `get_eni_details`: Get comprehensive ENI details including security groups, NACLs, and routing
59
+
60
+ #### Cloud WAN Tools
61
+ 4. `list_core_networks`: List all Cloud WAN core networks in a region
62
+ 5. `get_cloudwan_details`: Get comprehensive core network configuration and state
63
+ 6. `get_cloudwan_routes`: Get routes for specific segment and region
64
+ 7. `get_all_cloudwan_routes`: Get all routing tables across all segments and regions
65
+ 8. `get_cloudwan_attachment_details`: Get detailed attachment information by type
66
+ 9. `detect_cloudwan_inspection`: Detect Network Function Groups performing inspection
67
+ 10. `list_cloudwan_peerings`: List all Transit Gateway peerings for a core network
68
+ 11. `get_cloudwan_peering_details`: Get peering details from both Cloud WAN and TGW perspectives
69
+ 12. `get_cloudwan_logs`: Retrieve event logs for topology changes and routing updates
70
+ 13. `simulate_cloud_wan_route_change`: Simulate network changes for a single region
71
+
72
+ #### Transit Gateway Tools
73
+ 14. `list_transit_gateways`: List all Transit Gateways in a region
74
+ 15. `get_tgw_details`: Get basic Transit Gateway configuration and operational details
75
+ 16. `get_tgw_routes`: Get routes from specific route table with filtering
76
+ 17. `get_all_tgw_routes`: Get all route tables and routes in one call
77
+ 18. `get_tgw_flow_logs`: Retrieve Transit Gateway flow logs from CloudWatch
78
+ 19. `list_tgw_peerings`: List all Transit Gateway peerings
79
+ 20. `detect_tgw_inspection`: Detect AWS Network Firewall and third-party firewalls attached to TGW
80
+
81
+ #### VPC Tools
82
+ 21. `list_vpcs`: List all VPCs in a region
83
+ 22. `get_vpc_network_details`: Get comprehensive VPC network configuration
84
+ 23. `get_vpc_flow_logs`: Get VPC flow logs from CloudWatch with filtering
85
+
86
+ #### Network Firewall Tools
87
+ 24. `list_network_firewalls`: List all AWS Network Firewalls in a region
88
+ 25. `get_firewall_rules`: Get stateless and stateful firewall rules
89
+ 26. `get_network_firewall_flow_logs`: Retrieve firewall flow logs from CloudWatch
90
+
91
+ #### VPN Tools
92
+ 27. `list_vpn_connections`: List all Site-to-Site VPN connections in a region
93
+
94
+ ## Prerequisites
95
+ - Have an AWS account with [credentials configured](https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-files.html)
96
+ - Install uv from [Astral](https://docs.astral.sh/uv/getting-started/installation/) or the [GitHub README](https://github.com/astral-sh/uv#installation)
97
+ - Install Python 3.10 or newer using uv python install 3.10 (or a more recent version)
98
+ - This MCP server can only be run locally on the same host as your LLM client.
99
+
100
+ ## Configuration
101
+
102
+ You can download the AWS Network MCP Server from GitHub. To get started using your favorite code assistant with MCP support, like Kiro, Cursor, or Cline.
103
+
104
+ ```json
105
+ {
106
+ "mcpServers": {
107
+ "awslabs.aws-network-mcp-server": {
108
+ "command": "uvx",
109
+ "args": [
110
+ "awslabs.aws-network-mcp-server@latest"
111
+ ],
112
+ "env": {
113
+ "AWS_PROFILE": "your-aws-profile",
114
+ "AWS_REGION": "us-west-2"
115
+ },
116
+ "disabled": false,
117
+ "autoApprove": []
118
+ }
119
+ }
120
+ }
121
+ ```
122
+
123
+ ### Windows Installation
124
+
125
+ For Windows users, the MCP server configuration format is slightly different:
126
+
127
+ ```json
128
+ {
129
+ "mcpServers": {
130
+ "awslabs.aws-network-mcp-server": {
131
+ "disabled": false,
132
+ "timeout": 60,
133
+ "type": "stdio",
134
+ "command": "uv",
135
+ "args": [
136
+ "tool",
137
+ "run",
138
+ "--from",
139
+ "awslabs.aws-network-mcp-server@latest",
140
+ "awslabs.aws-network-mcp-server.exe"
141
+ ],
142
+ "env": {
143
+ "FASTMCP_LOG_LEVEL": "ERROR",
144
+ "AWS_PROFILE": "your-aws-profile",
145
+ "AWS_REGION": "us-east-1"
146
+ }
147
+ }
148
+ }
149
+ }
150
+ ```
151
+
152
+ ### AWS Authentication
153
+
154
+ Preferred authentication method is [AWS Named Profiles](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html). This MCP is able to do fast account switching by using named profiles.
155
+
156
+ AWS Credentials in environment variables will also work but allows only single account usage.
157
+
158
+ #### Required IAM Permissions
159
+
160
+ ```json
161
+ {
162
+ "Version": "2012-10-17",
163
+ "Statement": [
164
+ {
165
+ "Effect": "Allow",
166
+ "Action": [
167
+ "ec2:DescribeNetworkInterfaces",
168
+ "ec2:DescribeSecurityGroups",
169
+ "ec2:DescribeNetworkAcls",
170
+ "ec2:DescribeRouteTables",
171
+ "ec2:DescribeSubnets",
172
+ "ec2:DescribeVpcs",
173
+ "ec2:DescribeInternetGateways",
174
+ "ec2:DescribeNatGateways",
175
+ "ec2:DescribeVpcEndpoints",
176
+ "ec2:DescribeTransitGateways",
177
+ "ec2:DescribeTransitGatewayAttachments",
178
+ "ec2:DescribeTransitGatewayRouteTables",
179
+ "ec2:DescribeTransitGatewayPeeringAttachments",
180
+ "ec2:DescribeVpnConnections",
181
+ "ec2:DescribeFlowLogs",
182
+ "ec2:DescribeRegions",
183
+ "networkmanager:GetCoreNetwork",
184
+ "networkmanager:GetCoreNetworkPolicy",
185
+ "networkmanager:GetNetworkRoutes",
186
+ "networkmanager:GetVpcAttachment",
187
+ "networkmanager:GetConnectAttachment",
188
+ "networkmanager:GetDirectConnectGatewayAttachment",
189
+ "networkmanager:GetSiteToSiteVpnAttachment",
190
+ "networkmanager:GetTransitGatewayRouteTableAttachment",
191
+ "networkmanager:GetTransitGatewayPeering",
192
+ "networkmanager:GetTransitGatewayRegistrations",
193
+ "networkmanager:GetTransitGatewayRouteTableAssociations",
194
+ "networkmanager:ListCoreNetworks",
195
+ "networkmanager:ListAttachments",
196
+ "networkmanager:ListPeerings",
197
+ "network-firewall:DescribeFirewall",
198
+ "network-firewall:DescribeFirewallPolicy",
199
+ "network-firewall:DescribeRuleGroup",
200
+ "network-firewall:DescribeLoggingConfiguration",
201
+ "network-firewall:ListFirewalls",
202
+ "elasticloadbalancing:DescribeLoadBalancers",
203
+ "logs:StartQuery",
204
+ "logs:GetQueryResults",
205
+ "sts:GetCallerIdentity"
206
+ ],
207
+ "Resource": "*"
208
+ }
209
+ ]
210
+ }
211
+ ```
212
+
213
+ #### Multi-Account Access
214
+
215
+ Use the `profile_name` parameter in tools to specify different AWS CLI profiles for cross-account access. Some tools support separate profiles for different resources (e.g., `tgw_account_profile_name` and `cloudwan_account_profile_name`).
216
+
217
+ ### Data Usage
218
+
219
+ This MCP server operates entirely locally and makes direct API calls to AWS services. No data is sent to third-party services. All AWS API calls are subject to AWS service terms and your organization's AWS policies.
220
+
221
+ ### FAQs
222
+
223
+ #### 1. Do I need an AWS account?
224
+
225
+ Yes. This server makes API calls to AWS services and requires valid AWS credentials with appropriate IAM permissions.
226
+
227
+ #### 2. What AWS regions are supported?
228
+
229
+ All AWS commercial regions are supported. Tools that support multi-region search (like `find_ip_address`) can search across all enabled regions in your account.
230
+
231
+ #### 3. Why do some tools require Network Manager registration?
232
+
233
+ Transit Gateway route tools (`get_tgw_routes`, `get_all_tgw_routes`) require the Transit Gateway to be registered with AWS Network Manager (Cloud WAN Global Network). This is an AWS requirement for accessing route table information via the Network Manager API.
234
+
235
+ #### 4. Do flow log tools work without CloudWatch Logs?
236
+
237
+ No. Flow log tools (`get_vpc_flow_logs`, `get_tgw_flow_logs`, `get_network_firewall_flow_logs`) require that flow logging is enabled and configured to send logs to CloudWatch Logs (not S3 or Kinesis Data Firehose).
238
+
239
+ #### 5. Can this server make changes to my AWS infrastructure?
240
+
241
+ No. All tools are read-only and only perform Describe, Get, and List operations. The server cannot create, modify, or delete any AWS resources.
242
+
243
+ #### 6. How do I troubleshoot "No flow logs found" errors?
244
+
245
+ Verify that:
246
+ - Flow logging is enabled on the resource (VPC, Transit Gateway, or Network Firewall)
247
+ - Logs are configured to send to CloudWatch Logs
248
+ - The time range includes periods when traffic was flowing
249
+ - Your IAM permissions include `logs:FilterLogEvents`