mcpcap
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcpcap analyze dns packets from https://example.com/traffic.pcap"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcpcap

A modular Python MCP (Model Context Protocol) Server for analyzing PCAP files. mcpcap enables LLMs to read and analyze network packet captures with protocol-specific analysis tools that accept local file paths or remote URLs as parameters (no file uploads - provide the path or URL to your PCAP file).
Overview
mcpcap uses a modular architecture to analyze different network protocols found in PCAP files. Each module provides specialized analysis tools that can be called independently with any PCAP file, making it perfect for integration with Claude Desktop and other MCP clients.
Key Features
Stateless MCP Tools: Each analysis accepts PCAP file paths or URLs as parameters (no file uploads)
Modular Architecture: DNS, DHCP, ICMP, and CapInfos modules with easy extensibility for new protocols
Local & Remote PCAP Support: Analyze files from local storage or HTTP URLs
Scapy Integration: Leverages scapy's comprehensive packet parsing capabilities
Specialized Analysis Prompts: Security, networking, and forensic analysis guidance
JSON Responses: Structured data format optimized for LLM consumption
Related MCP server: TShark2MCP
Installation
mcpcap requires Python 3.10 or greater.
Using pip
pip install mcpcapUsing uv
uv add mcpcapUsing uvx (for one-time usage)
uvx mcpcapQuick Start
1. Start the MCP Server
Start mcpcap as a stateless MCP server:
# Default: Start with DNS, DHCP, and ICMP modules
mcpcap
# Start with specific modules only
mcpcap --modules dns
# With packet analysis limits
mcpcap --max-packets 1000Test Commit
2. Connect Your MCP Client
Configure your MCP client (like Claude Desktop) to connect to the mcpcap server:
{
"mcpServers": {
"mcpcap": {
"command": "mcpcap",
"args": []
}
}
}#Test Commit
3. Analyze PCAP Files
Use the analysis tools with any PCAP file by providing the file path or URL (not file uploads):
DNS Analysis:
analyze_dns_packets("/path/to/dns.pcap")
analyze_dns_packets("https://example.com/remote.pcap")DHCP Analysis:
analyze_dhcp_packets("/path/to/dhcp.pcap")
analyze_dhcp_packets("https://example.com/dhcp-capture.pcap")ICMP Analysis:
analyze_icmp_packets("/path/to/icmp.pcap")
analyze_icmp_packets("https://example.com/ping-capture.pcap")CapInfos Analysis:
analyze_capinfos("/path/to/any.pcap")
analyze_capinfos("https://example.com/capture.pcap")Available Tools
DNS Analysis Tools
analyze_dns_packets(pcap_file): Complete DNS traffic analysisExtract DNS queries and responses
Identify queried domains and subdomains
Analyze query types (A, AAAA, MX, CNAME, etc.)
Track query frequency and patterns
Detect potential security issues
DHCP Analysis Tools
analyze_dhcp_packets(pcap_file): Complete DHCP traffic analysisTrack DHCP transactions (DISCOVER, OFFER, REQUEST, ACK)
Identify DHCP clients and servers
Monitor IP address assignments and lease information
Analyze DHCP options and configurations
Detect DHCP anomalies and security issues
ICMP Analysis Tools
analyze_icmp_packets(pcap_file): Complete ICMP traffic analysisAnalyze ping requests and replies with response times
Identify network connectivity and reachability issues
Track TTL values and routing paths (traceroute data)
Detect ICMP error messages (unreachable, time exceeded)
Monitor for potential ICMP-based attacks or reconnaissance
CapInfos Analysis Tools
analyze_capinfos(pcap_file): PCAP file metadata and statisticsFile information (size, name, link layer encapsulation)
Packet statistics (count, data size, average packet size)
Temporal analysis (duration, timestamps, packet rates)
Data throughput metrics (bytes/second, bits/second)
Similar to Wireshark's capinfos(1) utility
Analysis Prompts
mcpcap provides specialized analysis prompts to guide LLM analysis:
DNS Prompts
security_analysis- Focus on threat detection, DGA domains, DNS tunnelingnetwork_troubleshooting- Identify DNS performance and configuration issuesforensic_investigation- Timeline reconstruction and evidence collection
DHCP Prompts
dhcp_network_analysis- Network administration and IP managementdhcp_security_analysis- Security threats and rogue DHCP detectiondhcp_forensic_investigation- Forensic analysis of DHCP transactions
ICMP Prompts
icmp_network_diagnostics- Network connectivity and path analysisicmp_security_analysis- ICMP-based attacks and reconnaissance detectionicmp_forensic_investigation- Timeline reconstruction and network mapping
Configuration Options
Module Selection
# Load specific modules
mcpcap --modules dns # DNS analysis only
mcpcap --modules dhcp # DHCP analysis only
mcpcap --modules icmp # ICMP analysis only
mcpcap --modules dns,dhcp,icmp,capinfos # All modules (default)Analysis Limits
# Limit packet analysis for large files
mcpcap --max-packets 1000Complete Configuration Example
mcpcap --modules dns,dhcp,icmp,capinfos --max-packets 500CLI Reference
mcpcap [--modules MODULES] [--max-packets N]Options:
--modules MODULES: Comma-separated modules to load (default:dns,dhcp,icmp,capinfos)Available modules:
dns,dhcp,icmp,capinfos
--max-packets N: Maximum packets to analyze per file (default: unlimited)
Examples:
# Start with all modules
mcpcap
# DNS analysis only
mcpcap --modules dns
# With packet limits for large files
mcpcap --max-packets 1000Examples
Example PCAP files are included in the examples/ directory:
dns.pcap- DNS traffic for testing DNS analysisdhcp.pcap- DHCP 4-way handshake captureicmp.pcap- ICMP ping and traceroute traffic
Using with MCP Inspector
npm install -g @modelcontextprotocol/inspector
npx @modelcontextprotocol/inspector mcpcapThen test the tools:
// In the MCP Inspector web interface
analyze_dns_packets("./examples/dns.pcap")
analyze_dhcp_packets("./examples/dhcp.pcap")
analyze_icmp_packets("./examples/icmp.pcap")
analyze_capinfos("./examples/dns.pcap")Architecture
mcpcap's modular design supports easy extension:
Core Components
BaseModule: Shared file handling, validation, and remote download
Protocol Modules: DNS, DHCP, and ICMP analysis implementations
MCP Interface: Tool registration and prompt management
FastMCP Framework: MCP server implementation
Tool Flow
MCP Client Request → analyze_*_packets(pcap_file)
→ BaseModule.analyze_packets()
→ Module._analyze_protocol_file()
→ Structured JSON ResponseAdding New Modules
Create new protocol modules by:
Inheriting from
BaseModuleImplementing
_analyze_protocol_file(pcap_file)Registering analysis tools with the MCP server
Adding specialized analysis prompts
Future modules might include:
HTTP/HTTPS traffic analysis
TCP connection tracking
BGP routing analysis
SSL/TLS certificate analysis
Network forensics tools
Remote File Support
Both analysis tools accept remote PCAP files via HTTP/HTTPS URLs:
# Examples of remote analysis
analyze_dns_packets("https://wiki.wireshark.org/uploads/dns.cap")
analyze_dhcp_packets("https://example.com/network-capture.pcap")
analyze_icmp_packets("https://example.com/ping-test.pcap")
analyze_capinfos("https://example.com/network-metadata.pcap")Features:
Automatic temporary download and cleanup
Support for
.pcap,.pcapng, and.capfilesHTTP/HTTPS protocols supported
Security Considerations
When analyzing PCAP files:
Files may contain sensitive network information
Remote downloads are performed over HTTPS when possible
Temporary files are cleaned up automatically
Consider the source and trustworthiness of remote files
Contributing
Contributions welcome! Areas for contribution:
New Protocol Modules: Add support for HTTP, BGP, TCP, etc.
Enhanced Analysis: Improve existing DNS/DHCP analysis
Security Features: Add more threat detection capabilities
Performance: Optimize analysis for large PCAP files
License
MIT
Requirements
Python 3.10+
scapy (packet parsing and analysis)
requests (remote file access)
fastmcp (MCP server framework)
Documentation
GitHub: github.com/mcpcap/mcpcap
Documentation: docs.mcpcap.ai
Website: mcpcap.ai
Support
For questions, issues, or feature requests, please open an issue on GitHub.
Available Tools
4 toolsanalyze_capinfosA
Return metadata from a PCAP file, similar to Wireshark's capinfos utility.
IMPORTANT: This tool expects a FILE PATH or URL, not file content.
For local files: "/path/to/capture.pcap"
For remote files: "https://example.com/capture.pcap"
File uploads are NOT supported - save the file locally first
Args: pcap_file: Path to local PCAP file or HTTP URL to remote PCAP file (NOT file content - must be a path or URL)
Returns: A structured dictionary containing PCAP metadata including: - File information (size, name, encapsulation type) - Packet statistics (count, data size, average sizes) - Temporal data (duration, timestamps, rates)
Inputs: pcap_file (required). Returns: object
analyze_dhcp_packetsA
Analyze DHCP packets from a PCAP file and return comprehensive analysis results. Then write data to user's system.
⚠️ FILE UPLOAD LIMITATION: This MCP tool cannot process files uploaded through Claude's web interface. Files must be accessible via URL or local file path.
SUPPORTED INPUT FORMATS:
Remote files: "https://example.com/capture.pcap"
Local files: "/absolute/path/to/capture.pcap"
UNSUPPORTED:
Files uploaded through Claude's file upload feature
Base64 file content
Relative file paths
Args: pcap_file: HTTP URL or absolute local file path to PCAP file
Returns: A structured dictionary containing DHCP packet analysis results
Inputs: pcap_file (required). Returns: object
analyze_dns_packetsA
Analyze DNS packets from a PCAP file and return comprehensive analysis results.
⚠️ FILE UPLOAD LIMITATION: This MCP tool cannot process files uploaded through Claude's web interface. Files must be accessible via URL or local file path.
SUPPORTED INPUT FORMATS:
Remote files: "https://example.com/capture.pcap"
Local files: "/absolute/path/to/capture.pcap"
UNSUPPORTED:
Files uploaded through Claude's file upload feature
Base64 file content
Relative file paths
Args: pcap_file: HTTP URL or absolute local file path to PCAP file
Returns: A structured dictionary containing DNS packet analysis results
Inputs: pcap_file (required). Returns: object
analyze_icmp_packetsA
Analyze ICMP packets from a PCAP file and return comprehensive analysis results.
⚠️ FILE UPLOAD LIMITATION: This MCP tool cannot process files uploaded through Claude's web interface. Files must be accessible via URL or local file path.
SUPPORTED INPUT FORMATS:
Remote files: "https://example.com/capture.pcap"
Local files: "/absolute/path/to/capture.pcap"
UNSUPPORTED:
Files uploaded through Claude's file upload feature
Base64 file content
Relative file paths
Args: pcap_file: HTTP URL or absolute local file path to PCAP file
Returns: A structured dictionary containing ICMP packet analysis results
Inputs: pcap_file (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct protocol (DNS, DHCP, ICMP) or metadata (capinfos), with no overlap in purpose. An agent can easily select the correct tool based on the protocol of interest.
Three tools follow the clear 'analyze_<protocol>_packets' pattern, but 'analyze_capinfos' deviates by using a utility name instead of a protocol. The shared 'analyze_' prefix keeps the naming mostly predictable.
With 4 tools, the server is well-scoped for focused PCAP analysis. Each tool has a clear role and the count is appropriate for a niche protocol analyzer.
The set covers DNS, DHCP, and ICMP analysis plus metadata, but lacks support for other common protocols (e.g., TCP, UDP, ARP) and generic packet inspection. This creates notable gaps for general PCAP analysis, though the core three protocols are well-covered.
Related MCP Connectors
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP server for Pentest-Tools.com: run scans, manage findings and reports via your preffered LLM.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides LLMs with real-time network traffic analysis capabilities, enabling tasks like threat hunting, network diagnostics, and anomaly detection through Wireshark's tshark.7608MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI-assisted network packet analysis using Wireshark's TShark tool. It provides tools for pcap file overview, session extraction, protocol filtering, and statistical analysis through a standardized interface.1MIT
- AlicenseCqualityBmaintenanceAn MCP server that enables LLMs to analyze pcap files by providing tools for packet dissection, stream following, and data extraction via tshark. It supports protocol hierarchy analysis, credential scanning, and threat intelligence checks on captured network traffic.54582 PyPI402MIT
- FlicenseNot gradedqualityDmaintenanceAn automated security operations center MCP server that uses LLMs and network analysis tools like Tshark to detect threats in traffic data. It enables users to automatically ingest PCAP files, query specific packets, and generate intelligent security analysis reports.-