awslabs.pcap-analyzer-mcp-server 1.0.0__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.
@@ -0,0 +1 @@
1
+ # Repository cleaned on Wed Feb 11 16:48:04 EST 2026
@@ -0,0 +1,117 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ dry_run:
10
+ description: "Build only, skip publish"
11
+ required: false
12
+ default: "false"
13
+ type: choice
14
+ options:
15
+ - "true"
16
+ - "false"
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ build:
23
+ name: Build distribution
24
+ runs-on: ubuntu-latest
25
+ timeout-minutes: 10
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+
29
+ - name: Install uv
30
+ uses: astral-sh/setup-uv@v4
31
+
32
+ - name: Build package
33
+ run: uv build
34
+
35
+ - name: Verify build artifacts
36
+ run: |
37
+ set -euo pipefail
38
+
39
+ echo "=== Built artifacts ==="
40
+ ls -la dist/
41
+
42
+ # Verify we have both sdist and wheel
43
+ WHEEL_COUNT=$(ls dist/*.whl 2>/dev/null | wc -l)
44
+ SDIST_COUNT=$(ls dist/*.tar.gz 2>/dev/null | wc -l)
45
+
46
+ if [[ "$WHEEL_COUNT" -eq 0 ]]; then
47
+ echo "::error::No wheel file found in dist/"
48
+ exit 1
49
+ fi
50
+
51
+ if [[ "$SDIST_COUNT" -eq 0 ]]; then
52
+ echo "::error::No sdist found in dist/"
53
+ exit 1
54
+ fi
55
+
56
+ echo ""
57
+ echo "=== Wheel contents (top 30) ==="
58
+ unzip -l dist/*.whl | head -30
59
+
60
+ echo ""
61
+ echo "=== Package metadata ==="
62
+ unzip -p dist/*.whl "*/METADATA" | head -25
63
+
64
+ - name: Test install and entry point
65
+ run: |
66
+ set -euo pipefail
67
+
68
+ # Install the built wheel
69
+ uv pip install dist/*.whl --system
70
+
71
+ # Verify the entry point binary exists
72
+ which awslabs.pcap-analyzer-mcp-server
73
+
74
+ # Verify it can be invoked (MCP servers don't have --help typically, so just check import)
75
+ python -c "from awslabs.pcap_analyzer_mcp_server.server import main; print('Import OK')"
76
+
77
+ - name: Upload artifact
78
+ uses: actions/upload-artifact@v4
79
+ with:
80
+ name: dist
81
+ path: dist/
82
+ if-no-files-found: error
83
+
84
+ publish:
85
+ name: Publish to PyPI
86
+ needs: build
87
+ runs-on: ubuntu-latest
88
+ timeout-minutes: 10
89
+ if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'false')
90
+ environment:
91
+ name: pypi
92
+ url: https://pypi.org/project/awslabs.pcap-analyzer-mcp-server/
93
+ permissions:
94
+ id-token: write # Required for PyPI trusted publishing (OIDC)
95
+
96
+ steps:
97
+ - name: Download artifact
98
+ uses: actions/download-artifact@v4
99
+ with:
100
+ name: dist
101
+ path: dist/
102
+
103
+ - name: Verify dist contents
104
+ run: |
105
+ echo "=== Publishing these files ==="
106
+ ls -la dist/
107
+
108
+ - name: Publish to PyPI
109
+ uses: pypa/gh-action-pypi-publish@release/v1
110
+ with:
111
+ print-hash: true
112
+ verbose: true
113
+ # Trusted Publishing (OIDC) is used by default.
114
+ # No API token required if trusted publisher is configured on PyPI.
115
+ #
116
+ # To use API token instead, uncomment below and add PYPI_API_TOKEN secret:
117
+ # password: ${{ secrets.PYPI_API_TOKEN }}
@@ -0,0 +1,60 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+
8
+ # Virtual environments
9
+ .venv/
10
+ venv/
11
+ ENV/
12
+ env/
13
+ test_venv/
14
+
15
+ # Testing
16
+ .pytest_cache/
17
+ .coverage
18
+ .coverage.*
19
+ htmlcov/
20
+ *.cover
21
+ .hypothesis/
22
+ .tox/
23
+ coverage.xml
24
+ *-coverage.xml
25
+
26
+ # Build
27
+ dist/
28
+ build/
29
+ *.egg-info/
30
+ *.egg
31
+
32
+ # IDE
33
+ .vscode/
34
+ .idea/
35
+ *.swp
36
+ *.swo
37
+ *~
38
+
39
+ # OS
40
+ .DS_Store
41
+ .DS_Store?
42
+ ._*
43
+ Thumbs.db
44
+
45
+ # Linting/Formatting
46
+ .ruff_cache/
47
+ .mypy_cache/
48
+ .pylint.d/
49
+
50
+ # Logs
51
+ *.log
52
+
53
+ # PCAP files (unless specifically needed)
54
+ pcap_storage/
55
+ *.pcap
56
+
57
+ # Lock files (keep in repo for reproducibility)
58
+ # Uncomment if you don't want lock files
59
+ # uv.lock
60
+ # poetry.lock
@@ -0,0 +1,27 @@
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-11-07
9
+
10
+ ### Added
11
+ - Initial release of PCAP Analyzer MCP Server
12
+ - 31 comprehensive network analysis tools across 8 categories:
13
+ - Network Interface Management (1 tool)
14
+ - Packet Capture Management (4 tools)
15
+ - Basic PCAP Analysis (4 tools)
16
+ - Network Performance Analysis (2 tools)
17
+ - TLS/SSL Security Analysis (6 tools)
18
+ - TCP Protocol Analysis (5 tools)
19
+ - Advanced Network Analysis (5 tools)
20
+ - Performance & Quality Metrics (4 tools)
21
+ - Complete AWS Labs MCP server compliance
22
+ - Comprehensive unit test suite with 41% coverage
23
+ - Professional documentation and installation instructions
24
+ - Docusaurus integration for documentation website
25
+ - Security features including path traversal and command injection protection
26
+ - Async operations support for concurrent network analysis
27
+ - Configurable storage directory and capture duration limits
@@ -0,0 +1,4 @@
1
+ ## Code of Conduct
2
+ This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
3
+ For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
4
+ opensource-codeofconduct@amazon.com with any additional questions or comments.
@@ -0,0 +1,59 @@
1
+ # Contributing Guidelines
2
+
3
+ Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4
+ documentation, we greatly value feedback and contributions from our community.
5
+
6
+ Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7
+ information to effectively respond to your bug report or contribution.
8
+
9
+
10
+ ## Reporting Bugs/Feature Requests
11
+
12
+ We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13
+
14
+ When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
15
+ reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16
+
17
+ * A reproducible test case or series of steps
18
+ * The version of our code being used
19
+ * Any modifications you've made relevant to the bug
20
+ * Anything unusual about your environment or deployment
21
+
22
+
23
+ ## Contributing via Pull Requests
24
+ Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25
+
26
+ 1. You are working against the latest source on the *main* branch.
27
+ 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28
+ 3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
29
+
30
+ To send us a pull request, please:
31
+
32
+ 1. Fork the repository.
33
+ 2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34
+ 3. Ensure local tests pass.
35
+ 4. Commit to your fork using clear commit messages.
36
+ 5. Send us a pull request, answering any default questions in the pull request interface.
37
+ 6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
38
+
39
+ GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
40
+ [creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
41
+
42
+
43
+ ## Finding contributions to work on
44
+ Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
45
+
46
+
47
+ ## Code of Conduct
48
+ This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
49
+ For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
50
+ opensource-codeofconduct@amazon.com with any additional questions or comments.
51
+
52
+
53
+ ## Security issue notifications
54
+ If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
55
+
56
+
57
+ ## Licensing
58
+
59
+ See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
@@ -0,0 +1,104 @@
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/docker/library/python:3.13-alpine@sha256:070342a0cc1011532c0e69972cce2bbc6cc633eba294bae1d12abea8bd05303b AS uv
17
+
18
+ # Install the project into `/app`
19
+ WORKDIR /app
20
+
21
+ # Enable bytecode compilation
22
+ ENV UV_COMPILE_BYTECODE=1
23
+
24
+ # Copy from the cache instead of linking since it's a mounted volume
25
+ ENV UV_LINK_MODE=copy
26
+
27
+ # Prefer the system python
28
+ ENV UV_PYTHON_PREFERENCE=only-system
29
+
30
+ # Run without updating the uv.lock file like running with `--frozen`
31
+ ENV UV_FROZEN=true
32
+
33
+ # Copy the required files first
34
+ COPY pyproject.toml uv.lock uv-requirements.txt ./
35
+
36
+ # Python optimization and uv configuration
37
+ ENV PIP_NO_CACHE_DIR=1 \
38
+ PIP_DISABLE_PIP_VERSION_CHECK=1
39
+
40
+ # Install system dependencies, Wireshark/tshark, and Python package manager
41
+ RUN apk update && \
42
+ apk add --no-cache --virtual .build-deps \
43
+ build-base \
44
+ gcc \
45
+ musl-dev \
46
+ libffi-dev \
47
+ openssl-dev \
48
+ curl && \
49
+ apk add --no-cache \
50
+ wireshark \
51
+ tshark
52
+
53
+ # Set shell with pipefail for secure pipe operations in Alpine
54
+ SHELL ["/bin/sh", "-o", "pipefail", "-c"]
55
+
56
+ # Install Rust and Cargo with a newer version that supports edition2024
57
+ RUN curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/rust-lang/rustup/f7935a8ad24a445629ceedb2cb706a4469e1e5b3/rustup-init.sh | sh -s -- -v -y --default-toolchain nightly && \
58
+ . $HOME/.cargo/env && \
59
+ rustup default nightly
60
+
61
+ # Install the project's dependencies using the lockfile and settings
62
+ RUN --mount=type=cache,target=/root/.cache/uv \
63
+ . $HOME/.cargo/env && \
64
+ pip install --require-hashes --requirement uv-requirements.txt --no-cache-dir && \
65
+ uv sync --python 3.13 --frozen --no-install-project --no-dev --no-editable
66
+
67
+ # Then, add the rest of the project source code and install it
68
+ # Installing separately from its dependencies allows optimal layer caching
69
+ COPY . /app
70
+ RUN --mount=type=cache,target=/root/.cache/uv \
71
+ . $HOME/.cargo/env && \
72
+ uv sync --python 3.13 --frozen --no-dev --no-editable
73
+
74
+ # Make the directory just in case it doesn't exist
75
+ RUN mkdir -p /root/.local
76
+
77
+ FROM public.ecr.aws/docker/library/python:3.13-alpine@sha256:070342a0cc1011532c0e69972cce2bbc6cc633eba294bae1d12abea8bd05303b
78
+
79
+ # Place executables in the environment at the front of the path and include other binaries
80
+ ENV PATH="/app/.venv/bin:$PATH" \
81
+ PYTHONUNBUFFERED=1
82
+
83
+ # Install runtime dependencies, Wireshark/tshark, and create application user
84
+ RUN apk update && \
85
+ apk add --no-cache ca-certificates libgcc wireshark tshark && \
86
+ update-ca-certificates && \
87
+ addgroup -S app && \
88
+ adduser -S app -G app -h /app
89
+
90
+ # Copy application artifacts from build stage
91
+ COPY --from=uv --chown=app:app /app/.venv /app/.venv
92
+
93
+ # Get healthcheck script
94
+ COPY ./docker-healthcheck.sh /usr/local/bin/docker-healthcheck.sh
95
+
96
+ # Create pcap storage directory
97
+ RUN mkdir -p /app/pcap_storage && chown -R app:app /app/pcap_storage
98
+
99
+ # Run as non-root
100
+ USER app
101
+
102
+ # Health check for PCAP analyzer server
103
+ HEALTHCHECK --interval=60s --timeout=10s --start-period=10s --retries=3 CMD ["docker-healthcheck.sh"]
104
+ ENTRYPOINT ["awslabs.pcap-analyzer-mcp-server"]
@@ -0,0 +1,16 @@
1
+ MIT No Attribution
2
+
3
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
13
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
15
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,16 @@
1
+ PCAP Analyzer MCP Server
2
+ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+
4
+ This product includes software developed at
5
+ Amazon Web Services (https://aws.amazon.com/).
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License").
8
+ You may not use this file except in compliance with the License.
9
+ A copy of the License is located at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ or in the "license" file accompanying this file. This file is distributed
14
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
15
+ express or implied. See the License for the specific language governing
16
+ permissions and limitations under the License.