SharkMCP
Enables packet capture and analysis through Wireshark/tshark integration, allowing the agent to start recording network traffic, analyze packet contents, apply filters, decrypt SSL/TLS traffic, and troubleshoot network issues
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., "@SharkMCP capture HTTPS traffic on port 443 for 30 seconds and show me the results"
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.
SharkMCP - Network Packet Analysis MCP Server
A Model Context Protocol (MCP) server that provides network packet capture and analysis capabilities through Wireshark/tshark integration. Designed for AI assistants to perform network security analysis, troubleshooting, and packet inspection.
This server was thought for situations where you want your agent to debug a program that sends requests and verify the packet traffic, allowing the following workflow:
Start recording packets
Run tool or perform request
Stop recording and analyze results
Architecture
SharkMCP provides a simple, local development-focused architecture:
┌─────────────────────────────────────────────────────────┐
│ SharkMCP Server │
├─────────────────────────────────────────────────────────┤
│ MCP Protocol Layer │
│ ├─ start_capture_session │
│ ├─ stop_capture_session │
│ ├─ analyze_pcap_file │
│ └─ manage_config │
├─────────────────────────────────────────────────────────┤
│ tshark Integration Layer │
│ ├─ Cross-platform executable detection │
│ ├─ Process management │
│ └─ Output parsing (JSON/fields/text) │
├─────────────────────────────────────────────────────────┤
│ Host System Integration │
│ ├─ Local tshark installation │
│ ├─ Direct network interface access │
│ └─ Native file system operations │
└─────────────────────────────────────────────────────────┘Related MCP server: Wireshark MCP
Features
Async Packet Capture: Start background capture sessions with configurable filters and timeouts.
PCAP File Analysis: Analyze existing packet capture files
Flexible Output Formats: JSON, custom fields, or traditional text output
SSL/TLS Decryption: Support for SSL keylog files to decrypt HTTPS traffic
Reusable Configurations: Save and reuse capture/analysis configurations
/!\ Packet information can be very extensive. Make sure to use a scoped display filter not to overload the context of your conversation.
Prerequisites
System Requirements
Wireshark/tshark: Must be installed and accessible
Node.js: Version 18+
pnpm: Package manager (recommended)
Installing Wireshark/tshark
macOS (using Homebrew):
brew install wiresharkUbuntu/Debian:
sudo apt update
sudo apt install tshark wireshark-commonWindows: Download from wireshark.org
Installation
Clone the repository:
git clone https://github.com/kriztalz/SharkMCP.git
cd SharkMCPInstall dependencies:
pnpm installBuild the project:
pnpm run buildRun the server:
pnpm startTesting
SharkMCP includes comprehensive integration tests that verify packet capture functionality.
Running Tests
# Run all tests
pnpm testConfiguration
MCP Client Setup
{
"mcpServers": {
"sharkmcp": {
"command": "node",
"args": ["/path/to/SharkMCP/dist/index.js"],
}
}
}SSL/TLS Decryption (Optional)
To decrypt HTTPS traffic, export the SSLKEYLOGFILE environment variable:
export SSLKEYLOGFILE=/path/to/sslkeylog.logThen configure your applications to log SSL keys to this file. Many applications support this automatically when the environment variable is set.
Then pass the log file pathname to the MCP server in the stop_capture_session tool.
Usage
Available Tools
start_capture_session: Start background packet capture
stop_capture_session: Stop capture and analyze results
analyze_pcap_file: Analyze existing PCAP files
manage_config: Save/load reusable configurations
Basic Examples
Start a capture session:
Interface: en0
Capture Filter: port 443
Timeout: 30 secondsAnalyze captured traffic:
Display Filter: tls.handshake.type == 1
Output Format: jsonSave a configuration:
{
"name": "https-monitoring",
"description": "Monitor HTTPS traffic",
"captureFilter": "port 443",
"displayFilter": "tls.handshake.type == 1",
"outputFormat": "json",
"timeout": 60,
"interface": "en0"
}Development
Project Structure
SharkMCP/
├── src/
│ ├── index.ts # Main server setup
│ ├── types.ts # TypeScript interfaces
│ ├── utils.ts # Utility functions
│ └── tools/ # Individual tool implementations
│ ├── start-capture-session.ts
│ ├── stop-capture-session.ts
│ ├── analyze-pcap-file.ts
│ └── manage-config.ts
├── test/ # Test files
│ └── integration.test.js # Integration tests
├── package.json
└── README.mdDevelopment Commands
# Development mode with auto-reload
pnpm run dev
# Build for production
pnpm run build
# Run tests
pnpm run test
# Type checking
pnpm run buildSecurity Considerations
Network Permissions: Packet capture requires elevated privileges
File Access: Temporary files are created in
/tmp/Docker Security: Container runs as non-root user
SSL Keylog: Sensitive SSL keys should be handled securely
Troubleshooting
Common Issues
"tshark not found":
Ensure Wireshark is installed and tshark is in PATH
Check installation with:
tshark -v
Permission denied for packet capture:
On Linux: Add user to
wiresharkgroup or run withsudoOn macOS: Grant Terminal network access in System Preferences
On Windows: Run as Administrator
No packets captured:
Verify network interface name (
ip linkon Linux,ifconfigon macOS)Check capture filter syntax
Ensure traffic is present on the interface
Contributing (Very welcome!)
Fork the repository
Create a feature branch
Make your changes following the existing code style
Add tests for new functionality
Submit a pull request
License
MIT License
Issues / Suggestions
Feel free to open an issue with any question or suggestion you may have.
Available Tools
4 toolsanalyze_pcap_fileC
Analyze a local pcap/pcapng file. LLMs control all analysis parameters including filters, output formats, and custom fields. Can use saved configurations.
Inputs: filePath (required), displayFilter, outputFormat, customFields, +2 more.
manage_configB
Save, load, list, or delete reusable filter configurations. Allows LLMs to store commonly used capture and analysis parameters for easy reuse.
Inputs: action (required), name, detailed, config.
start_capture_sessionA
Start a background packet capture session. LLMs control all capture parameters including filters, interfaces, and packet limits. Can use saved configurations.
Inputs: interface, captureFilter, timeout, maxPackets, +2 more.
stop_capture_sessionB
Stop a running capture session and analyze packets. LLMs control all analysis parameters including display filters and output formats. Can use saved configurations.
Inputs: sessionId (required), displayFilter, outputFormat, customFields, +2 more.
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 has a clearly distinct purpose: analyze_pcap_file handles static file analysis, manage_config deals with configuration management, and start_capture_session/stop_capture_session form a clear lifecycle for live captures. There is no overlap or ambiguity between these functions.
All tools follow a consistent verb_noun pattern with snake_case (analyze_pcap_file, manage_config, start_capture_session, stop_capture_session). The naming is predictable and readable throughout the set.
With 4 tools, the server is well-scoped for packet capture and analysis. Each tool earns its place by covering distinct aspects: static analysis, configuration management, and live capture lifecycle. This is an appropriate number for the domain.
The tool set covers core workflows for packet analysis (static and live) with configuration reuse. Minor gaps exist, such as no direct tool for listing or managing saved capture sessions, but agents can work around this using existing tools like manage_config and stop_capture_session.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
The Google GKE MCP server is a managed Model Context Protocol server that provides AI applications with tools to manage Google Kubernetes Engine (GKE) clusters and Kubernetes resources. It exposes a structured, discoverable interface that allows AI agents to interact with GKE and Kubernetes APIs, enabling them to inspect cluster configurations, retrieve Kubernetes resource YAMLs, monitor operations like cluster upgrades, diagnose issues, and optimize costs—all without needing to parse text output or use complex kubectl commands.
MCP server for building and testing AI agents with multi-model experimentation and insights.
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 gradedqualityDmaintenanceA Model Context Protocol server that integrates Wireshark's network analysis capabilities with AI systems like Claude, allowing direct analysis of network packet data without manual copying.32MIT
- 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
- AlicenseAqualityFmaintenanceA Model Context Protocol server that enables AI assistants to perform network packet analysis, capture, and security operations on a remote machine via Wireshark/tshark.101MIT