mcpcap

mcpcap

Enables LLMs to analyze network packet captures (PCAP files) from local or remote sources through a modular architecture. Supports DNS traffic analysis with structured JSON responses for network security and troubleshooting tasks.

Category
Visit Server

README

mcpcap

mcpcap logo

A modular Python MCP (Model Context Protocol) Server for analyzing PCAP files. mcpcap enables LLMs to read and analyze network packet captures from local or remote sources, providing structured JSON responses about network traffic.

Overview

mcpcap uses a modular architecture to analyze different network protocols found in PCAP files. Each module focuses on a specific protocol, allowing for targeted analysis and easy extensibility. The server leverages the powerful scapy library for packet parsing and analysis.

Key Features

  • Modular Architecture: Easily extensible to support new protocols
  • Local & Remote PCAP Support: Read files from local directories or HTTP servers
  • Scapy Integration: Leverages scapy's comprehensive packet parsing capabilities
  • MCP Server: Integrates seamlessly with LLM clients via Model Context Protocol
  • JSON Responses: Structured data format for easy LLM consumption

Installation

mcpcap requires Python 3.10 or greater.

Using pip

pip install mcpcap

Using uv

uv add mcpcap

Using uvx (for one-time usage)

uvx mcpcap

Quick Start

  1. Start the MCP Server:

    mcpcap --pcap-path /path/to/pcap/files
    
  2. Connect your LLM client to the MCP server

  3. Ask questions about your network traffic:

    • "What domain was queried the most in the DNS traffic?"
    • "Show me all DNS queries for example.com"
    • "What are the top 5 queried domains?"

Modules

DNS Module

The DNS module analyzes Domain Name System packets in PCAP files.

Capabilities:

  • Extract DNS queries and responses
  • Identify queried domains and subdomains
  • Analyze query types (A, AAAA, MX, etc.)
  • Track query frequency and patterns
  • Identify DNS servers used

Example Usage:

# LLM can ask: "What domains were queried in this PCAP?"
# mcpcap will return structured JSON with DNS query information

Configuration

PCAP Sources

Local Directory:

mcpcap --pcap-path /local/path/to/pcaps

Remote HTTP Server:

mcpcap --pcap-url http://example.com/pcaps/

Module Selection

mcpcap --modules dns --pcap-path /path/to/files

Example

An example PCAP file (example.pcap) containing DNS traffic is included with the project to help you get started.

Architecture

mcpcap's modular design makes it easy to extend support for new protocols:

  1. Core Engine: Handles PCAP file loading and basic packet processing
  2. Protocol Modules: Individual modules for specific protocols (DNS, etc.)
  3. MCP Interface: Translates between LLM queries and packet analysis results
  4. Output Formatter: Converts analysis results to structured JSON

Adding New Modules

New protocol modules can be added by:

  1. Implementing the module interface
  2. Defining scapy display filters for the protocol
  3. Creating analysis functions specific to the protocol
  4. Registering the module with the core engine

Future modules might include:

  • BGP (Border Gateway Protocol)
  • HTTP/HTTPS traffic analysis
  • TCP connection tracking
  • And more!

Remote Access

mcpcap supports reading PCAP files from remote HTTP servers without authentication. Future versions may include support for Basic Authentication and other security mechanisms.

Contributing

Contributions are welcome! Whether you want to:

  • Add support for new protocols
  • Improve existing modules
  • Enhance the MCP interface
  • Add new features

Please feel free to open issues and submit pull requests.

License

MIT

Requirements

  • Python 3.10+
  • scapy
  • MCP server dependencies (automatically installed)

Support

For questions, issues, or feature requests, please open an issue on GitHub.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured