mcpcap 0.3.2__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mcpcap-0.3.2 → mcpcap-0.4.1}/PKG-INFO +47 -14
- {mcpcap-0.3.2 → mcpcap-0.4.1}/README.md +43 -10
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/source/user-guide/mcp-integration.md +28 -7
- {mcpcap-0.3.2 → mcpcap-0.4.1}/examples/README.md +25 -6
- mcpcap-0.4.1/examples/dhcp.pcap +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/pyproject.toml +3 -3
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap/_version.py +3 -3
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap/cli.py +6 -7
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap/core/server.py +21 -6
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap/modules/__init__.py +2 -1
- mcpcap-0.4.1/src/mcpcap/modules/dhcp.py +446 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap.egg-info/PKG-INFO +47 -14
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap.egg-info/SOURCES.txt +3 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/tests/test_cli.py +52 -0
- mcpcap-0.4.1/tests/test_dhcp.py +379 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/.github/FUNDING.yml +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/.github/workflows/release.yml +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/.github/workflows/test.yml +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/.gitignore +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/.readthedocs.yaml +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/LICENSE +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/Makefile +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/source/_static/.gitkeep +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/source/api/cli.rst +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/source/api/core.rst +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/source/api/modules.rst +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/source/conf.py +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/source/index.rst +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/source/user-guide/analysis-guides.md +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/source/user-guide/installation.md +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/docs/source/user-guide/quickstart.md +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/examples/dns.pcap +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/readme-assets/mcpcap-logo.png +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/setup.cfg +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap/__init__.py +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap/core/__init__.py +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap/core/config.py +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap/modules/base.py +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap/modules/dns.py +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap.egg-info/dependency_links.txt +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap.egg-info/entry_points.txt +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap.egg-info/requires.txt +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/src/mcpcap.egg-info/top_level.txt +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/tests/__init__.py +0 -0
- {mcpcap-0.3.2 → mcpcap-0.4.1}/tests/test_dns.py +0 -0
@@ -1,12 +1,12 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcpcap
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.4.1
|
4
4
|
Summary: A modular Python MCP Server for analyzing PCAP files
|
5
5
|
Author: mcpcap contributors
|
6
6
|
License: MIT
|
7
|
-
Project-URL: Homepage, https://github.com/
|
8
|
-
Project-URL: Repository, https://github.com/
|
9
|
-
Project-URL: Issues, https://github.com/
|
7
|
+
Project-URL: Homepage, https://github.com/mcpcap/mcpcap
|
8
|
+
Project-URL: Repository, https://github.com/mcpcap/mcpcap
|
9
|
+
Project-URL: Issues, https://github.com/mcpcap/mcpcap/issues
|
10
10
|
Keywords: pcap,network,analysis,mcp,dns
|
11
11
|
Classifier: Development Status :: 3 - Alpha
|
12
12
|
Classifier: Intended Audience :: Developers
|
@@ -44,7 +44,7 @@ Dynamic: license-file
|
|
44
44
|
|
45
45
|
# mcpcap
|
46
46
|
|
47
|
-

|
48
48
|
|
49
49
|
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.
|
50
50
|
|
@@ -115,6 +115,8 @@ uvx mcpcap
|
|
115
115
|
|
116
116
|
## Modules
|
117
117
|
|
118
|
+
mcpcap supports multiple protocol analysis modules:
|
119
|
+
|
118
120
|
### DNS Module
|
119
121
|
|
120
122
|
The DNS module analyzes Domain Name System packets in PCAP files.
|
@@ -127,11 +129,26 @@ The DNS module analyzes Domain Name System packets in PCAP files.
|
|
127
129
|
- Track query frequency and patterns
|
128
130
|
- Identify DNS servers used
|
129
131
|
|
132
|
+
### DHCP Module
|
133
|
+
|
134
|
+
The DHCP module analyzes Dynamic Host Configuration Protocol packets in PCAP files.
|
135
|
+
|
136
|
+
**Capabilities**:
|
137
|
+
|
138
|
+
- Track DHCP transactions (DISCOVER, OFFER, REQUEST, ACK)
|
139
|
+
- Identify DHCP clients and servers
|
140
|
+
- Monitor IP address assignments and lease information
|
141
|
+
- Analyze DHCP options and configurations
|
142
|
+
- Detect DHCP anomalies and security issues
|
143
|
+
|
130
144
|
**Example Usage**:
|
131
145
|
|
132
|
-
```
|
133
|
-
#
|
134
|
-
|
146
|
+
```bash
|
147
|
+
# Analyze DHCP traffic only
|
148
|
+
mcpcap --pcap-path /path/to/dhcp.pcap --modules dhcp
|
149
|
+
|
150
|
+
# Analyze both DNS and DHCP
|
151
|
+
mcpcap --pcap-path /path/to/mixed.pcap --modules dns,dhcp
|
135
152
|
```
|
136
153
|
|
137
154
|
## Configuration
|
@@ -164,12 +181,23 @@ mcpcap --pcap-url http://example.com/pcaps/
|
|
164
181
|
|
165
182
|
**Module Selection**:
|
166
183
|
```bash
|
184
|
+
# Single module
|
167
185
|
mcpcap --modules dns --pcap-path /path/to/files
|
186
|
+
|
187
|
+
# Multiple modules
|
188
|
+
mcpcap --modules dns,dhcp --pcap-path /path/to/files
|
168
189
|
```
|
169
190
|
|
170
|
-
**Protocol
|
191
|
+
**Protocol Selection** (automatically matches loaded modules):
|
171
192
|
```bash
|
172
|
-
|
193
|
+
# DNS analysis only
|
194
|
+
mcpcap --modules dns --pcap-path /path/to/files
|
195
|
+
|
196
|
+
# DHCP analysis only
|
197
|
+
mcpcap --modules dhcp --pcap-path /path/to/files
|
198
|
+
|
199
|
+
# Both DNS and DHCP analysis
|
200
|
+
mcpcap --modules dns,dhcp --pcap-path /path/to/files
|
173
201
|
```
|
174
202
|
|
175
203
|
**Packet Limiting** (for large files):
|
@@ -179,7 +207,7 @@ mcpcap --max-packets 1000 --pcap-path /path/to/files
|
|
179
207
|
|
180
208
|
**Combined Options**:
|
181
209
|
```bash
|
182
|
-
mcpcap --pcap-path /data/capture.pcap --max-packets 500 --
|
210
|
+
mcpcap --pcap-path /data/capture.pcap --max-packets 500 --modules dns,dhcp
|
183
211
|
```
|
184
212
|
|
185
213
|
## CLI Reference
|
@@ -194,7 +222,8 @@ mcpcap [--pcap-path PATH | --pcap-url URL] [OPTIONS]
|
|
194
222
|
|
195
223
|
**Analysis Options**:
|
196
224
|
- `--modules MODULES`: Comma-separated modules to load (default: dns)
|
197
|
-
-
|
225
|
+
- Available modules: `dns`, `dhcp`
|
226
|
+
- Protocols are automatically set to match loaded modules
|
198
227
|
- `--max-packets N`: Maximum packets to analyze per file (default: unlimited)
|
199
228
|
|
200
229
|
**Examples**:
|
@@ -205,8 +234,8 @@ mcpcap --pcap-path ./capture.pcap
|
|
205
234
|
# Remote file with packet limit
|
206
235
|
mcpcap --pcap-url https://example.com/dns.cap --max-packets 100
|
207
236
|
|
208
|
-
# Directory with
|
209
|
-
mcpcap --pcap-path /captures --
|
237
|
+
# Directory with DHCP analysis
|
238
|
+
mcpcap --pcap-path /captures --modules dhcp
|
210
239
|
```
|
211
240
|
|
212
241
|
## Example
|
@@ -284,6 +313,10 @@ MIT
|
|
284
313
|
- fastmcp (MCP server framework)
|
285
314
|
- All dependencies are automatically installed via pip
|
286
315
|
|
316
|
+
## Documentation
|
317
|
+
|
318
|
+
Full documentation is available at [docs.mcpcap.ai](https://docs.mcpcap.ai)
|
319
|
+
|
287
320
|
## Support
|
288
321
|
|
289
322
|
For questions, issues, or feature requests, please open an issue on GitHub.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# mcpcap
|
2
2
|
|
3
|
-

|
4
4
|
|
5
5
|
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.
|
6
6
|
|
@@ -71,6 +71,8 @@ uvx mcpcap
|
|
71
71
|
|
72
72
|
## Modules
|
73
73
|
|
74
|
+
mcpcap supports multiple protocol analysis modules:
|
75
|
+
|
74
76
|
### DNS Module
|
75
77
|
|
76
78
|
The DNS module analyzes Domain Name System packets in PCAP files.
|
@@ -83,11 +85,26 @@ The DNS module analyzes Domain Name System packets in PCAP files.
|
|
83
85
|
- Track query frequency and patterns
|
84
86
|
- Identify DNS servers used
|
85
87
|
|
88
|
+
### DHCP Module
|
89
|
+
|
90
|
+
The DHCP module analyzes Dynamic Host Configuration Protocol packets in PCAP files.
|
91
|
+
|
92
|
+
**Capabilities**:
|
93
|
+
|
94
|
+
- Track DHCP transactions (DISCOVER, OFFER, REQUEST, ACK)
|
95
|
+
- Identify DHCP clients and servers
|
96
|
+
- Monitor IP address assignments and lease information
|
97
|
+
- Analyze DHCP options and configurations
|
98
|
+
- Detect DHCP anomalies and security issues
|
99
|
+
|
86
100
|
**Example Usage**:
|
87
101
|
|
88
|
-
```
|
89
|
-
#
|
90
|
-
|
102
|
+
```bash
|
103
|
+
# Analyze DHCP traffic only
|
104
|
+
mcpcap --pcap-path /path/to/dhcp.pcap --modules dhcp
|
105
|
+
|
106
|
+
# Analyze both DNS and DHCP
|
107
|
+
mcpcap --pcap-path /path/to/mixed.pcap --modules dns,dhcp
|
91
108
|
```
|
92
109
|
|
93
110
|
## Configuration
|
@@ -120,12 +137,23 @@ mcpcap --pcap-url http://example.com/pcaps/
|
|
120
137
|
|
121
138
|
**Module Selection**:
|
122
139
|
```bash
|
140
|
+
# Single module
|
123
141
|
mcpcap --modules dns --pcap-path /path/to/files
|
142
|
+
|
143
|
+
# Multiple modules
|
144
|
+
mcpcap --modules dns,dhcp --pcap-path /path/to/files
|
124
145
|
```
|
125
146
|
|
126
|
-
**Protocol
|
147
|
+
**Protocol Selection** (automatically matches loaded modules):
|
127
148
|
```bash
|
128
|
-
|
149
|
+
# DNS analysis only
|
150
|
+
mcpcap --modules dns --pcap-path /path/to/files
|
151
|
+
|
152
|
+
# DHCP analysis only
|
153
|
+
mcpcap --modules dhcp --pcap-path /path/to/files
|
154
|
+
|
155
|
+
# Both DNS and DHCP analysis
|
156
|
+
mcpcap --modules dns,dhcp --pcap-path /path/to/files
|
129
157
|
```
|
130
158
|
|
131
159
|
**Packet Limiting** (for large files):
|
@@ -135,7 +163,7 @@ mcpcap --max-packets 1000 --pcap-path /path/to/files
|
|
135
163
|
|
136
164
|
**Combined Options**:
|
137
165
|
```bash
|
138
|
-
mcpcap --pcap-path /data/capture.pcap --max-packets 500 --
|
166
|
+
mcpcap --pcap-path /data/capture.pcap --max-packets 500 --modules dns,dhcp
|
139
167
|
```
|
140
168
|
|
141
169
|
## CLI Reference
|
@@ -150,7 +178,8 @@ mcpcap [--pcap-path PATH | --pcap-url URL] [OPTIONS]
|
|
150
178
|
|
151
179
|
**Analysis Options**:
|
152
180
|
- `--modules MODULES`: Comma-separated modules to load (default: dns)
|
153
|
-
-
|
181
|
+
- Available modules: `dns`, `dhcp`
|
182
|
+
- Protocols are automatically set to match loaded modules
|
154
183
|
- `--max-packets N`: Maximum packets to analyze per file (default: unlimited)
|
155
184
|
|
156
185
|
**Examples**:
|
@@ -161,8 +190,8 @@ mcpcap --pcap-path ./capture.pcap
|
|
161
190
|
# Remote file with packet limit
|
162
191
|
mcpcap --pcap-url https://example.com/dns.cap --max-packets 100
|
163
192
|
|
164
|
-
# Directory with
|
165
|
-
mcpcap --pcap-path /captures --
|
193
|
+
# Directory with DHCP analysis
|
194
|
+
mcpcap --pcap-path /captures --modules dhcp
|
166
195
|
```
|
167
196
|
|
168
197
|
## Example
|
@@ -240,6 +269,10 @@ MIT
|
|
240
269
|
- fastmcp (MCP server framework)
|
241
270
|
- All dependencies are automatically installed via pip
|
242
271
|
|
272
|
+
## Documentation
|
273
|
+
|
274
|
+
Full documentation is available at [docs.mcpcap.ai](https://docs.mcpcap.ai)
|
275
|
+
|
243
276
|
## Support
|
244
277
|
|
245
278
|
For questions, issues, or feature requests, please open an issue on GitHub.
|
@@ -4,7 +4,7 @@ Learn how to integrate mcpcap with different MCP (Model Context Protocol) client
|
|
4
4
|
|
5
5
|
## What is MCP?
|
6
6
|
|
7
|
-
The Model Context Protocol (MCP) enables LLMs to securely access external resources and tools. mcpcap implements an MCP server that provides
|
7
|
+
The Model Context Protocol (MCP) enables LLMs to securely access external resources and tools. mcpcap implements an MCP server that provides network protocol analysis capabilities (DNS, DHCP, and more) to any compatible MCP client.
|
8
8
|
|
9
9
|
## Available MCP Clients
|
10
10
|
|
@@ -119,18 +119,38 @@ Lists all PCAP files in the configured directory.
|
|
119
119
|
Analyzes DNS packets in a PCAP file.
|
120
120
|
|
121
121
|
**Parameters**:
|
122
|
-
- `pcap_file` (optional): Filename to analyze (defaults to
|
122
|
+
- `pcap_file` (optional): Filename to analyze (defaults to first available file)
|
123
123
|
|
124
|
-
**Returns**: Structured JSON with packet details and statistics
|
124
|
+
**Returns**: Structured JSON with DNS packet details and statistics
|
125
|
+
|
126
|
+
### `list_dhcp_packets`
|
127
|
+
|
128
|
+
Analyzes DHCP packets in a PCAP file.
|
129
|
+
|
130
|
+
**Parameters**:
|
131
|
+
- `pcap_file` (optional): Filename to analyze (defaults to first available file)
|
132
|
+
|
133
|
+
**Returns**: Structured JSON with DHCP packet details including:
|
134
|
+
- Complete DHCP transactions (DISCOVER → OFFER → REQUEST → ACK)
|
135
|
+
- Client and server identification (MAC addresses, hostnames)
|
136
|
+
- IP address assignments and lease information
|
137
|
+
- DHCP options and configurations
|
138
|
+
- Transaction timing and statistics
|
125
139
|
|
126
140
|
## Available Prompts
|
127
141
|
|
128
|
-
### Analysis Prompts
|
142
|
+
### DNS Analysis Prompts
|
129
143
|
|
130
144
|
- `security_analysis`: Security-focused DNS analysis guidance
|
131
145
|
- `network_troubleshooting`: Network performance troubleshooting
|
132
146
|
- `forensic_investigation`: Digital forensics approach
|
133
147
|
|
148
|
+
### DHCP Analysis Prompts
|
149
|
+
|
150
|
+
- `dhcp_network_analysis`: Network administration and IP management analysis
|
151
|
+
- `dhcp_security_analysis`: Security threats and rogue DHCP server detection
|
152
|
+
- `dhcp_forensic_investigation`: Forensic analysis of DHCP transactions and timeline
|
153
|
+
|
134
154
|
## Configuration Options
|
135
155
|
|
136
156
|
### Server Configuration
|
@@ -146,7 +166,7 @@ mcpcap --pcap-path /path/to/specific.pcap
|
|
146
166
|
mcpcap --pcap-url https://example.com/capture.pcap
|
147
167
|
|
148
168
|
# With analysis options
|
149
|
-
mcpcap --pcap-path /path/to/pcaps --max-packets 1000 --
|
169
|
+
mcpcap --pcap-path /path/to/pcaps --max-packets 1000 --modules dns,dhcp
|
150
170
|
```
|
151
171
|
|
152
172
|
### Client Configuration Examples
|
@@ -162,7 +182,7 @@ mcpcap --pcap-path /path/to/pcaps --max-packets 1000 --protocols dns --modules d
|
|
162
182
|
},
|
163
183
|
"mcpcap-production": {
|
164
184
|
"command": "mcpcap",
|
165
|
-
"args": ["--pcap-path", "/production/captures", "--
|
185
|
+
"args": ["--pcap-path", "/production/captures", "--modules", "dns,dhcp"],
|
166
186
|
"env": {
|
167
187
|
"LOG_LEVEL": "INFO"
|
168
188
|
}
|
@@ -220,9 +240,10 @@ export mcpcap_PCAP_PATH=/default/path
|
|
220
240
|
- Verify no other processes are using the same resources
|
221
241
|
|
222
242
|
**Empty results**
|
223
|
-
- Confirm PCAP files contain
|
243
|
+
- Confirm PCAP files contain expected traffic (DNS on `port 53`, DHCP on `port 67/68`)
|
224
244
|
- Check file extensions are `.pcap` or `.pcapng`
|
225
245
|
- Verify files aren't corrupted with `file` command
|
246
|
+
- Ensure protocol modules are properly configured (`--modules dns,dhcp`)
|
226
247
|
|
227
248
|
**Performance issues**
|
228
249
|
- Use smaller PCAP files for initial testing
|
@@ -1,10 +1,11 @@
|
|
1
1
|
# mcpcap Examples
|
2
2
|
|
3
|
-
This directory contains example PCAP files and usage demonstrations.
|
3
|
+
This directory contains example PCAP files and usage demonstrations for different protocol modules.
|
4
4
|
|
5
5
|
## Example Files
|
6
6
|
|
7
|
-
- `dns.pcap` - Sample DNS traffic capture for testing
|
7
|
+
- `dns.pcap` - Sample DNS traffic capture for testing DNS module functionality
|
8
|
+
- `dhcp.pcap` - Sample DHCP traffic capture showing complete 4-way handshake (DISCOVER → OFFER → REQUEST → ACK)
|
8
9
|
|
9
10
|
## Usage Examples
|
10
11
|
|
@@ -17,7 +18,11 @@ mcpcap --pcap-path ./examples
|
|
17
18
|
|
18
19
|
**Analyze specific file:**
|
19
20
|
```bash
|
21
|
+
# DNS analysis
|
20
22
|
mcpcap --pcap-path ./examples/dns.pcap
|
23
|
+
|
24
|
+
# DHCP analysis
|
25
|
+
mcpcap --pcap-path ./examples/dhcp.pcap --modules dhcp
|
21
26
|
```
|
22
27
|
|
23
28
|
**With packet limits for faster testing:**
|
@@ -35,17 +40,23 @@ npx @modelcontextprotocol/inspector mcpcap --pcap-path ./examples/dns.pcap
|
|
35
40
|
|
36
41
|
Then use the web interface to:
|
37
42
|
- Call `list_pcap_files()` to see available files
|
38
|
-
- Call `list_dns_packets()` (
|
39
|
-
- View structured
|
43
|
+
- Call `list_dns_packets()` or `list_dhcp_packets()`
|
44
|
+
- View structured analysis results
|
40
45
|
|
41
46
|
### Analysis Prompts
|
42
47
|
|
43
48
|
Use these specialized prompts in your MCP client:
|
44
49
|
|
50
|
+
**DNS Module Prompts:**
|
45
51
|
- **`security_analysis`** - Focus on threat detection in DNS traffic
|
46
52
|
- **`network_troubleshooting`** - Identify DNS performance issues
|
47
53
|
- **`forensic_investigation`** - Detailed timeline and attribution analysis
|
48
54
|
|
55
|
+
**DHCP Module Prompts:**
|
56
|
+
- **`dhcp_network_analysis`** - Network administration and IP management
|
57
|
+
- **`dhcp_security_analysis`** - Security threats and rogue DHCP detection
|
58
|
+
- **`dhcp_forensic_investigation`** - Forensic analysis of DHCP transactions
|
59
|
+
|
49
60
|
## Creating Your Own Examples
|
50
61
|
|
51
62
|
To add new example files:
|
@@ -56,9 +67,17 @@ To add new example files:
|
|
56
67
|
|
57
68
|
## Sample Output
|
58
69
|
|
70
|
+
### DNS Analysis
|
59
71
|
When analyzing DNS packets, you'll get structured JSON output including:
|
60
|
-
|
61
72
|
- Packet timestamps and network details
|
62
73
|
- DNS query/response information
|
63
74
|
- Statistics (queries, responses, unique domains)
|
64
|
-
- Security-relevant metadata
|
75
|
+
- Security-relevant metadata
|
76
|
+
|
77
|
+
### DHCP Analysis
|
78
|
+
When analyzing DHCP packets, you'll get structured JSON output including:
|
79
|
+
- Complete DHCP transaction tracking (DISCOVER/OFFER/REQUEST/ACK)
|
80
|
+
- Client and server identification (MAC addresses, IP addresses)
|
81
|
+
- Lease information and timing
|
82
|
+
- DHCP options and configurations
|
83
|
+
- Network statistics and anomaly detection
|
Binary file
|
@@ -53,9 +53,9 @@ docs = [
|
|
53
53
|
]
|
54
54
|
|
55
55
|
[project.urls]
|
56
|
-
Homepage = "https://github.com/
|
57
|
-
Repository = "https://github.com/
|
58
|
-
Issues = "https://github.com/
|
56
|
+
Homepage = "https://github.com/mcpcap/mcpcap"
|
57
|
+
Repository = "https://github.com/mcpcap/mcpcap"
|
58
|
+
Issues = "https://github.com/mcpcap/mcpcap/issues"
|
59
59
|
|
60
60
|
[project.scripts]
|
61
61
|
mcpcap = "mcpcap:main"
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
28
28
|
commit_id: COMMIT_ID
|
29
29
|
__commit_id__: COMMIT_ID
|
30
30
|
|
31
|
-
__version__ = version = '0.
|
32
|
-
__version_tuple__ = version_tuple = (0,
|
31
|
+
__version__ = version = '0.4.1'
|
32
|
+
__version_tuple__ = version_tuple = (0, 4, 1)
|
33
33
|
|
34
|
-
__commit_id__ = commit_id = '
|
34
|
+
__commit_id__ = commit_id = 'gb756064db'
|
@@ -42,11 +42,6 @@ def main():
|
|
42
42
|
help="Comma-separated list of modules to load (default: dns)",
|
43
43
|
default="dns",
|
44
44
|
)
|
45
|
-
parser.add_argument(
|
46
|
-
"--protocols",
|
47
|
-
help="Comma-separated list of protocols to analyze (default: dns)",
|
48
|
-
default="dns",
|
49
|
-
)
|
50
45
|
parser.add_argument(
|
51
46
|
"--max-packets",
|
52
47
|
type=int,
|
@@ -56,12 +51,16 @@ def main():
|
|
56
51
|
args = parser.parse_args()
|
57
52
|
|
58
53
|
try:
|
54
|
+
# Parse modules and automatically set protocols to match
|
55
|
+
modules = args.modules.split(",") if args.modules else ["dns"]
|
56
|
+
protocols = modules # Protocols automatically match loaded modules
|
57
|
+
|
59
58
|
# Initialize configuration
|
60
59
|
config = Config(
|
61
60
|
pcap_path=args.pcap_path,
|
62
61
|
pcap_url=args.pcap_url,
|
63
|
-
modules=
|
64
|
-
protocols=
|
62
|
+
modules=modules,
|
63
|
+
protocols=protocols,
|
65
64
|
max_packets=args.max_packets,
|
66
65
|
)
|
67
66
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
from fastmcp import FastMCP
|
4
4
|
|
5
|
+
from ..modules.dhcp import DHCPModule
|
5
6
|
from ..modules.dns import DNSModule
|
6
7
|
from .config import Config
|
7
8
|
|
@@ -18,20 +19,34 @@ class MCPServer:
|
|
18
19
|
self.config = config
|
19
20
|
self.mcp = FastMCP("mcpcap")
|
20
21
|
|
21
|
-
# Initialize modules
|
22
|
-
self.
|
22
|
+
# Initialize modules based on configuration
|
23
|
+
self.modules = {}
|
24
|
+
if "dns" in self.config.modules:
|
25
|
+
self.modules["dns"] = DNSModule(config)
|
26
|
+
if "dhcp" in self.config.modules:
|
27
|
+
self.modules["dhcp"] = DHCPModule(config)
|
23
28
|
|
24
29
|
# Register tools
|
25
30
|
self._register_tools()
|
26
31
|
|
27
32
|
# Setup prompts
|
28
|
-
self.
|
33
|
+
for module in self.modules.values():
|
34
|
+
module.setup_prompts(self.mcp)
|
29
35
|
|
30
36
|
def _register_tools(self) -> None:
|
31
37
|
"""Register all available tools with the MCP server."""
|
32
|
-
# Register
|
33
|
-
self.
|
34
|
-
|
38
|
+
# Register tools for each loaded module
|
39
|
+
for module_name, module in self.modules.items():
|
40
|
+
if module_name == "dns":
|
41
|
+
self.mcp.tool(module.list_dns_packets)
|
42
|
+
elif module_name == "dhcp":
|
43
|
+
self.mcp.tool(module.list_dhcp_packets)
|
44
|
+
|
45
|
+
# Register shared list_pcap_files tool (same for all modules)
|
46
|
+
if self.modules:
|
47
|
+
# Use the first available module for listing PCAP files
|
48
|
+
first_module = next(iter(self.modules.values()))
|
49
|
+
self.mcp.tool(first_module.list_pcap_files)
|
35
50
|
|
36
51
|
def run(self) -> None:
|
37
52
|
"""Start the MCP server."""
|