mcpcap 0.5.6__tar.gz → 0.5.7__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.5.6 → mcpcap-0.5.7}/PKG-INFO +1 -1
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/_version.py +3 -3
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/cli.py +1 -3
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/core/config.py +1 -4
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/core/server.py +2 -8
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap.egg-info/PKG-INFO +1 -1
- {mcpcap-0.5.6 → mcpcap-0.5.7}/tests/test_cli.py +0 -3
- {mcpcap-0.5.6 → mcpcap-0.5.7}/tests/test_dhcp.py +2 -5
- {mcpcap-0.5.6 → mcpcap-0.5.7}/tests/test_dns.py +2 -4
- {mcpcap-0.5.6 → mcpcap-0.5.7}/.github/FUNDING.yml +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/.github/workflows/release.yml +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/.github/workflows/test.yml +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/.gitignore +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/.readthedocs.yaml +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/CONTRIBUTING.md +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/LICENSE +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/README.md +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/Makefile +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/_static/.gitkeep +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/api/cli.rst +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/api/core.rst +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/api/modules.rst +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/conf.py +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/developer/contributing.md +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/developer/module-creation-tutorial.md +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/index.rst +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/user-guide/analysis-guides.md +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/user-guide/installation.md +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/user-guide/mcp-integration.md +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/docs/source/user-guide/quickstart.md +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/examples/README.md +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/examples/dhcp.pcap +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/examples/dns.pcap +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/pyproject.toml +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/readme-assets/mcpcap-logo.png +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/server.json +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/setup.cfg +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/__init__.py +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/core/__init__.py +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/modules/__init__.py +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/modules/base.py +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/modules/dhcp.py +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/modules/dns.py +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap/modules/icmp.py +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap.egg-info/SOURCES.txt +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap.egg-info/dependency_links.txt +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap.egg-info/entry_points.txt +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap.egg-info/requires.txt +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/src/mcpcap.egg-info/top_level.txt +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/tests/__init__.py +0 -0
- {mcpcap-0.5.6 → mcpcap-0.5.7}/tests/test_modules/test_icmp.py +0 -0
@@ -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.5.
|
32
|
-
__version_tuple__ = version_tuple = (0, 5,
|
31
|
+
__version__ = version = '0.5.7'
|
32
|
+
__version_tuple__ = version_tuple = (0, 5, 7)
|
33
33
|
|
34
|
-
__commit_id__ = commit_id = '
|
34
|
+
__commit_id__ = commit_id = 'ga3cd65423'
|
@@ -40,14 +40,12 @@ def main():
|
|
40
40
|
args = parser.parse_args()
|
41
41
|
|
42
42
|
try:
|
43
|
-
# Parse modules
|
43
|
+
# Parse modules
|
44
44
|
modules = args.modules.split(",") if args.modules else ["dns", "dhcp", "icmp"]
|
45
|
-
protocols = modules # Protocols automatically match loaded modules
|
46
45
|
|
47
46
|
# Initialize configuration
|
48
47
|
config = Config(
|
49
48
|
modules=modules,
|
50
|
-
protocols=protocols,
|
51
49
|
max_packets=args.max_packets,
|
52
50
|
)
|
53
51
|
|
@@ -7,18 +7,15 @@ class Config:
|
|
7
7
|
def __init__(
|
8
8
|
self,
|
9
9
|
modules: list[str] | None = None,
|
10
|
-
protocols: list[str] | None = None,
|
11
10
|
max_packets: int | None = None,
|
12
11
|
):
|
13
12
|
"""Initialize configuration.
|
14
13
|
|
15
14
|
Args:
|
16
15
|
modules: List of modules to load
|
17
|
-
protocols: List of protocols to analyze
|
18
16
|
max_packets: Maximum number of packets to analyze per file
|
19
17
|
"""
|
20
|
-
self.modules = modules or ["dns", "dhcp"]
|
21
|
-
self.protocols = protocols or ["dns", "dhcp"]
|
18
|
+
self.modules = modules or ["dns", "dhcp", "icmp"]
|
22
19
|
self.max_packets = max_packets
|
23
20
|
|
24
21
|
self._validate_configuration()
|
@@ -18,6 +18,7 @@ class MCPServer:
|
|
18
18
|
config: Configuration instance
|
19
19
|
"""
|
20
20
|
self.config = config
|
21
|
+
|
21
22
|
self.mcp = FastMCP("mcpcap")
|
22
23
|
|
23
24
|
# Initialize modules based on configuration
|
@@ -51,11 +52,4 @@ class MCPServer:
|
|
51
52
|
"""Start the MCP server."""
|
52
53
|
import sys
|
53
54
|
|
54
|
-
|
55
|
-
enabled_modules = ", ".join(self.config.modules)
|
56
|
-
print(
|
57
|
-
f"Starting mcpcap MCP server with modules: {enabled_modules}",
|
58
|
-
file=sys.stderr,
|
59
|
-
)
|
60
|
-
|
61
|
-
self.mcp.run()
|
55
|
+
self.mcp.run(show_banner=False)
|
@@ -26,7 +26,6 @@ class TestCLI:
|
|
26
26
|
# Verify behavior
|
27
27
|
mock_config.assert_called_once_with(
|
28
28
|
modules=["dns", "dhcp", "icmp"],
|
29
|
-
protocols=["dns", "dhcp", "icmp"],
|
30
29
|
max_packets=None,
|
31
30
|
)
|
32
31
|
mock_server.assert_called_once_with(config_instance)
|
@@ -110,7 +109,6 @@ class TestCLI:
|
|
110
109
|
# Verify DHCP configuration
|
111
110
|
mock_config.assert_called_once_with(
|
112
111
|
modules=["dhcp"],
|
113
|
-
protocols=["dhcp"],
|
114
112
|
max_packets=None,
|
115
113
|
)
|
116
114
|
assert result == 0
|
@@ -133,7 +131,6 @@ class TestCLI:
|
|
133
131
|
# Verify multi-module configuration
|
134
132
|
mock_config.assert_called_once_with(
|
135
133
|
modules=["dns", "dhcp"],
|
136
|
-
protocols=["dns", "dhcp"],
|
137
134
|
max_packets=None,
|
138
135
|
)
|
139
136
|
assert result == 0
|
@@ -315,14 +315,11 @@ class TestDHCPConfig:
|
|
315
315
|
|
316
316
|
def test_config_with_dhcp_module(self):
|
317
317
|
"""Test configuration with DHCP module specified."""
|
318
|
-
config = Config(modules=["dhcp"]
|
318
|
+
config = Config(modules=["dhcp"])
|
319
319
|
assert "dhcp" in config.modules
|
320
|
-
assert "dhcp" in config.protocols
|
321
320
|
|
322
321
|
def test_config_with_multiple_modules(self):
|
323
322
|
"""Test configuration with multiple modules including DHCP."""
|
324
|
-
config = Config(modules=["dns", "dhcp"]
|
323
|
+
config = Config(modules=["dns", "dhcp"])
|
325
324
|
assert "dns" in config.modules
|
326
325
|
assert "dhcp" in config.modules
|
327
|
-
assert "dns" in config.protocols
|
328
|
-
assert "dhcp" in config.protocols
|
@@ -35,8 +35,7 @@ class TestConfig:
|
|
35
35
|
def test_config_validation_success(self):
|
36
36
|
"""Test successful config validation."""
|
37
37
|
config = Config()
|
38
|
-
assert config.modules == ["dns", "dhcp"]
|
39
|
-
assert config.protocols == ["dns", "dhcp"]
|
38
|
+
assert config.modules == ["dns", "dhcp", "icmp"]
|
40
39
|
|
41
40
|
def test_config_validation_nonexistent_path(self):
|
42
41
|
"""Test config validation with invalid max_packets."""
|
@@ -50,9 +49,8 @@ class TestConfig:
|
|
50
49
|
|
51
50
|
def test_custom_modules(self):
|
52
51
|
"""Test configuration with custom modules."""
|
53
|
-
config = Config(modules=["dns"]
|
52
|
+
config = Config(modules=["dns"])
|
54
53
|
assert config.modules == ["dns"]
|
55
|
-
assert config.protocols == ["dns"]
|
56
54
|
|
57
55
|
def test_max_packets_setting(self):
|
58
56
|
"""Test max_packets configuration."""
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|