NetMCP exposes 40 MCP tools, 3 resources, and 5 prompts via the Model Context Protocol.
All tools follow consistent patterns:
- Input validation via SecurityValidator
- Rate limiting on write operations
- Structured JSON responses via OutputFormatter
- Audit logging for sensitive operations
List all available network interfaces for packet capture.
- Read-only: Yes
- Parameters: None
- Returns:
{ count: int, interfaces: string[] }
Example:
{ "count": 3, "interfaces": ["eth0", "lo", "wlan0"] }Capture live network packets from a specified interface.
- Read-only: No
- Rate limit:
live_captureβ 30/hour
| Parameter | Type | Default | Description |
|---|---|---|---|
interface |
string |
required | Network interface (e.g., eth0, en0) |
duration |
int |
5 |
Max capture duration in seconds |
packet_count |
int |
100 |
Max packets to capture |
bpf_filter |
string |
"" |
BPF filter (e.g., 'tcp port 80') |
Returns: { interface, duration, filter, packets_captured, pcap_file, packets[] }
Fast packet capture β 3 seconds, minimal config.
- Read-only: No
- Rate limit:
live_captureβ 30/hour
| Parameter | Type | Default | Description |
|---|---|---|---|
interface |
string |
"eth0" |
Network interface |
packet_count |
int |
10 |
Max packets |
Returns: { interface, duration_seconds: 3, packets_captured, unique_ips[], protocols_seen[], pcap_file, packets[] }
Capture traffic and save directly to a PCAP file.
- Read-only: No
- Rate limit:
live_captureβ 30/hour
| Parameter | Type | Default | Description |
|---|---|---|---|
interface |
string |
required | Network interface |
output_file |
string |
required | Output path (.pcap, .pcapng, .cap) |
duration |
int |
10 |
Max duration in seconds |
packet_count |
int |
500 |
Max packets |
bpf_filter |
string |
"" |
BPF filter |
Returns: { interface, duration, filter, packets_captured, output_file, file_size_bytes }
Analyze a large PCAP file in chunks for memory efficiency.
Processes packets in batches, accumulating protocol, source IP, and destination IP statistics.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
chunk_size |
int |
10000 |
Number of packets per processing chunk |
display_filter |
string |
"" |
Optional Wireshark display filter |
Returns: { total_packets, chunks_processed, top_protocols[], top_source_ips[], top_dest_ips[] }
Analyze a PCAP file with optional display filters.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
display_filter |
string |
"" |
Wireshark display filter |
max_packets |
int |
10000 |
Max packets to analyze |
Returns: { filepath, total_packets, unique_ips[], protocol_stats: {}, packets[] }
Protocol hierarchy statistics from a PCAP file.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
Returns: { filepath, total_frames, protocols: { name: { frames, bytes } } }
Metadata about a PCAP file (via capinfos).
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
Returns: capinfos key-value dict
Capture traffic filtered by host, port, or protocol.
- Read-only: No
- Rate limit:
live_captureβ 30/hour
| Parameter | Type | Default | Description |
|---|---|---|---|
interface |
string |
required | Network interface |
target_host |
string |
"" |
Filter by host IP |
target_port |
int |
0 |
Filter by port |
protocol |
string |
"" |
Filter by protocol (tcp, udp, icmp, arp, ip, ip6, http, https) |
duration |
int |
10 |
Max duration in seconds |
packet_limit |
int |
500 |
Max packets |
Returns: { interface, filter, duration, packets_captured, pcap_file, packets[] }
Extract HTTP methods, hosts, URIs, user agents, and status codes.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
Returns: { filepath, total_http_requests, methods: {}, hosts: {}, status_codes: {}, sample_requests[] }
Detect protocols from PCAP file or live capture.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
"" |
Path to PCAP file (optional) |
interface |
string |
"" |
Interface for live capture (if no file) |
duration |
int |
10 |
Duration for live capture |
Returns: { source, total_protocols, protocols: {}, insights[] }
Analyze HTTP headers β auth tokens, cookies, suspicious headers (e.g., X-Forwarded-For spoofing).
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
include_cookies |
bool |
true |
Include cookie analysis |
Returns: { filepath, auth_tokens_found, cookies_found, suspicious_headers, unique_user_agents, auth_tokens[], cookies[], suspicious[], user_agents[] }
Geographic IP lookup using MaxMind GeoLite2. Can check specific IPs or extract all from a PCAP file.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
ip_addresses |
string |
required | Comma-separated IPs (e.g., '1.1.1.1,8.8.8.8') |
filepath |
string |
"" |
PCAP file to extract IPs from (overrides ip_addresses) |
Returns: { total_ips, countries: {}, results[] }
Analyze DNS queries and responses from a PCAP file. Extracts query names, types, response codes, and detects potential DNS tunneling (unusually long subdomain names).
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
max_queries |
int |
1000 |
Maximum DNS rows to process |
Returns: { total_dns_packets, unique_queries, top_domains[], nxdomain_count, nxdomains[], suspicious_domains[], potential_tunneling: bool }
Example:
{
"total_dns_packets": 342,
"unique_queries": 87,
"top_domains": [{"domain": "example.com", "count": 45}],
"nxdomain_count": 3,
"suspicious_domains": [],
"potential_tunneling": false
}Extract Wireshark expert information from a PCAP file. Returns warnings, errors, notes, and chats from Wireshark's expert system β useful for identifying protocol violations, malformed packets, retransmissions, etc.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
Returns: { errors[], warnings[], notes[], chats[], summary: { error_count, warning_count, note_count, chat_count } }
Example:
{
"errors": ["Frame 42: TCP segment not captured"],
"warnings": ["Frame 100: TCP retransmission"],
"summary": { "error_count": 1, "warning_count": 5, "note_count": 12, "chat_count": 3 }
}Generate visual diagrams of network flows from a PCAP file. Produces ASCII art or Mermaid sequence diagrams showing packet exchanges between endpoints.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
flow_type |
string |
"tcp" |
Protocol type: tcp or udp |
max_flows |
int |
20 |
Max packet arrows to include (1β200) |
output_format |
string |
"text" |
Diagram format: text (ASCII art) or mermaid |
Returns: { filepath, flow_type, flow_count, diagram: string, flows[] }
Example (Mermaid output):
sequenceDiagram
participant A as 10.0.0.1:443
participant B as 10.0.0.2:52314
A->>B: TCP SYN,ACK
B->>A: HTTP GET /api/data
Example (ASCII text output):
ββββββββββββββββββ ββββββββββββββββββ
β 10.0.0.1:443 β β 10.0.0.2:52314 β
βββββββββ¬βββββββββ βββββββββ¬βββββββββ
βββ TCP SYN ββββββββββββββββββββββββββ>β
β<βββββββββββββββββββββ TCP SYN,ACK ββββ
Decrypt TLS/HTTPS traffic using an SSLKEYLOGFILE. Requires a TLS key log file (NSS Key Log Format) captured alongside the traffic.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file containing TLS traffic |
keylog_file |
string |
"" |
Path to TLS key log file (NSS format); falls back to SSLKEYLOGFILE env var |
output_file |
string |
"" |
Optional path to write decrypted pcapng |
Returns: { filepath, keylog_file, decrypted_packets, http_requests[], http_responses[], output_file? }
Example:
{
"decrypted_packets": 24,
"http_requests": [{"method": "GET", "host": "api.example.com", "uri": "/v1/users", "frame": "42"}],
"http_responses": [{"code": "200", "content_type": "application/json", "frame": "45"}]
}Extract credentials from PCAP: HTTP Basic Auth, FTP, Telnet, Kerberos.
- Read-only: Yes
- Audit logged: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
Returns:
{
"filepath": "capture.pcap",
"plaintext_count": 2,
"encrypted_count": 1,
"plaintext": [
{ "type": "HTTP Basic Auth", "username": "admin", "password": "***", "frame": "42" },
{ "type": "FTP", "username": "user", "password": "***", "frame": "87" }
],
"encrypted": [
{ "type": "Kerberos", "hash": "$krb5asrep$23$...", "username": "jdoe", "realm": "CORP.LOCAL", "frame": "156", "cracking_command": "hashcat -m 18200 hash.txt wordlist.txt" }
]
}Kerberos hash formats:
- AS-REQ/TGS-REQ (msg_type 10/30):
$krb5pa$23$<cname>$<realm>$<cipher>βhashcat -m 7500 - AS-REP (msg_type 11):
$krb5asrep$23$<cname>@<realm>$<cipher>βhashcat -m 18200
Check an IP address against threat intelligence feeds.
- Read-only: Yes
- Rate limit:
threat_intelβ 100/hour
| Parameter | Type | Default | Description |
|---|---|---|---|
ip_address |
string |
required | IP address to check |
providers |
string |
"urlhaus,abuseipdb" |
Providers to check |
Returns: { ip, providers: {}, is_threat: bool, threat_providers[] }
Extract all IPs from a PCAP file and check against threat feeds.
- Read-only: Yes
- Rate limit:
threat_scanβ 10/hour
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
providers |
string |
"urlhaus,abuseipdb" |
Providers to check |
Returns: { filepath, total_ips, threats_found, threat_ips[], ip_results: {} }
Compare two PCAP files and report differences in packet counts, unique IPs, and protocol distributions.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath1 |
string |
required | Path to first PCAP file |
filepath2 |
string |
required | Path to second PCAP file |
display_filter |
string |
"" |
Optional Wireshark display filter applied to both |
Returns: { file1_packets, file2_packets, only_in_file1_ips[], only_in_file2_ips[], protocol_diff: {}, summary: string }
Example:
{
"file1_packets": 1200,
"file2_packets": 980,
"only_in_file1_ips": ["10.0.0.5"],
"only_in_file2_ips": ["10.0.0.99"],
"protocol_diff": { "dns": { "file1_frames": 42, "file2_frames": 18 } },
"summary": "File1: 1200 packets, File2: 980 packets. 1 IPs only in file1, 1 IPs only in file2, 1 protocol differences."
}Merge multiple PCAP files into one using mergecap.
- Read-only: No
| Parameter | Type | Default | Description |
|---|---|---|---|
filepaths |
list[string] |
required | List of PCAP file paths to merge |
output_file |
string |
required | Output file path (.pcap or .pcapng) |
chronological |
bool |
true |
Merge by timestamp (true) or append in order (false) |
Returns: { output_file, files_merged, file_size_bytes }
Slice or filter a PCAP file using editcap. Extract packets by number range, time range, or remove duplicates.
- Read-only: No
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to input PCAP file |
output_file |
string |
required | Output file path (.pcap or .pcapng) |
start_packet |
int |
0 |
First packet number to keep (1-based) |
end_packet |
int |
0 |
Last packet number to keep |
start_time |
string |
"" |
Keep packets after this time (editcap -A format) |
end_time |
string |
"" |
Keep packets before this time (editcap -B format) |
remove_duplicates |
bool |
false |
Remove duplicate packets |
Returns: { input_file, output_file, operation: string, file_size_bytes }
Decode a single packet in full detail. Returns verbose text decode or JSON layers for a specific packet number.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP file |
packet_number |
int |
required | Packet number to decode (1-based) |
verbose |
bool |
true |
If true, return verbose text decode; if false, return JSON layers |
Returns: { filepath, packet_number, layers[], raw_output: string }
All nmap tools: Rate limit nmap_scan β 10/hour. Marked as destructive.
Scan target for open ports.
| Parameter | Type | Default | Description |
|---|---|---|---|
target |
string |
required | IP, hostname, or CIDR range |
ports |
string |
"" |
Port spec (e.g., '80,443', '1-1024') |
scan_type |
string |
"connect" |
syn (needs root), connect (TCP), udp |
Returns: { target, scan_type, result: {} }
Detect service versions on open ports.
| Parameter | Type | Default | Description |
|---|---|---|---|
target |
string |
required | IP or hostname |
ports |
string |
"" |
Port spec (optional) |
Returns: { target, result: {} }
OS fingerprinting (requires root/admin).
| Parameter | Type | Default | Description |
|---|---|---|---|
target |
string |
required | IP or hostname |
Returns: { target, result: {} }
Run NSE vulnerability scripts against a target.
| Parameter | Type | Default | Description |
|---|---|---|---|
target |
string |
required | IP or hostname |
ports |
string |
"" |
Port spec (optional) |
Returns: { target, result: {} }
Quick scan of top 100 ports.
| Parameter | Type | Default | Description |
|---|---|---|---|
target |
string |
required | IP or hostname |
Returns: { target, result: {} }
Full scan: SYN + service detection + OS + default scripts.
Nmap args: -sS -sV -O -sC -T4 --version-all
| Parameter | Type | Default | Description |
|---|---|---|---|
target |
string |
required | IP or hostname |
Returns: { target, result: {} }
Export packets as structured JSON.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
display_filter |
string |
"" |
Wireshark display filter |
max_packets |
int |
10000 |
Max packets to export |
Returns: { filepath, packet_count, packets[] }
Export specific fields as CSV.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
fields |
string |
"" |
Comma-separated fields (default: standard set) |
display_filter |
string |
"" |
Wireshark display filter |
Default fields: frame.number, frame.time, ip.src, ip.dst, tcp.srcport, tcp.dstport, udp.srcport, udp.dstport, frame.protocols, frame.len
Returns: { filepath, row_count, csv: string }
Convert between pcap and pcapng formats.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Source PCAP file |
output_format |
string |
"pcapng" |
Target: pcap or pcapng |
Returns: { input, output, format }
List available Wireshark profiles and their configuration files. Scans standard profile directories on macOS and Linux.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
| (none) | β | β | β |
Returns: { profiles[{ name, path, has_colorfilters, has_preferences, has_decode_as }], default_profile_path }
Analyze a PCAP file using a specific Wireshark profile's configuration (preferences, decode-as rules, etc.).
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
profile_name |
string |
required | Wireshark profile name to apply |
display_filter |
string |
"" |
Optional Wireshark display filter |
max_packets |
int |
10000 |
Maximum packets to return |
Returns: { filepath, profile, packets_analyzed, packets[] }
Read Wireshark color filter rules from a profile or the default config. Parses the colorfilters file into structured data.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
profile_name |
string |
"" |
Profile name (empty uses default config) |
Returns: { profile, filter_count, filters[{ name, display_filter, foreground_rgb, background_rgb, enabled }] }
Example:
{
"profile": "default",
"filter_count": 15,
"filters": [
{ "name": "Bad TCP", "display_filter": "tcp.analysis.flags", "foreground_rgb": [0,0,0], "background_rgb": [65535,0,0], "enabled": true }
]
}Live capture using a Wireshark profile's configuration.
- Read-only: No
- Rate limit:
profile_captureβ 30/hour
| Parameter | Type | Default | Description |
|---|---|---|---|
interface |
string |
required | Network interface (e.g., eth0, en0) |
profile_name |
string |
required | Wireshark profile name to apply |
duration |
int |
10 |
Capture duration in seconds |
packet_count |
int |
500 |
Maximum packets |
Returns: { interface, profile, packets_captured, packets[] }
Reconstruct a TCP conversation from a PCAP file.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
stream_index |
int |
0 |
TCP stream index (0-based) |
output_format |
string |
"ascii" |
Format: ascii, hex, raw |
Returns: { filepath, stream_index, content }
Reconstruct a UDP conversation from a PCAP file.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
stream_index |
int |
0 |
UDP stream index (0-based) |
output_format |
string |
"ascii" |
Format: ascii, hex, raw |
Returns: { filepath, stream_index, content }
List all TCP conversations found in a PCAP file.
- Read-only: Yes
| Parameter | Type | Default | Description |
|---|---|---|---|
filepath |
string |
required | Path to PCAP/PCAPNG file |
Returns: { filepath, stream_count, streams[{ endpoint_a, endpoint_b, raw_output }] }
Dynamic list of available network interfaces.
Returns:
{ "count": 3, "interfaces": ["eth0", "lo", "wlan0"] }Available PCAP files in common directories (~/captures, ~/pcaps, current directory).
Returns:
{ "count": 2, "files": [{ "path": "/home/user/captures/trace.pcap", "size_mb": 12.5 }] }System capabilities and tool availability. Dynamically lists all registered tools.
Returns:
{
"python_version": "3.11.9",
"platform": "Linux-6.1",
"tshark_available": true,
"tshark_path": "/usr/bin/tshark",
"nmap_available": true,
"tools": ["get_network_interfaces", "capture_live_packets", "..."]
}Comprehensive security audit of a PCAP file.
| Argument | Type | Required | Description |
|---|---|---|---|
filepath |
string |
Yes | Path to PCAP file to audit |
Workflow: protocol stats β extract credentials β scan threats β analyze HTTP β list TCP streams
Network diagnostics through traffic analysis.
| Argument | Type | Default | Description |
|---|---|---|---|
interface |
string |
"eth0" |
Network interface |
duration |
int |
10 |
Capture duration |
Workflow: capture live β protocol stats β identify top talkers β check anomalies
Security incident investigation.
| Argument | Type | Required | Description |
|---|---|---|---|
target |
string |
Yes | Target IP or hostname |
Workflow: nmap quick scan β threat intel β vuln scan β comprehensive scan β capture traffic
Deep traffic analysis with protocol breakdown and GeoIP mapping.
| Argument | Type | Required | Description |
|---|---|---|---|
filepath |
string |
Yes | Path to PCAP file |
Workflow: protocol stats β HTTP traffic β HTTP headers β GeoIP lookup β extract credentials
Establish network baseline for normal traffic patterns.
| Argument | Type | Default | Description |
|---|---|---|---|
interface |
string |
"eth0" |
Network interface |
duration |
int |
30 |
Capture duration |
Workflow: quick capture β extended capture β protocol stats β list TCP streams
| Code | Name | Description |
|---|---|---|
NETMCP_001 |
Internal | Unexpected internal error |
NETMCP_002 |
Validation | Input validation failure |
NETMCP_003 |
Tool Execution | External tool error (tshark, nmap) |
NETMCP_004 |
File Error | File not found, permission, or format error |
NETMCP_005 |
Timeout | Operation timed out |
NETMCP_006 |
Rate Limited | Rate limit exceeded |
NETMCP_007 |
Permission | Insufficient permissions |
NETMCP_008 |
Not Available | Required tool not installed |
| Operation | Limit | Applied To |
|---|---|---|
live_capture |
30/hour | All capture tools |
profile_capture |
30/hour | Profile-based capture tools |
nmap_scan |
10/hour | All nmap tools |
threat_intel |
100/hour | IP reputation checks |
threat_scan |
10/hour | PCAP-wide threat scans |