Skip to main content

PCAP Analyzer MCP Server

PyPI License

A Model Context Protocol (MCP) server for comprehensive network packet capture and analysis using Wireshark/tshark.

GitHub RepositoryFull Documentation

Overview

This MCP server enables AI models to perform sophisticated network packet capture and analysis. It provides 46 specialized tools across 11 categories for deep network analysis, troubleshooting, and security assessment.

Architecture

Two deployment patterns are supported:

  1. Local (IDE) — Run alongside your IDE (Claude Desktop, VS Code, Cursor, Kiro, Amazon Q Developer). The MCP client communicates with the server via stdio, which invokes tshark for packet analysis.

  2. Cloud (AgentCore Gateway + Lambda) — Deploy as a Lambda function behind AgentCore Gateway with OAuth2/Cognito inbound auth and IAM outbound auth. PCAPs are read from S3.

See the full architecture diagrams on GitHub.

Key Capabilities

  • 🔧 Network interface discovery and live packet capture
  • 📊 Comprehensive protocol analysis (TCP, TLS, QUIC/HTTP3, BGP, DNS, HTTP)
  • 🔒 Security analysis (TLS handshakes, PQC detection, ARP spoofing, DNS tunneling, credential exposure)
  • ⚡ Performance metrics (latency, throughput, bandwidth, connection reuse, quality)
  • 🔍 Advanced diagnostics (MTU/fragmentation, connection timeouts, out-of-order packets)
  • 🌐 Network intelligence (Geo/ASN mapping, ICMP error classification, TCP reset analysis)

Prerequisites

  • Python 3.10+
  • uvInstall uv
  • Wireshark/tshark:
    • macOS: brew install wireshark
    • Linux: sudo apt-get install tshark
    • Windows: Download from wireshark.org

Packet Capture Permissions

Platform Command
macOS sudo dseditgroup -o edit -a $(whoami) -t user access_bpf (restart required)
Linux sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
Windows Run as Administrator with Npcap installed

Quick Install

# Using uvx (recommended)
uvx awslabs.pcap-analyzer-mcp-server@latest

# Using pip
pip install awslabs.pcap-analyzer-mcp-server
awslabs.pcap-analyzer-mcp-server

# From source
git clone https://github.com/aws-samples/sample-pcap-analyzer-mcp.git
cd sample-pcap-analyzer-mcp
uv sync
uv run awslabs.pcap-analyzer-mcp-server

Configuration

Kiro

Add to .kiro/settings/mcp.json:

{
  "mcpServers": {
    "pcap-analyzer": {
      "command": "uvx",
      "args": ["awslabs.pcap-analyzer-mcp-server@latest"]
    }
  }
}

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "pcap-analyzer": {
      "command": "uvx",
      "args": ["awslabs.pcap-analyzer-mcp-server@latest"]
    }
  }
}

Amazon Q Developer

Add to ~/.aws/amazonq/mcp.json:

{
  "mcpServers": {
    "pcap-analyzer": {
      "command": "uvx",
      "args": ["awslabs.pcap-analyzer-mcp-server@latest"]
    }
  }
}

Environment Variables

Variable Description Default
PCAP_STORAGE_DIR Directory for storing captured PCAP files ./pcap_storage
MAX_CAPTURE_DURATION Maximum capture duration in seconds 3600
WIRESHARK_PATH Path to tshark executable tshark

Tools (46 total)

Network Interface Management (1)

  • list_network_interfaces — Discover available network interfaces

Packet Capture Management (4)

  • start_packet_capture / stop_packet_capture / get_capture_status / list_captured_files

Basic PCAP Analysis (4)

  • analyze_pcap_file / extract_http_requests / generate_traffic_timeline / search_packet_content

Network Performance (2)

  • analyze_network_performance / analyze_network_latency

TLS/SSL Security (6)

  • analyze_tls_handshakes / analyze_sni_mismatches / extract_certificate_details / analyze_tls_alerts / analyze_connection_lifecycle / extract_tls_cipher_analysis

TCP Protocol Analysis (5)

  • analyze_tcp_retransmissions / analyze_tcp_zero_window / analyze_tcp_window_scaling / analyze_packet_timing_issues / analyze_congestion_indicators

Advanced Network Analysis (5)

  • analyze_dns_resolution_issues / analyze_expert_information / analyze_protocol_anomalies / analyze_network_topology / analyze_security_threats

Performance & Quality Metrics (4)

  • generate_throughput_io_graph / analyze_bandwidth_utilization / analyze_application_response_times / analyze_network_quality_metrics

Network Diagnostics (6)

  • analyze_mtu_fragmentation / analyze_tcp_resets / analyze_duplicate_acks / analyze_icmp_errors / analyze_connection_timeouts / analyze_out_of_order_packets

Protocol & Stream Analysis (3)

  • analyze_quic_traffic / follow_tcp_stream / follow_udp_stream

Security Detection (3)

  • detect_arp_spoofing / detect_dns_tunneling / extract_credentials

Data Extraction & Intelligence (3)

  • extract_fields / analyze_connection_reuse / analyze_geo_asn_mapping

Usage Examples

"Analyze bgp.pcap and explain why the BGP connection is failing"
"Capture network traffic on eth0 for 60 seconds and analyze for security threats"
"Examine TLS handshakes in https-traffic.pcap and identify any certificate issues"
"Check for TCP retransmissions and analyze connection quality in the packet capture"

AgentCore Gateway Deployment

For team-wide or production deployments using AWS Lambda + AgentCore Gateway with OAuth2/Cognito authentication, see the full deployment guide on GitHub.

Contributing

We welcome community contributions! See CONTRIBUTING.md.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

awslabs_pcap_analyzer_mcp_server-1.0.2.tar.gz (151.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file awslabs_pcap_analyzer_mcp_server-1.0.2.tar.gz.

File metadata

File hashes

Hashes for awslabs_pcap_analyzer_mcp_server-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e4a2a7bc944023ffe2a547352566a0a7cc65bd7f039d0d8b24172f793911808f
MD5 705a56a63dea2f7bd4418d9d420b344c
BLAKE2b-256 3a0b924840f612c4a14e14e3607c94b5e87be7f01e24d7c18215108f76b3fd16

See more details on using hashes here.

Provenance

The following attestation bundles were made for awslabs_pcap_analyzer_mcp_server-1.0.2.tar.gz:

Publisher: publish-pypi.yml on aws-samples/sample-pcap-analyzer-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file awslabs_pcap_analyzer_mcp_server-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for awslabs_pcap_analyzer_mcp_server-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cae0c382470d3438f92b9526c0e654d89e5e9432c3d6a068baed62738e044976
MD5 ee7f8433acf4e0d9214578d99a99ce88
BLAKE2b-256 c00d60b2fca96685a0075bdc4422f8f585b3eb376fcd2fbc2f5b30d2d151de26

See more details on using hashes here.

Provenance

The following attestation bundles were made for awslabs_pcap_analyzer_mcp_server-1.0.2-py3-none-any.whl:

Publisher: publish-pypi.yml on aws-samples/sample-pcap-analyzer-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page