mcp-proxy-adapter 6.9.28__py3-none-any.whl → 6.9.29__py3-none-any.whl
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.
Potentially problematic release.
This version of mcp-proxy-adapter might be problematic. Click here for more details.
- mcp_proxy_adapter/__init__.py +10 -0
- mcp_proxy_adapter/__main__.py +8 -21
- mcp_proxy_adapter/api/app.py +10 -913
- mcp_proxy_adapter/api/core/__init__.py +18 -0
- mcp_proxy_adapter/api/core/app_factory.py +243 -0
- mcp_proxy_adapter/api/core/lifespan_manager.py +55 -0
- mcp_proxy_adapter/api/core/registration_manager.py +166 -0
- mcp_proxy_adapter/api/core/ssl_context_factory.py +88 -0
- mcp_proxy_adapter/api/handlers.py +78 -199
- mcp_proxy_adapter/api/middleware/__init__.py +1 -44
- mcp_proxy_adapter/api/middleware/base.py +0 -42
- mcp_proxy_adapter/api/middleware/command_permission_middleware.py +0 -85
- mcp_proxy_adapter/api/middleware/error_handling.py +1 -127
- mcp_proxy_adapter/api/middleware/factory.py +0 -94
- mcp_proxy_adapter/api/middleware/logging.py +0 -112
- mcp_proxy_adapter/api/middleware/performance.py +0 -35
- mcp_proxy_adapter/api/middleware/protocol_middleware.py +2 -98
- mcp_proxy_adapter/api/middleware/transport_middleware.py +0 -37
- mcp_proxy_adapter/api/middleware/unified_security.py +10 -10
- mcp_proxy_adapter/api/middleware/user_info_middleware.py +0 -118
- mcp_proxy_adapter/api/openapi/__init__.py +21 -0
- mcp_proxy_adapter/api/openapi/command_integration.py +105 -0
- mcp_proxy_adapter/api/openapi/openapi_generator.py +40 -0
- mcp_proxy_adapter/api/openapi/openapi_registry.py +62 -0
- mcp_proxy_adapter/api/openapi/schema_loader.py +116 -0
- mcp_proxy_adapter/api/schemas.py +0 -61
- mcp_proxy_adapter/api/tool_integration.py +0 -117
- mcp_proxy_adapter/api/tools.py +0 -46
- mcp_proxy_adapter/cli/__init__.py +12 -0
- mcp_proxy_adapter/cli/commands/__init__.py +15 -0
- mcp_proxy_adapter/cli/commands/client.py +100 -0
- mcp_proxy_adapter/cli/commands/config_generate.py +21 -0
- mcp_proxy_adapter/cli/commands/config_validate.py +36 -0
- mcp_proxy_adapter/cli/commands/generate.py +259 -0
- mcp_proxy_adapter/cli/commands/server.py +174 -0
- mcp_proxy_adapter/cli/commands/sets.py +128 -0
- mcp_proxy_adapter/cli/commands/testconfig.py +177 -0
- mcp_proxy_adapter/cli/examples/__init__.py +8 -0
- mcp_proxy_adapter/cli/examples/http_basic.py +82 -0
- mcp_proxy_adapter/cli/examples/https_token.py +96 -0
- mcp_proxy_adapter/cli/examples/mtls_roles.py +103 -0
- mcp_proxy_adapter/cli/main.py +63 -0
- mcp_proxy_adapter/cli/parser.py +324 -0
- mcp_proxy_adapter/cli/validators.py +231 -0
- mcp_proxy_adapter/client/jsonrpc_client.py +406 -0
- mcp_proxy_adapter/client/proxy.py +45 -0
- mcp_proxy_adapter/commands/__init__.py +44 -28
- mcp_proxy_adapter/commands/auth_validation_command.py +7 -344
- mcp_proxy_adapter/commands/base.py +19 -43
- mcp_proxy_adapter/commands/builtin_commands.py +0 -75
- mcp_proxy_adapter/commands/catalog/__init__.py +20 -0
- mcp_proxy_adapter/commands/catalog/catalog_loader.py +34 -0
- mcp_proxy_adapter/commands/catalog/catalog_manager.py +122 -0
- mcp_proxy_adapter/commands/catalog/catalog_syncer.py +149 -0
- mcp_proxy_adapter/commands/catalog/command_catalog.py +43 -0
- mcp_proxy_adapter/commands/catalog/dependency_manager.py +37 -0
- mcp_proxy_adapter/commands/catalog_manager.py +58 -928
- mcp_proxy_adapter/commands/cert_monitor_command.py +0 -88
- mcp_proxy_adapter/commands/certificate_management_command.py +0 -45
- mcp_proxy_adapter/commands/command_registry.py +172 -904
- mcp_proxy_adapter/commands/config_command.py +0 -28
- mcp_proxy_adapter/commands/dependency_container.py +1 -70
- mcp_proxy_adapter/commands/dependency_manager.py +0 -128
- mcp_proxy_adapter/commands/echo_command.py +0 -34
- mcp_proxy_adapter/commands/health_command.py +0 -3
- mcp_proxy_adapter/commands/help_command.py +0 -159
- mcp_proxy_adapter/commands/hooks.py +0 -137
- mcp_proxy_adapter/commands/key_management_command.py +0 -25
- mcp_proxy_adapter/commands/load_command.py +7 -78
- mcp_proxy_adapter/commands/plugins_command.py +0 -16
- mcp_proxy_adapter/commands/protocol_management_command.py +0 -28
- mcp_proxy_adapter/commands/proxy_registration_command.py +0 -88
- mcp_proxy_adapter/commands/queue_commands.py +750 -0
- mcp_proxy_adapter/commands/registration_status_command.py +0 -43
- mcp_proxy_adapter/commands/registry/__init__.py +18 -0
- mcp_proxy_adapter/commands/registry/command_info.py +103 -0
- mcp_proxy_adapter/commands/registry/command_loader.py +207 -0
- mcp_proxy_adapter/commands/registry/command_manager.py +119 -0
- mcp_proxy_adapter/commands/registry/command_registry.py +217 -0
- mcp_proxy_adapter/commands/reload_command.py +0 -80
- mcp_proxy_adapter/commands/result.py +25 -77
- mcp_proxy_adapter/commands/role_test_command.py +0 -44
- mcp_proxy_adapter/commands/roles_management_command.py +0 -199
- mcp_proxy_adapter/commands/security_command.py +0 -30
- mcp_proxy_adapter/commands/settings_command.py +0 -68
- mcp_proxy_adapter/commands/ssl_setup_command.py +0 -42
- mcp_proxy_adapter/commands/token_management_command.py +0 -1
- mcp_proxy_adapter/commands/transport_management_command.py +0 -20
- mcp_proxy_adapter/commands/unload_command.py +0 -71
- mcp_proxy_adapter/config.py +15 -626
- mcp_proxy_adapter/core/__init__.py +5 -39
- mcp_proxy_adapter/core/app_factory.py +14 -36
- mcp_proxy_adapter/core/app_runner.py +0 -27
- mcp_proxy_adapter/core/auth_validator.py +1 -93
- mcp_proxy_adapter/core/certificate/__init__.py +20 -0
- mcp_proxy_adapter/core/certificate/certificate_creator.py +371 -0
- mcp_proxy_adapter/core/certificate/certificate_extractor.py +183 -0
- mcp_proxy_adapter/core/certificate/certificate_utils.py +249 -0
- mcp_proxy_adapter/core/certificate/certificate_validator.py +110 -0
- mcp_proxy_adapter/core/certificate/ssl_context_manager.py +70 -0
- mcp_proxy_adapter/core/certificate_utils.py +64 -903
- mcp_proxy_adapter/core/client.py +0 -6
- mcp_proxy_adapter/core/client_manager.py +0 -19
- mcp_proxy_adapter/core/client_security.py +0 -2
- mcp_proxy_adapter/core/config/__init__.py +18 -0
- mcp_proxy_adapter/core/config/config.py +195 -0
- mcp_proxy_adapter/core/config/config_factory.py +22 -0
- mcp_proxy_adapter/core/config/config_loader.py +66 -0
- mcp_proxy_adapter/core/config/feature_manager.py +31 -0
- mcp_proxy_adapter/core/config/simple_config.py +112 -0
- mcp_proxy_adapter/core/config/simple_config_generator.py +50 -0
- mcp_proxy_adapter/core/config/simple_config_validator.py +96 -0
- mcp_proxy_adapter/core/config_converter.py +0 -186
- mcp_proxy_adapter/core/config_validator.py +96 -1238
- mcp_proxy_adapter/core/errors.py +7 -42
- mcp_proxy_adapter/core/job_manager.py +54 -0
- mcp_proxy_adapter/core/logging.py +2 -22
- mcp_proxy_adapter/core/mtls_asgi.py +0 -20
- mcp_proxy_adapter/core/mtls_asgi_app.py +0 -12
- mcp_proxy_adapter/core/mtls_proxy.py +0 -80
- mcp_proxy_adapter/core/mtls_server.py +3 -173
- mcp_proxy_adapter/core/protocol_manager.py +1 -191
- mcp_proxy_adapter/core/proxy/__init__.py +22 -0
- mcp_proxy_adapter/core/proxy/auth_manager.py +27 -0
- mcp_proxy_adapter/core/proxy/proxy_registration_manager.py +137 -0
- mcp_proxy_adapter/core/proxy/registration_client.py +60 -0
- mcp_proxy_adapter/core/proxy/ssl_manager.py +101 -0
- mcp_proxy_adapter/core/proxy_client.py +0 -1
- mcp_proxy_adapter/core/proxy_registration.py +36 -913
- mcp_proxy_adapter/core/role_utils.py +0 -308
- mcp_proxy_adapter/core/security_adapter.py +1 -36
- mcp_proxy_adapter/core/security_factory.py +1 -150
- mcp_proxy_adapter/core/security_integration.py +0 -33
- mcp_proxy_adapter/core/server_adapter.py +1 -40
- mcp_proxy_adapter/core/server_engine.py +2 -173
- mcp_proxy_adapter/core/settings.py +0 -127
- mcp_proxy_adapter/core/signal_handler.py +0 -65
- mcp_proxy_adapter/core/ssl_utils.py +19 -137
- mcp_proxy_adapter/core/transport_manager.py +0 -151
- mcp_proxy_adapter/core/unified_config_adapter.py +1 -193
- mcp_proxy_adapter/core/utils.py +1 -182
- mcp_proxy_adapter/core/validation/__init__.py +21 -0
- mcp_proxy_adapter/core/validation/config_validator.py +211 -0
- mcp_proxy_adapter/core/validation/file_validator.py +73 -0
- mcp_proxy_adapter/core/validation/protocol_validator.py +191 -0
- mcp_proxy_adapter/core/validation/security_validator.py +58 -0
- mcp_proxy_adapter/core/validation/validation_result.py +27 -0
- mcp_proxy_adapter/custom_openapi.py +33 -652
- mcp_proxy_adapter/examples/bugfix_certificate_config.py +0 -23
- mcp_proxy_adapter/examples/check_config.py +0 -2
- mcp_proxy_adapter/examples/client_usage_example.py +164 -0
- mcp_proxy_adapter/examples/config_builder.py +13 -2
- mcp_proxy_adapter/examples/config_cli.py +0 -1
- mcp_proxy_adapter/examples/create_test_configs.py +0 -46
- mcp_proxy_adapter/examples/debug_request_state.py +0 -1
- mcp_proxy_adapter/examples/full_application/commands/custom_echo_command.py +0 -47
- mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.py +0 -45
- mcp_proxy_adapter/examples/full_application/commands/echo_command.py +0 -12
- mcp_proxy_adapter/examples/full_application/commands/help_command.py +0 -12
- mcp_proxy_adapter/examples/full_application/commands/list_command.py +0 -7
- mcp_proxy_adapter/examples/full_application/hooks/__init__.py +0 -2
- mcp_proxy_adapter/examples/full_application/hooks/application_hooks.py +0 -59
- mcp_proxy_adapter/examples/full_application/hooks/builtin_command_hooks.py +0 -54
- mcp_proxy_adapter/examples/full_application/main.py +186 -150
- mcp_proxy_adapter/examples/full_application/proxy_endpoints.py +0 -107
- mcp_proxy_adapter/examples/full_application/test_minimal_server.py +0 -24
- mcp_proxy_adapter/examples/full_application/test_server.py +0 -58
- mcp_proxy_adapter/examples/generate_config.py +65 -11
- mcp_proxy_adapter/examples/queue_demo_simple.py +632 -0
- mcp_proxy_adapter/examples/queue_integration_example.py +578 -0
- mcp_proxy_adapter/examples/queue_server_demo.py +82 -0
- mcp_proxy_adapter/examples/queue_server_example.py +85 -0
- mcp_proxy_adapter/examples/queue_server_simple.py +173 -0
- mcp_proxy_adapter/examples/required_certificates.py +0 -2
- mcp_proxy_adapter/examples/run_full_test_suite.py +0 -29
- mcp_proxy_adapter/examples/run_proxy_server.py +31 -71
- mcp_proxy_adapter/examples/run_security_tests_fixed.py +0 -27
- mcp_proxy_adapter/examples/security_test/__init__.py +18 -0
- mcp_proxy_adapter/examples/security_test/auth_manager.py +14 -0
- mcp_proxy_adapter/examples/security_test/ssl_context_manager.py +28 -0
- mcp_proxy_adapter/examples/security_test/test_client.py +159 -0
- mcp_proxy_adapter/examples/security_test/test_result.py +22 -0
- mcp_proxy_adapter/examples/security_test_client.py +24 -1075
- mcp_proxy_adapter/examples/setup/__init__.py +24 -0
- mcp_proxy_adapter/examples/setup/certificate_manager.py +215 -0
- mcp_proxy_adapter/examples/setup/config_generator.py +12 -0
- mcp_proxy_adapter/examples/setup/config_validator.py +118 -0
- mcp_proxy_adapter/examples/setup/environment_setup.py +62 -0
- mcp_proxy_adapter/examples/setup/test_files_generator.py +10 -0
- mcp_proxy_adapter/examples/setup/test_runner.py +89 -0
- mcp_proxy_adapter/examples/setup_test_environment.py +133 -1425
- mcp_proxy_adapter/examples/test_config.py +0 -3
- mcp_proxy_adapter/examples/test_config_builder.py +25 -405
- mcp_proxy_adapter/examples/test_examples.py +0 -1
- mcp_proxy_adapter/examples/test_framework_complete.py +0 -2
- mcp_proxy_adapter/examples/test_mcp_server.py +0 -1
- mcp_proxy_adapter/examples/test_protocol_examples.py +0 -1
- mcp_proxy_adapter/examples/universal_client.py +0 -6
- mcp_proxy_adapter/examples/update_config_certificates.py +0 -1
- mcp_proxy_adapter/examples/validate_generator_compatibility.py +0 -1
- mcp_proxy_adapter/examples/validate_generator_compatibility_simple.py +0 -187
- mcp_proxy_adapter/integrations/__init__.py +25 -0
- mcp_proxy_adapter/integrations/queuemgr_integration.py +462 -0
- mcp_proxy_adapter/main.py +70 -62
- mcp_proxy_adapter/openapi.py +0 -22
- mcp_proxy_adapter/version.py +1 -1
- {mcp_proxy_adapter-6.9.28.dist-info → mcp_proxy_adapter-6.9.29.dist-info}/METADATA +2 -1
- mcp_proxy_adapter-6.9.29.dist-info/RECORD +235 -0
- {mcp_proxy_adapter-6.9.28.dist-info → mcp_proxy_adapter-6.9.29.dist-info}/entry_points.txt +1 -1
- mcp_proxy_adapter-6.9.28.dist-info/RECORD +0 -149
- {mcp_proxy_adapter-6.9.28.dist-info → mcp_proxy_adapter-6.9.29.dist-info}/WHEEL +0 -0
- {mcp_proxy_adapter-6.9.28.dist-info → mcp_proxy_adapter-6.9.29.dist-info}/top_level.txt +0 -0
|
@@ -13,7 +13,6 @@ import os
|
|
|
13
13
|
import json
|
|
14
14
|
from typing import Dict, List, Optional, Any
|
|
15
15
|
from pathlib import Path
|
|
16
|
-
from datetime import datetime, timedelta
|
|
17
16
|
|
|
18
17
|
from .base import Command
|
|
19
18
|
from .result import CommandResult, SuccessResult, ErrorResult
|
|
@@ -67,77 +66,8 @@ class CertMonitorResult:
|
|
|
67
66
|
self.auto_renewal_status = auto_renewal_status
|
|
68
67
|
self.error = error
|
|
69
68
|
|
|
70
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
71
|
-
"""
|
|
72
|
-
Convert to dictionary format.
|
|
73
|
-
|
|
74
|
-
Returns:
|
|
75
|
-
Dictionary representation
|
|
76
|
-
"""
|
|
77
|
-
return {
|
|
78
|
-
"cert_path": self.cert_path,
|
|
79
|
-
"check_type": self.check_type,
|
|
80
|
-
"status": self.status,
|
|
81
|
-
"expiry_date": self.expiry_date,
|
|
82
|
-
"days_until_expiry": self.days_until_expiry,
|
|
83
|
-
"health_score": self.health_score,
|
|
84
|
-
"alerts": self.alerts,
|
|
85
|
-
"auto_renewal_status": self.auto_renewal_status,
|
|
86
|
-
"error": self.error,
|
|
87
|
-
}
|
|
88
69
|
|
|
89
70
|
@classmethod
|
|
90
|
-
def get_schema(cls) -> Dict[str, Any]:
|
|
91
|
-
"""
|
|
92
|
-
Get JSON schema for this result.
|
|
93
|
-
|
|
94
|
-
Returns:
|
|
95
|
-
JSON schema dictionary
|
|
96
|
-
"""
|
|
97
|
-
return {
|
|
98
|
-
"type": "object",
|
|
99
|
-
"properties": {
|
|
100
|
-
"cert_path": {
|
|
101
|
-
"type": "string",
|
|
102
|
-
"description": "Path to certificate file",
|
|
103
|
-
},
|
|
104
|
-
"check_type": {
|
|
105
|
-
"type": "string",
|
|
106
|
-
"enum": ["expiry", "health", "alert", "auto_renewal"],
|
|
107
|
-
"description": "Type of check performed",
|
|
108
|
-
},
|
|
109
|
-
"status": {
|
|
110
|
-
"type": "string",
|
|
111
|
-
"enum": ["healthy", "warning", "critical", "error"],
|
|
112
|
-
"description": "Overall status",
|
|
113
|
-
},
|
|
114
|
-
"expiry_date": {
|
|
115
|
-
"type": "string",
|
|
116
|
-
"description": "Certificate expiry date",
|
|
117
|
-
},
|
|
118
|
-
"days_until_expiry": {
|
|
119
|
-
"type": "integer",
|
|
120
|
-
"description": "Days until certificate expires",
|
|
121
|
-
},
|
|
122
|
-
"health_score": {
|
|
123
|
-
"type": "integer",
|
|
124
|
-
"minimum": 0,
|
|
125
|
-
"maximum": 100,
|
|
126
|
-
"description": "Health score (0-100)",
|
|
127
|
-
},
|
|
128
|
-
"alerts": {
|
|
129
|
-
"type": "array",
|
|
130
|
-
"items": {"type": "string"},
|
|
131
|
-
"description": "List of alert messages",
|
|
132
|
-
},
|
|
133
|
-
"auto_renewal_status": {
|
|
134
|
-
"type": "string",
|
|
135
|
-
"description": "Auto-renewal status",
|
|
136
|
-
},
|
|
137
|
-
"error": {"type": "string", "description": "Error message if any"},
|
|
138
|
-
},
|
|
139
|
-
"required": ["cert_path", "check_type", "status"],
|
|
140
|
-
}
|
|
141
71
|
|
|
142
72
|
|
|
143
73
|
class CertMonitorCommand(Command):
|
|
@@ -550,24 +480,6 @@ class CertMonitorCommand(Command):
|
|
|
550
480
|
get_global_logger().error(f"Auto-renewal setup failed: {e}")
|
|
551
481
|
return ErrorResult(message=f"Auto-renewal setup failed: {str(e)}")
|
|
552
482
|
|
|
553
|
-
def _find_certificates(self, directory: str) -> List[str]:
|
|
554
|
-
"""
|
|
555
|
-
Find all certificate files in a directory.
|
|
556
|
-
|
|
557
|
-
Args:
|
|
558
|
-
directory: Directory to scan
|
|
559
|
-
|
|
560
|
-
Returns:
|
|
561
|
-
List of certificate file paths
|
|
562
|
-
"""
|
|
563
|
-
certificates = []
|
|
564
|
-
cert_extensions = [".crt", ".pem", ".cer", ".der"]
|
|
565
|
-
|
|
566
|
-
for file_path in Path(directory).rglob("*"):
|
|
567
|
-
if file_path.is_file() and file_path.suffix.lower() in cert_extensions:
|
|
568
|
-
certificates.append(str(file_path))
|
|
569
|
-
|
|
570
|
-
return certificates
|
|
571
483
|
|
|
572
484
|
async def _test_alert_config(self, alert_config: Dict[str, Any]) -> Dict[str, Any]:
|
|
573
485
|
"""
|
|
@@ -82,51 +82,6 @@ class CertificateResult:
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
@classmethod
|
|
85
|
-
def get_schema(cls) -> Dict[str, Any]:
|
|
86
|
-
"""
|
|
87
|
-
Get JSON schema for this result.
|
|
88
|
-
|
|
89
|
-
Returns:
|
|
90
|
-
JSON schema dictionary
|
|
91
|
-
"""
|
|
92
|
-
return {
|
|
93
|
-
"type": "object",
|
|
94
|
-
"properties": {
|
|
95
|
-
"cert_path": {
|
|
96
|
-
"type": "string",
|
|
97
|
-
"description": "Path to certificate file",
|
|
98
|
-
},
|
|
99
|
-
"cert_type": {
|
|
100
|
-
"type": "string",
|
|
101
|
-
"enum": ["CA", "server", "client"],
|
|
102
|
-
"description": "Type of certificate",
|
|
103
|
-
},
|
|
104
|
-
"common_name": {
|
|
105
|
-
"type": "string",
|
|
106
|
-
"description": "Common name of certificate",
|
|
107
|
-
},
|
|
108
|
-
"roles": {
|
|
109
|
-
"type": "array",
|
|
110
|
-
"items": {"type": "string"},
|
|
111
|
-
"description": "List of roles assigned to certificate",
|
|
112
|
-
},
|
|
113
|
-
"expiry_date": {
|
|
114
|
-
"type": "string",
|
|
115
|
-
"description": "Certificate expiry date",
|
|
116
|
-
},
|
|
117
|
-
"serial_number": {
|
|
118
|
-
"type": "string",
|
|
119
|
-
"description": "Certificate serial number",
|
|
120
|
-
},
|
|
121
|
-
"status": {
|
|
122
|
-
"type": "string",
|
|
123
|
-
"enum": ["valid", "expired", "revoked", "error"],
|
|
124
|
-
"description": "Certificate status",
|
|
125
|
-
},
|
|
126
|
-
"error": {"type": "string", "description": "Error message if any"},
|
|
127
|
-
},
|
|
128
|
-
"required": ["cert_path", "cert_type", "common_name", "status"],
|
|
129
|
-
}
|
|
130
85
|
|
|
131
86
|
|
|
132
87
|
class CertificateManagementCommand(Command):
|