mcp-proxy-adapter 6.4.2__tar.gz → 6.9.51__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.
Potentially problematic release.
This version of mcp-proxy-adapter might be problematic. Click here for more details.
- mcp_proxy_adapter-6.9.51/PKG-INFO +1088 -0
- mcp_proxy_adapter-6.9.51/README.md +1027 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/__init__.py +10 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/__main__.py +13 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/app.py +66 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/core/__init__.py +18 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/core/app_factory.py +400 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/core/lifespan_manager.py +54 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/core/registration_context.py +356 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/core/registration_manager.py +396 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/core/registration_tasks.py +119 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/core/ssl_context_factory.py +88 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/handlers.py +181 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/middleware/__init__.py +21 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/middleware/base.py +54 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/middleware/command_permission_middleware.py +73 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/middleware/error_handling.py +76 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/middleware/factory.py +147 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/middleware/logging.py +31 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/api/middleware/performance.py +3 -38
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/middleware/protocol_middleware.py +140 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/api/middleware/transport_middleware.py +2 -39
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/api/middleware/unified_security.py +34 -37
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/middleware/user_info_middleware.py +132 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/openapi/__init__.py +21 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/openapi/command_integration.py +105 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/openapi/openapi_generator.py +40 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/openapi/openapi_registry.py +62 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/openapi/schema_loader.py +116 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/api/schemas.py +0 -61
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/api/tool_integration.py +131 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/api/tools.py +4 -49
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/__init__.py +12 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/commands/__init__.py +15 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/commands/client.py +100 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/commands/config_generate.py +105 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/commands/config_validate.py +94 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/commands/generate.py +259 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/commands/server.py +174 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/commands/sets.py +132 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/commands/testconfig.py +177 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/examples/__init__.py +8 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/examples/http_basic.py +82 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/examples/https_token.py +96 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/examples/mtls_roles.py +103 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/main.py +63 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/parser.py +338 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/cli/validators.py +231 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/client/jsonrpc_client/__init__.py +9 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/client/jsonrpc_client/client.py +42 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/client/jsonrpc_client/command_api.py +45 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/client/jsonrpc_client/proxy_api.py +224 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/client/jsonrpc_client/queue_api.py +60 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/client/jsonrpc_client/transport.py +108 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/client/proxy.py +123 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/__init__.py +66 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/auth_validation_command.py +69 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/base.py +29 -53
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/builtin_commands.py +30 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/catalog/__init__.py +20 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/catalog/catalog_loader.py +34 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/catalog/catalog_manager.py +122 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/catalog/catalog_syncer.py +149 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/catalog/command_catalog.py +43 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/catalog/dependency_manager.py +37 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/catalog_manager.py +97 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/cert_monitor_command.py +13 -100
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/certificate_management_command.py +20 -64
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/command_registry.py +298 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/config_command.py +3 -29
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/dependency_container.py +40 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/dependency_manager.py +143 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/echo_command.py +0 -34
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/health_command.py +0 -3
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/help_command.py +175 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/hooks.py +172 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/key_management_command.py +19 -43
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/load_command.py +7 -78
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/plugins_command.py +2 -17
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/protocol_management_command.py +6 -34
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/proxy_registration_command.py +22 -104
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/queue_commands.py +750 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/registration_status_command.py +76 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/registry/__init__.py +18 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/registry/command_info.py +103 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/registry/command_loader.py +207 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/registry/command_manager.py +119 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/commands/registry/command_registry.py +217 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/reload_command.py +6 -86
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/result.py +25 -77
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/role_test_command.py +2 -45
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/roles_management_command.py +9 -207
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/security_command.py +3 -32
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/settings_command.py +0 -68
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/ssl_setup_command.py +7 -48
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/token_management_command.py +12 -12
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/transport_management_command.py +2 -22
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/commands/unload_command.py +0 -71
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/config.py +32 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/__init__.py +8 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/app_factory.py +166 -101
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/app_runner.py +70 -41
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/auth_validator.py +9 -101
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/certificate/__init__.py +20 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/certificate/certificate_creator.py +372 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/certificate/certificate_extractor.py +185 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/certificate/certificate_utils.py +249 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/certificate/certificate_validator.py +481 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/certificate/ssl_context_manager.py +65 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/certificate_utils.py +249 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/client.py +10 -9
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/client_manager.py +13 -32
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/client_security.py +39 -36
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/config/__init__.py +18 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/config/config.py +237 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/config/config_factory.py +22 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/config/config_loader.py +66 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/config/feature_manager.py +31 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/config/simple_config.py +204 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/config/simple_config_generator.py +131 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/config/simple_config_validator.py +476 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/config_converter.py +3 -189
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/config_validator.py +211 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/crl_utils.py +22 -22
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/errors.py +84 -25
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/job_manager.py +54 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/logging.py +37 -66
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/mtls_asgi.py +5 -25
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/mtls_asgi_app.py +9 -21
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/mtls_proxy.py +229 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/mtls_server.py +154 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/protocol_manager.py +232 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/proxy/__init__.py +19 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/proxy/auth_manager.py +26 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/proxy/proxy_registration_manager.py +160 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/proxy/registration_client.py +186 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/proxy/ssl_manager.py +101 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/proxy_client.py +1 -2
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/proxy_registration.py +80 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/role_utils.py +103 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/security_adapter.py +23 -61
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/security_factory.py +96 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/security_integration.py +70 -143
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/server_adapter.py +18 -53
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/server_engine.py +217 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/settings.py +0 -127
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/signal_handler.py +107 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/ssl_utils.py +161 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/transport_manager.py +153 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/core/unified_config_adapter.py +45 -204
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/utils.py +101 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/validation/__init__.py +21 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/validation/config_validator.py +219 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/validation/file_validator.py +131 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/validation/protocol_validator.py +205 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/validation/security_validator.py +140 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/core/validation/validation_result.py +27 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/custom_openapi.py +58 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/basic_framework/main.py +10 -10
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/bugfix_certificate_config.py +261 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/cert_manager_bugfix.py +203 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/check_config.py +413 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/client_usage_example.py +164 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/config_builder.py +234 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/config_cli.py +282 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/create_test_configs.py +174 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/debug_request_state.py +0 -1
- {mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples → mcp_proxy_adapter-6.9.51/mcp_proxy_adapter}/examples/full_application/__init__.py +2 -3
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/commands/__init__.py +8 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/commands/custom_echo_command.py +45 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.py +52 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/commands/echo_command.py +32 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/commands/help_command.py +54 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/commands/list_command.py +57 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/hooks/__init__.py +5 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/hooks/application_hooks.py +29 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/hooks/builtin_command_hooks.py +27 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/main.py +284 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/proxy_endpoints.py +161 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/run_mtls.py +252 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/run_simple.py +152 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/test_minimal_server.py +45 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/test_server.py +163 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/full_application/test_simple_server.py +62 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/generate_config.py +502 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/proxy_registration_example.py +38 -38
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/queue_demo_simple.py +632 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/queue_integration_example.py +578 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/queue_server_demo.py +82 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/queue_server_example.py +85 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/queue_server_simple.py +173 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/required_certificates.py +208 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/run_full_test_suite.py +619 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/run_proxy_server.py +153 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/run_security_tests_fixed.py +195 -43
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/security_test/__init__.py +18 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/security_test/auth_manager.py +14 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/security_test/ssl_context_manager.py +28 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/security_test/test_client.py +159 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/security_test/test_result.py +22 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/security_test_client.py +72 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/setup/__init__.py +24 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/setup/certificate_manager.py +215 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/setup/config_generator.py +12 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/setup/config_validator.py +118 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/setup/environment_setup.py +62 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/setup/test_files_generator.py +10 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/setup/test_runner.py +89 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/setup_test_environment.py +235 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/simple_protocol_test.py +125 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/test_chk_hostname_automated.py +211 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/test_config.py +46 -4
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/test_config_builder.py +110 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/test_examples.py +0 -1
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/test_framework_complete.py +267 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/test_mcp_server.py +187 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/test_protocol_examples.py +337 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/universal_client.py +0 -6
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/update_config_certificates.py +135 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/validate_generator_compatibility.py +385 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/examples/validate_generator_compatibility_simple.py +61 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/integrations/__init__.py +25 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/integrations/queuemgr_integration.py +462 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/main.py +311 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/openapi.py +0 -22
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/schemas/roles.json +37 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter/schemas/roles_schema.json +162 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/version.py +1 -1
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter.egg-info/PKG-INFO +1088 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter.egg-info/SOURCES.txt +531 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter.egg-info/dependency_links.txt +1 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter.egg-info/entry_points.txt +14 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter.egg-info/not-zip-safe +1 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter.egg-info/requires.txt +29 -0
- mcp_proxy_adapter-6.9.51/mcp_proxy_adapter.egg-info/top_level.txt +1 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/pyproject.toml +22 -9
- mcp_proxy_adapter-6.9.51/setup.py +128 -0
- mcp_proxy_adapter-6.9.51/tests/test_all_modes.py +395 -0
- mcp_proxy_adapter-6.9.51/tests/test_all_modes_automated.py +204 -0
- mcp_proxy_adapter-6.9.51/tests/test_all_modes_comprehensive.py +652 -0
- mcp_proxy_adapter-6.9.51/tests/test_all_modes_docker.py +367 -0
- mcp_proxy_adapter-6.9.51/tests/test_all_modes_final.py +460 -0
- mcp_proxy_adapter-6.9.51/tests/test_all_modes_fixed.py +674 -0
- mcp_proxy_adapter-6.9.51/tests/test_all_modes_sequential.py +135 -0
- mcp_proxy_adapter-6.9.51/tests/test_basic_modes.py +160 -0
- mcp_proxy_adapter-6.9.51/tests/test_certificate_validation.py +345 -0
- mcp_proxy_adapter-6.9.51/tests/test_cli_generate.py +226 -0
- mcp_proxy_adapter-6.9.51/tests/test_cli_validators.py +258 -0
- mcp_proxy_adapter-6.9.51/tests/test_command_registration.py +36 -0
- mcp_proxy_adapter-6.9.51/tests/test_config_integration.py +287 -0
- mcp_proxy_adapter-6.9.51/tests/test_config_validation.py +149 -0
- mcp_proxy_adapter-6.9.51/tests/test_config_validation_isolated.py +458 -0
- mcp_proxy_adapter-6.9.51/tests/test_curl.py +50 -0
- mcp_proxy_adapter-6.9.51/tests/test_direct.py +101 -0
- mcp_proxy_adapter-6.9.51/tests/test_direct_import.py +87 -0
- mcp_proxy_adapter-6.9.51/tests/test_docker_logging_issue.py +36 -0
- mcp_proxy_adapter-6.9.51/tests/test_final_curl.py +50 -0
- mcp_proxy_adapter-6.9.51/tests/test_generator_comprehensive.py +381 -0
- mcp_proxy_adapter-6.9.51/tests/test_generator_simple.py +381 -0
- mcp_proxy_adapter-6.9.51/tests/test_http_basic.py +82 -0
- mcp_proxy_adapter-6.9.51/tests/test_http_basic_direct.py +87 -0
- mcp_proxy_adapter-6.9.51/tests/test_http_handler.py +52 -0
- mcp_proxy_adapter-6.9.51/tests/test_isolated_validation.py +281 -0
- mcp_proxy_adapter-6.9.51/tests/test_jsonrpc_handler.py +42 -0
- mcp_proxy_adapter-6.9.51/tests/test_manual.py +55 -0
- mcp_proxy_adapter-6.9.51/tests/test_middleware_debug.py +89 -0
- mcp_proxy_adapter-6.9.51/tests/test_mode.py +104 -0
- mcp_proxy_adapter-6.9.51/tests/test_mtls_server.py +134 -0
- mcp_proxy_adapter-6.9.51/tests/test_no_defaults.py +313 -0
- mcp_proxy_adapter-6.9.51/tests/test_registry_commands.py +44 -0
- mcp_proxy_adapter-6.9.51/tests/test_reload_system.py +46 -0
- mcp_proxy_adapter-6.9.51/tests/test_security_framework_1_2_8.py +348 -0
- mcp_proxy_adapter-6.9.51/tests/test_security_framework_1_2_8_simple.py +341 -0
- mcp_proxy_adapter-6.9.51/tests/test_server_background.py +101 -0
- mcp_proxy_adapter-6.9.51/tests/test_simple.py +87 -0
- mcp_proxy_adapter-6.9.51/tests/test_simple_config.py +57 -0
- mcp_proxy_adapter-6.9.51/tests/test_simple_modes.py +278 -0
- mcp_proxy_adapter-6.9.51/tests/test_simple_validation.py +197 -0
- mcp_proxy_adapter-6.9.51/tests/test_single_mode.py +84 -0
- mcp_proxy_adapter-6.9.51/tests/test_ssl_compatibility.py +157 -0
- mcp_proxy_adapter-6.9.51/tests/test_system_ca_validation.py +291 -0
- mcp_proxy_adapter-6.9.51/tests/test_user_exact_config.py +100 -0
- mcp_proxy_adapter-6.9.51/tests/test_uuid_transmission.py +151 -0
- mcp_proxy_adapter-6.9.51/tests/test_uuid_validation.py +174 -0
- mcp_proxy_adapter-6.4.2/MANIFEST.in +0 -40
- mcp_proxy_adapter-6.4.2/PKG-INFO +0 -680
- mcp_proxy_adapter-6.4.2/README.md +0 -621
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/__main__.py +0 -26
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/app.py +0 -865
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/handlers.py +0 -266
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/middleware/__init__.py +0 -57
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/middleware/base.py +0 -96
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/middleware/command_permission_middleware.py +0 -158
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/middleware/error_handling.py +0 -202
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/middleware/factory.py +0 -241
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/middleware/logging.py +0 -143
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/middleware/protocol_middleware.py +0 -303
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/middleware/user_info_middleware.py +0 -241
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/api/tool_integration.py +0 -247
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/commands/__init__.py +0 -46
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/commands/auth_validation_command.py +0 -405
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/commands/builtin_commands.py +0 -105
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/commands/catalog_manager.py +0 -967
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/commands/command_registry.py +0 -1001
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/commands/dependency_container.py +0 -109
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/commands/dependency_manager.py +0 -271
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/commands/help_command.py +0 -333
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/commands/hooks.py +0 -309
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/config.py +0 -593
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/__init__.py +0 -42
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/certificate_utils.py +0 -1088
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/config_validator.py +0 -218
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/protocol_manager.py +0 -439
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/proxy_registration.py +0 -783
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/role_utils.py +0 -440
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/security_factory.py +0 -245
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/server_engine.py +0 -288
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/ssl_utils.py +0 -279
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/transport_manager.py +0 -304
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/core/utils.py +0 -140
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/custom_openapi.py +0 -385
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/basic_framework/roles.json +0 -21
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/create_certificates_simple.py +0 -661
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/basic_framework/__init__.py +0 -9
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/basic_framework/commands/__init__.py +0 -4
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/basic_framework/hooks/__init__.py +0 -4
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/basic_framework/main.py +0 -51
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/full_application/commands/__init__.py +0 -7
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/full_application/commands/custom_echo_command.py +0 -92
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/full_application/commands/dynamic_calculator_command.py +0 -97
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/full_application/hooks/__init__.py +0 -7
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/full_application/hooks/application_hooks.py +0 -88
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/full_application/hooks/builtin_command_hooks.py +0 -81
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/full_application/main.py +0 -198
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/examples/full_application/proxy_endpoints.py +0 -188
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/full_application/__init__.py +0 -13
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/full_application/commands/__init__.py +0 -7
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/full_application/commands/custom_echo_command.py +0 -92
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.py +0 -97
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/full_application/hooks/__init__.py +0 -7
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/full_application/hooks/application_hooks.py +0 -88
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/full_application/hooks/builtin_command_hooks.py +0 -81
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/full_application/main.py +0 -198
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/full_application/proxy_endpoints.py +0 -188
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/full_application/roles.json +0 -21
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/generate_all_certificates.py +0 -487
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/generate_certificates.py +0 -192
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/generate_certificates_and_tokens.py +0 -515
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/generate_comprehensive_config.py +0 -177
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/generate_test_configs.py +0 -393
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/run_full_test_suite.py +0 -356
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/run_proxy_server.py +0 -159
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/run_security_tests.py +0 -606
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/scripts/config_generator.py +0 -842
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/scripts/create_certificates_simple.py +0 -673
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/scripts/generate_certificates_and_tokens.py +0 -515
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/security_test_client.py +0 -851
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/setup_test_environment.py +0 -1091
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/examples/test_config_generator.py +0 -102
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/main.py +0 -151
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter/utils/config_generator.py +0 -1167
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter.egg-info/SOURCES.txt +0 -146
- mcp_proxy_adapter-6.4.2/mcp_proxy_adapter_issue_package/demonstrate_issue.py +0 -208
- mcp_proxy_adapter-6.4.2/requirements.txt +0 -8
- mcp_proxy_adapter-6.4.2/setup.py +0 -624
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/api/__init__.py +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/__init__.py +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/basic_framework/__init__.py +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/basic_framework/commands/__init__.py +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/basic_framework/hooks/__init__.py +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/commands/__init__.py +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/debug_role_chain.py +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/demo_client.py +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/examples/run_example.py +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/schemas/base_schema.json +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/mcp_proxy_adapter/schemas/openapi_schema.json +0 -0
- {mcp_proxy_adapter-6.4.2 → mcp_proxy_adapter-6.9.51}/setup.cfg +0 -0
|
@@ -0,0 +1,1088 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcp-proxy-adapter
|
|
3
|
+
Version: 6.9.51
|
|
4
|
+
Summary: Powerful JSON-RPC microservices framework with built-in security, authentication, and proxy registration
|
|
5
|
+
Home-page: https://github.com/maverikod/mcp-proxy-adapter
|
|
6
|
+
Author: Vasiliy Zdanovskiy
|
|
7
|
+
Author-email: Vasiliy Zdanovskiy <vasilyvz@gmail.com>
|
|
8
|
+
Maintainer: Vasiliy Zdanovskiy
|
|
9
|
+
Maintainer-email: Vasiliy Zdanovskiy <vasilyvz@gmail.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
Project-URL: Homepage, https://github.com/maverikod/mcp-proxy-adapter
|
|
12
|
+
Project-URL: Documentation, https://github.com/maverikod/mcp-proxy-adapter#readme
|
|
13
|
+
Project-URL: Source, https://github.com/maverikod/mcp-proxy-adapter
|
|
14
|
+
Project-URL: Tracker, https://github.com/maverikod/mcp-proxy-adapter/issues
|
|
15
|
+
Project-URL: PyPI, https://pypi.org/project/mcp-proxy-adapter/
|
|
16
|
+
Keywords: json-rpc,microservices,fastapi,security,authentication,authorization,proxy,mcp,mtls,ssl,rest,api
|
|
17
|
+
Classifier: Development Status :: 4 - Beta
|
|
18
|
+
Classifier: Intended Audience :: Developers
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
25
|
+
Classifier: Framework :: FastAPI
|
|
26
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
27
|
+
Classifier: Topic :: Security
|
|
28
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
29
|
+
Requires-Python: >=3.9
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
Requires-Dist: fastapi<1.0.0,>=0.95.0
|
|
32
|
+
Requires-Dist: pydantic>=2.0.0
|
|
33
|
+
Requires-Dist: hypercorn<1.0.0,>=0.15.0
|
|
34
|
+
Requires-Dist: docstring-parser<1.0.0,>=0.15
|
|
35
|
+
Requires-Dist: typing-extensions<5.0.0,>=4.5.0
|
|
36
|
+
Requires-Dist: jsonrpc>=1.2.0
|
|
37
|
+
Requires-Dist: psutil>=5.9.0
|
|
38
|
+
Requires-Dist: mcp_security_framework>=1.2.8
|
|
39
|
+
Requires-Dist: flask>=3.1.0
|
|
40
|
+
Requires-Dist: packaging>=20.0
|
|
41
|
+
Requires-Dist: aiohttp<4.0.0,>=3.8.0
|
|
42
|
+
Requires-Dist: httpx>=0.24.0
|
|
43
|
+
Requires-Dist: queuemgr>=1.0.5
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
46
|
+
Requires-Dist: pytest-asyncio>=0.20.0; extra == "dev"
|
|
47
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
48
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
49
|
+
Requires-Dist: isort>=5.12.0; extra == "dev"
|
|
50
|
+
Provides-Extra: test
|
|
51
|
+
Requires-Dist: pytest>=7.0.0; extra == "test"
|
|
52
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "test"
|
|
53
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
|
|
54
|
+
Requires-Dist: httpx>=0.24.0; extra == "test"
|
|
55
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == "test"
|
|
56
|
+
Provides-Extra: examples
|
|
57
|
+
Dynamic: author
|
|
58
|
+
Dynamic: home-page
|
|
59
|
+
Dynamic: maintainer
|
|
60
|
+
Dynamic: requires-python
|
|
61
|
+
|
|
62
|
+
# MCP Proxy Adapter
|
|
63
|
+
|
|
64
|
+
**Author:** Vasiliy Zdanovskiy
|
|
65
|
+
**Email:** vasilyvz@gmail.com
|
|
66
|
+
|
|
67
|
+
## Overview
|
|
68
|
+
|
|
69
|
+
MCP Proxy Adapter is a comprehensive framework for building JSON-RPC API servers with built-in security, SSL/TLS support, and proxy registration capabilities. It provides a unified interface for command execution, protocol management, and security enforcement.
|
|
70
|
+
|
|
71
|
+
## Features
|
|
72
|
+
|
|
73
|
+
- **JSON-RPC API**: Full JSON-RPC 2.0 support with built-in commands
|
|
74
|
+
- **Security Framework**: Integrated authentication, authorization, and SSL/TLS
|
|
75
|
+
- **Protocol Management**: HTTP, HTTPS, and mTLS protocol support
|
|
76
|
+
- **Proxy Registration**: Automatic registration with proxy servers
|
|
77
|
+
- **Command System**: Extensible command registry with built-in commands
|
|
78
|
+
- **Configuration Management**: Comprehensive configuration with environment variable overrides
|
|
79
|
+
|
|
80
|
+
## Quick Start
|
|
81
|
+
|
|
82
|
+
1. **Installation**:
|
|
83
|
+
```bash
|
|
84
|
+
pip install mcp-proxy-adapter
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
2. **Generate Configuration**:
|
|
88
|
+
```bash
|
|
89
|
+
# Generate a simple HTTP configuration
|
|
90
|
+
adapter-cfg-gen --protocol http --out config.json
|
|
91
|
+
|
|
92
|
+
# Generate HTTPS configuration with proxy registration
|
|
93
|
+
adapter-cfg-gen --protocol https --with-proxy --out config.json
|
|
94
|
+
|
|
95
|
+
# Generate mTLS configuration with custom certificates
|
|
96
|
+
adapter-cfg-gen --protocol mtls \
|
|
97
|
+
--server-cert-file ./certs/server.crt \
|
|
98
|
+
--server-key-file ./certs/server.key \
|
|
99
|
+
--server-ca-cert-file ./certs/ca.crt \
|
|
100
|
+
--out config.json
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
3. **Validate Configuration**:
|
|
104
|
+
```bash
|
|
105
|
+
# Validate configuration file
|
|
106
|
+
adapter-cfg-val --file config.json
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
4. **Start Server**:
|
|
110
|
+
```bash
|
|
111
|
+
# Use the generated configuration
|
|
112
|
+
python -m mcp_proxy_adapter --config config.json
|
|
113
|
+
# Or use the main CLI
|
|
114
|
+
mcp-proxy-adapter config validate --file config.json
|
|
115
|
+
mcp-proxy-adapter server --config config.json
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
5. **Access the API**:
|
|
119
|
+
- Health check: `GET http://localhost:8000/health`
|
|
120
|
+
- JSON-RPC: `POST http://localhost:8000/api/jsonrpc`
|
|
121
|
+
- REST API: `POST http://localhost:8000/cmd`
|
|
122
|
+
- Documentation: `http://localhost:8000/docs`
|
|
123
|
+
|
|
124
|
+
## Configuration
|
|
125
|
+
|
|
126
|
+
The adapter uses a comprehensive JSON configuration file (`config.json`) that includes all available options. **All features are disabled by default** and must be explicitly enabled. The configuration system has **NO default values** - all configuration must be explicitly specified.
|
|
127
|
+
|
|
128
|
+
### Configuration Sections
|
|
129
|
+
|
|
130
|
+
#### 1. `uuid` (Root Level)
|
|
131
|
+
**Type**: `string` (UUID4 format)
|
|
132
|
+
**Required**: YES
|
|
133
|
+
**Description**: Unique identifier for the server instance
|
|
134
|
+
**Format**: `xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx`
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"uuid": "123e4567-e89b-42d3-a456-426614174000"
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
#### 2. `server` Section
|
|
143
|
+
**Required**: YES
|
|
144
|
+
**Description**: Core server configuration settings
|
|
145
|
+
|
|
146
|
+
| Field | Type | Required | Description | Allowed Values |
|
|
147
|
+
|-------|------|----------|-------------|----------------|
|
|
148
|
+
| `host` | string | YES | Server host address | Any valid IP or hostname |
|
|
149
|
+
| `port` | integer | YES | Server port number | 1-65535 |
|
|
150
|
+
| `protocol` | string | YES | Server protocol | `"http"`, `"https"`, `"mtls"` |
|
|
151
|
+
| `debug` | boolean | YES | Enable debug mode | `true`, `false` |
|
|
152
|
+
| `log_level` | string | YES | Logging level | `"DEBUG"`, `"INFO"`, `"WARNING"`, `"ERROR"` |
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"server": {
|
|
157
|
+
"host": "0.0.0.0",
|
|
158
|
+
"port": 8080,
|
|
159
|
+
"protocol": "http",
|
|
160
|
+
"debug": false,
|
|
161
|
+
"log_level": "INFO"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### 3. `logging` Section
|
|
167
|
+
**Required**: YES
|
|
168
|
+
**Description**: Logging configuration settings
|
|
169
|
+
|
|
170
|
+
| Field | Type | Required | Description |
|
|
171
|
+
|-------|------|----------|-------------|
|
|
172
|
+
| `level` | string | YES | Log level (`"INFO"`, `"DEBUG"`, `"WARNING"`, `"ERROR"`) |
|
|
173
|
+
| `log_dir` | string | YES | Directory for log files |
|
|
174
|
+
| `log_file` | string | YES | Main log file name |
|
|
175
|
+
| `error_log_file` | string | YES | Error log file name |
|
|
176
|
+
| `access_log_file` | string | YES | Access log file name |
|
|
177
|
+
| `max_file_size` | string/integer | YES | Maximum log file size (`"10MB"` or `10485760`) |
|
|
178
|
+
| `backup_count` | integer | YES | Number of backup log files |
|
|
179
|
+
| `format` | string | YES | Log message format (Python logging format string) |
|
|
180
|
+
| `date_format` | string | YES | Date format for logs |
|
|
181
|
+
| `console_output` | boolean | YES | Enable console logging |
|
|
182
|
+
| `file_output` | boolean | YES | Enable file logging |
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"logging": {
|
|
187
|
+
"level": "INFO",
|
|
188
|
+
"log_dir": "./logs",
|
|
189
|
+
"log_file": "mcp_proxy_adapter.log",
|
|
190
|
+
"error_log_file": "mcp_proxy_adapter_error.log",
|
|
191
|
+
"access_log_file": "mcp_proxy_adapter_access.log",
|
|
192
|
+
"max_file_size": "10MB",
|
|
193
|
+
"backup_count": 5,
|
|
194
|
+
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
195
|
+
"date_format": "%Y-%m-%d %H:%M:%S",
|
|
196
|
+
"console_output": true,
|
|
197
|
+
"file_output": true
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
#### 4. `commands` Section
|
|
203
|
+
**Required**: YES
|
|
204
|
+
**Description**: Command management configuration
|
|
205
|
+
|
|
206
|
+
| Field | Type | Required | Description |
|
|
207
|
+
|-------|------|----------|-------------|
|
|
208
|
+
| `auto_discovery` | boolean | YES | Enable automatic command discovery |
|
|
209
|
+
| `commands_directory` | string | YES | Directory for command files |
|
|
210
|
+
| `catalog_directory` | string | YES | Directory for command catalog |
|
|
211
|
+
| `plugin_servers` | array | YES | List of plugin server URLs |
|
|
212
|
+
| `auto_install_dependencies` | boolean | YES | Auto-install command dependencies |
|
|
213
|
+
| `enabled_commands` | array | YES | List of enabled commands |
|
|
214
|
+
| `disabled_commands` | array | YES | List of disabled commands |
|
|
215
|
+
| `custom_commands_path` | string | YES | Path to custom commands |
|
|
216
|
+
|
|
217
|
+
```json
|
|
218
|
+
{
|
|
219
|
+
"commands": {
|
|
220
|
+
"auto_discovery": true,
|
|
221
|
+
"commands_directory": "./commands",
|
|
222
|
+
"catalog_directory": "./catalog",
|
|
223
|
+
"plugin_servers": [],
|
|
224
|
+
"auto_install_dependencies": true,
|
|
225
|
+
"enabled_commands": ["health", "echo", "help"],
|
|
226
|
+
"disabled_commands": [],
|
|
227
|
+
"custom_commands_path": "./commands"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### 5. `transport` Section
|
|
233
|
+
**Required**: YES
|
|
234
|
+
**Description**: Transport layer configuration
|
|
235
|
+
|
|
236
|
+
| Field | Type | Required | Description | Allowed Values |
|
|
237
|
+
|-------|------|----------|-------------|----------------|
|
|
238
|
+
| `type` | string | YES | Transport type | `"http"`, `"https"`, `"mtls"` |
|
|
239
|
+
| `port` | integer/null | YES | Transport port (can be null) | 1-65535 or `null` |
|
|
240
|
+
| `verify_client` | boolean | YES | Enable client certificate verification | `true`, `false` |
|
|
241
|
+
| `chk_hostname` | boolean | YES | Enable hostname checking | `true`, `false` |
|
|
242
|
+
|
|
243
|
+
**Nested Section**: `transport.ssl` (when SSL/TLS is enabled)
|
|
244
|
+
|
|
245
|
+
| Field | Type | Required | Description |
|
|
246
|
+
|-------|------|----------|-------------|
|
|
247
|
+
| `enabled` | boolean | Conditional | Enable SSL/TLS |
|
|
248
|
+
| `cert_file` | string | Conditional | Path to SSL certificate file |
|
|
249
|
+
| `key_file` | string | Conditional | Path to SSL private key file |
|
|
250
|
+
| `ca_cert` | string | Optional | Path to CA certificate file |
|
|
251
|
+
| `verify_client` | boolean | Optional | Verify client certificates |
|
|
252
|
+
| `verify_ssl` | boolean | Optional | Verify SSL certificates |
|
|
253
|
+
| `verify_hostname` | boolean | Optional | Verify hostname in certificate |
|
|
254
|
+
| `verify_mode` | string | Optional | SSL verification mode: `"CERT_NONE"`, `"CERT_OPTIONAL"`, `"CERT_REQUIRED"` |
|
|
255
|
+
|
|
256
|
+
```json
|
|
257
|
+
{
|
|
258
|
+
"transport": {
|
|
259
|
+
"type": "https",
|
|
260
|
+
"port": 8443,
|
|
261
|
+
"verify_client": false,
|
|
262
|
+
"chk_hostname": true,
|
|
263
|
+
"ssl": {
|
|
264
|
+
"enabled": true,
|
|
265
|
+
"cert_file": "./certs/server.crt",
|
|
266
|
+
"key_file": "./certs/server.key",
|
|
267
|
+
"ca_cert": "./certs/ca.crt",
|
|
268
|
+
"verify_ssl": true,
|
|
269
|
+
"verify_hostname": true,
|
|
270
|
+
"verify_mode": "CERT_REQUIRED"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
#### 6. `ssl` Section (Root Level)
|
|
277
|
+
**Required**: Conditional (required for HTTPS/mTLS protocols)
|
|
278
|
+
**Description**: SSL/TLS configuration for server
|
|
279
|
+
|
|
280
|
+
| Field | Type | Required | Description |
|
|
281
|
+
|-------|------|----------|-------------|
|
|
282
|
+
| `enabled` | boolean | YES | Enable SSL/TLS |
|
|
283
|
+
| `cert_file` | string | YES | Path to SSL certificate file |
|
|
284
|
+
| `key_file` | string | YES | Path to SSL private key file |
|
|
285
|
+
| `ca_cert` | string | Optional | Path to CA certificate file (required for mTLS) |
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"ssl": {
|
|
290
|
+
"enabled": true,
|
|
291
|
+
"cert_file": "./certs/server.crt",
|
|
292
|
+
"key_file": "./certs/server.key",
|
|
293
|
+
"ca_cert": "./certs/ca.crt"
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### 7. `proxy_registration` Section
|
|
299
|
+
**Required**: YES
|
|
300
|
+
**Description**: Proxy server registration configuration
|
|
301
|
+
|
|
302
|
+
| Field | Type | Required | Description |
|
|
303
|
+
|-------|------|----------|-------------|
|
|
304
|
+
| `enabled` | boolean | YES | Enable proxy registration |
|
|
305
|
+
| `proxy_url` | string | YES | Proxy server URL |
|
|
306
|
+
| `server_id` | string | YES | Unique server identifier |
|
|
307
|
+
| `server_name` | string | YES | Human-readable server name |
|
|
308
|
+
| `description` | string | YES | Server description |
|
|
309
|
+
| `version` | string | YES | Server version |
|
|
310
|
+
| `protocol` | string | Conditional | Registration protocol: `"http"`, `"https"`, `"mtls"` |
|
|
311
|
+
| `registration_timeout` | integer | YES | Registration timeout in seconds |
|
|
312
|
+
| `retry_attempts` | integer | YES | Number of retry attempts |
|
|
313
|
+
| `retry_delay` | integer | YES | Delay between retries in seconds |
|
|
314
|
+
| `auto_register_on_startup` | boolean | YES | Auto-register on startup |
|
|
315
|
+
| `auto_unregister_on_shutdown` | boolean | YES | Auto-unregister on shutdown |
|
|
316
|
+
| `uuid` | string | Optional | UUID for registration (UUID4 format) |
|
|
317
|
+
|
|
318
|
+
**Nested Section**: `proxy_registration.ssl` (when using HTTPS/mTLS)
|
|
319
|
+
|
|
320
|
+
| Field | Type | Required | Description |
|
|
321
|
+
|-------|------|----------|-------------|
|
|
322
|
+
| `enabled` | boolean | Conditional | Enable SSL for registration |
|
|
323
|
+
| `verify_ssl` | boolean | Conditional | Verify proxy SSL certificate |
|
|
324
|
+
| `verify_hostname` | boolean | Conditional | Verify proxy hostname |
|
|
325
|
+
| `verify_mode` | string | Conditional | SSL verification mode |
|
|
326
|
+
| `ca_cert` | string | Conditional | Path to CA certificate |
|
|
327
|
+
| `cert_file` | string | Conditional | Path to client certificate (for mTLS) |
|
|
328
|
+
| `key_file` | string | Conditional | Path to client key (for mTLS) |
|
|
329
|
+
|
|
330
|
+
**Nested Section**: `proxy_registration.heartbeat`
|
|
331
|
+
|
|
332
|
+
| Field | Type | Required | Description |
|
|
333
|
+
|-------|------|----------|-------------|
|
|
334
|
+
| `enabled` | boolean | Optional | Enable heartbeat |
|
|
335
|
+
| `interval` | integer | Optional | Heartbeat interval in seconds |
|
|
336
|
+
| `timeout` | integer | Optional | Heartbeat timeout in seconds |
|
|
337
|
+
| `retry_attempts` | integer | Optional | Number of retry attempts |
|
|
338
|
+
| `retry_delay` | integer | Optional | Delay between retries |
|
|
339
|
+
| `url` | string | Optional | Heartbeat endpoint URL |
|
|
340
|
+
|
|
341
|
+
```json
|
|
342
|
+
{
|
|
343
|
+
"proxy_registration": {
|
|
344
|
+
"enabled": true,
|
|
345
|
+
"proxy_url": "https://proxy.example.com:3005",
|
|
346
|
+
"server_id": "my-server-001",
|
|
347
|
+
"server_name": "My MCP Server",
|
|
348
|
+
"description": "Production MCP server",
|
|
349
|
+
"version": "1.0.0",
|
|
350
|
+
"protocol": "mtls",
|
|
351
|
+
"registration_timeout": 30,
|
|
352
|
+
"retry_attempts": 3,
|
|
353
|
+
"retry_delay": 5,
|
|
354
|
+
"auto_register_on_startup": true,
|
|
355
|
+
"auto_unregister_on_shutdown": true,
|
|
356
|
+
"ssl": {
|
|
357
|
+
"enabled": true,
|
|
358
|
+
"verify_ssl": true,
|
|
359
|
+
"verify_hostname": false,
|
|
360
|
+
"verify_mode": "CERT_REQUIRED",
|
|
361
|
+
"ca_cert": "./certs/ca.crt",
|
|
362
|
+
"cert_file": "./certs/client.crt",
|
|
363
|
+
"key_file": "./certs/client.key"
|
|
364
|
+
},
|
|
365
|
+
"heartbeat": {
|
|
366
|
+
"enabled": true,
|
|
367
|
+
"interval": 30,
|
|
368
|
+
"timeout": 10,
|
|
369
|
+
"retry_attempts": 3,
|
|
370
|
+
"retry_delay": 5,
|
|
371
|
+
"url": "/heartbeat"
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
#### 8. `security` Section
|
|
378
|
+
**Required**: YES
|
|
379
|
+
**Description**: Security framework configuration
|
|
380
|
+
|
|
381
|
+
| Field | Type | Required | Description |
|
|
382
|
+
|-------|------|----------|-------------|
|
|
383
|
+
| `enabled` | boolean | YES | Enable security framework |
|
|
384
|
+
| `tokens` | object | YES | Token-based authentication configuration |
|
|
385
|
+
| `roles` | object | YES | Role-based access control configuration |
|
|
386
|
+
| `roles_file` | string/null | YES | Path to roles configuration file |
|
|
387
|
+
|
|
388
|
+
**Nested Section**: `security.tokens`
|
|
389
|
+
|
|
390
|
+
| Field | Type | Description |
|
|
391
|
+
|-------|------|-------------|
|
|
392
|
+
| `admin` | string | Administrator token |
|
|
393
|
+
| `user` | string | User token |
|
|
394
|
+
| `readonly` | string | Read-only token |
|
|
395
|
+
| *(custom)* | string | Custom token names |
|
|
396
|
+
|
|
397
|
+
**Nested Section**: `security.roles`
|
|
398
|
+
|
|
399
|
+
| Field | Type | Description |
|
|
400
|
+
|-------|------|-------------|
|
|
401
|
+
| `admin` | array | Administrator role permissions |
|
|
402
|
+
| `user` | array | User role permissions |
|
|
403
|
+
| `readonly` | array | Read-only role permissions |
|
|
404
|
+
| *(custom)* | array | Custom role names |
|
|
405
|
+
|
|
406
|
+
```json
|
|
407
|
+
{
|
|
408
|
+
"security": {
|
|
409
|
+
"enabled": true,
|
|
410
|
+
"tokens": {
|
|
411
|
+
"admin": "admin-secret-key",
|
|
412
|
+
"user": "user-secret-key",
|
|
413
|
+
"readonly": "readonly-secret-key"
|
|
414
|
+
},
|
|
415
|
+
"roles": {
|
|
416
|
+
"admin": ["*"],
|
|
417
|
+
"user": ["health", "echo"],
|
|
418
|
+
"readonly": ["health"]
|
|
419
|
+
},
|
|
420
|
+
"roles_file": null
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
#### 9. `roles` Section
|
|
426
|
+
**Required**: YES
|
|
427
|
+
**Description**: Role-based access control configuration
|
|
428
|
+
|
|
429
|
+
| Field | Type | Required | Description |
|
|
430
|
+
|-------|------|----------|-------------|
|
|
431
|
+
| `enabled` | boolean | YES | Enable RBAC |
|
|
432
|
+
| `config_file` | string/null | YES | Path to roles configuration file |
|
|
433
|
+
| `default_policy` | object | YES | Default policy settings |
|
|
434
|
+
| `auto_load` | boolean | YES | Auto-load roles on startup |
|
|
435
|
+
| `validation_enabled` | boolean | YES | Enable role validation |
|
|
436
|
+
|
|
437
|
+
**Nested Section**: `roles.default_policy`
|
|
438
|
+
|
|
439
|
+
| Field | Type | Description |
|
|
440
|
+
|-------|------|-------------|
|
|
441
|
+
| `deny_by_default` | boolean | Deny access by default |
|
|
442
|
+
| `require_role_match` | boolean | Require exact role match |
|
|
443
|
+
| `case_sensitive` | boolean | Case-sensitive role matching |
|
|
444
|
+
| `allow_wildcard` | boolean | Allow wildcard permissions |
|
|
445
|
+
|
|
446
|
+
```json
|
|
447
|
+
{
|
|
448
|
+
"roles": {
|
|
449
|
+
"enabled": false,
|
|
450
|
+
"config_file": null,
|
|
451
|
+
"default_policy": {
|
|
452
|
+
"deny_by_default": true,
|
|
453
|
+
"require_role_match": true,
|
|
454
|
+
"case_sensitive": false,
|
|
455
|
+
"allow_wildcard": true
|
|
456
|
+
},
|
|
457
|
+
"auto_load": true,
|
|
458
|
+
"validation_enabled": true
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
#### 10. `debug` Section
|
|
464
|
+
**Required**: YES
|
|
465
|
+
**Description**: Debug mode configuration
|
|
466
|
+
|
|
467
|
+
| Field | Type | Required | Description | Allowed Values |
|
|
468
|
+
|-------|------|----------|-------------|----------------|
|
|
469
|
+
| `enabled` | boolean | YES | Enable debug mode | `true`, `false` |
|
|
470
|
+
| `level` | string | YES | Debug level | `"DEBUG"`, `"INFO"`, `"WARNING"`, `"ERROR"` |
|
|
471
|
+
|
|
472
|
+
```json
|
|
473
|
+
{
|
|
474
|
+
"debug": {
|
|
475
|
+
"enabled": false,
|
|
476
|
+
"level": "WARNING"
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Protocol-Specific Requirements
|
|
482
|
+
|
|
483
|
+
#### HTTP Protocol
|
|
484
|
+
**Required Sections**: `server`, `logging`, `commands`, `transport`, `debug`, `security`, `roles`
|
|
485
|
+
**SSL Required**: NO
|
|
486
|
+
**Client Verification**: NO
|
|
487
|
+
|
|
488
|
+
#### HTTPS Protocol
|
|
489
|
+
**Required Sections**: All sections + `ssl`
|
|
490
|
+
**SSL Required**: YES
|
|
491
|
+
**Client Verification**: NO
|
|
492
|
+
**Required Files**:
|
|
493
|
+
- `ssl.cert_file` - Server certificate
|
|
494
|
+
- `ssl.key_file` - Server private key
|
|
495
|
+
|
|
496
|
+
#### mTLS Protocol
|
|
497
|
+
**Required Sections**: All sections + `ssl`
|
|
498
|
+
**SSL Required**: YES
|
|
499
|
+
**Client Verification**: YES
|
|
500
|
+
**Required Files**:
|
|
501
|
+
- `ssl.cert_file` - Server certificate
|
|
502
|
+
- `ssl.key_file` - Server private key
|
|
503
|
+
- `ssl.ca_cert` - CA certificate for client verification
|
|
504
|
+
|
|
505
|
+
### Configuration Validation
|
|
506
|
+
|
|
507
|
+
The framework automatically validates configuration on load:
|
|
508
|
+
- **Required sections**: All mandatory configuration sections are present
|
|
509
|
+
- **Required keys**: All required keys within sections are present
|
|
510
|
+
- **Type validation**: All values have correct data types
|
|
511
|
+
- **File existence**: All referenced files exist (when features are enabled)
|
|
512
|
+
- **Feature dependencies**: All feature dependencies are satisfied
|
|
513
|
+
- **UUID format**: UUID4 format validation
|
|
514
|
+
- **Certificate validation**: Certificate format, expiration, key matching
|
|
515
|
+
|
|
516
|
+
### Complete Configuration Example
|
|
517
|
+
|
|
518
|
+
```json
|
|
519
|
+
{
|
|
520
|
+
"uuid": "123e4567-e89b-42d3-a456-426614174000",
|
|
521
|
+
"server": {
|
|
522
|
+
"host": "0.0.0.0",
|
|
523
|
+
"port": 8080,
|
|
524
|
+
"protocol": "mtls",
|
|
525
|
+
"debug": false,
|
|
526
|
+
"log_level": "INFO"
|
|
527
|
+
},
|
|
528
|
+
"logging": {
|
|
529
|
+
"level": "INFO",
|
|
530
|
+
"log_dir": "./logs",
|
|
531
|
+
"log_file": "mcp_proxy_adapter.log",
|
|
532
|
+
"error_log_file": "mcp_proxy_adapter_error.log",
|
|
533
|
+
"access_log_file": "mcp_proxy_adapter_access.log",
|
|
534
|
+
"max_file_size": "10MB",
|
|
535
|
+
"backup_count": 5,
|
|
536
|
+
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
537
|
+
"date_format": "%Y-%m-%d %H:%M:%S",
|
|
538
|
+
"console_output": true,
|
|
539
|
+
"file_output": true
|
|
540
|
+
},
|
|
541
|
+
"commands": {
|
|
542
|
+
"auto_discovery": true,
|
|
543
|
+
"commands_directory": "./commands",
|
|
544
|
+
"catalog_directory": "./catalog",
|
|
545
|
+
"plugin_servers": [],
|
|
546
|
+
"auto_install_dependencies": true,
|
|
547
|
+
"enabled_commands": ["health", "echo", "help"],
|
|
548
|
+
"disabled_commands": [],
|
|
549
|
+
"custom_commands_path": "./commands"
|
|
550
|
+
},
|
|
551
|
+
"transport": {
|
|
552
|
+
"type": "mtls",
|
|
553
|
+
"port": 8443,
|
|
554
|
+
"verify_client": true,
|
|
555
|
+
"chk_hostname": true,
|
|
556
|
+
"ssl": {
|
|
557
|
+
"enabled": true,
|
|
558
|
+
"cert_file": "./certs/server.crt",
|
|
559
|
+
"key_file": "./certs/server.key",
|
|
560
|
+
"ca_cert": "./certs/ca.crt",
|
|
561
|
+
"verify_ssl": true,
|
|
562
|
+
"verify_hostname": true,
|
|
563
|
+
"verify_mode": "CERT_REQUIRED"
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
"ssl": {
|
|
567
|
+
"enabled": true,
|
|
568
|
+
"cert_file": "./certs/server.crt",
|
|
569
|
+
"key_file": "./certs/server.key",
|
|
570
|
+
"ca_cert": "./certs/ca.crt"
|
|
571
|
+
},
|
|
572
|
+
"proxy_registration": {
|
|
573
|
+
"enabled": true,
|
|
574
|
+
"proxy_url": "https://proxy.example.com:3005",
|
|
575
|
+
"server_id": "my-server-001",
|
|
576
|
+
"server_name": "My MCP Server",
|
|
577
|
+
"description": "Production MCP server",
|
|
578
|
+
"version": "1.0.0",
|
|
579
|
+
"protocol": "mtls",
|
|
580
|
+
"registration_timeout": 30,
|
|
581
|
+
"retry_attempts": 3,
|
|
582
|
+
"retry_delay": 5,
|
|
583
|
+
"auto_register_on_startup": true,
|
|
584
|
+
"auto_unregister_on_shutdown": true,
|
|
585
|
+
"ssl": {
|
|
586
|
+
"enabled": true,
|
|
587
|
+
"verify_ssl": true,
|
|
588
|
+
"verify_hostname": false,
|
|
589
|
+
"verify_mode": "CERT_REQUIRED",
|
|
590
|
+
"ca_cert": "./certs/ca.crt",
|
|
591
|
+
"cert_file": "./certs/client.crt",
|
|
592
|
+
"key_file": "./certs/client.key"
|
|
593
|
+
},
|
|
594
|
+
"heartbeat": {
|
|
595
|
+
"enabled": true,
|
|
596
|
+
"interval": 30,
|
|
597
|
+
"timeout": 10,
|
|
598
|
+
"retry_attempts": 3,
|
|
599
|
+
"retry_delay": 5,
|
|
600
|
+
"url": "/heartbeat"
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
"debug": {
|
|
604
|
+
"enabled": false,
|
|
605
|
+
"level": "WARNING"
|
|
606
|
+
},
|
|
607
|
+
"security": {
|
|
608
|
+
"enabled": true,
|
|
609
|
+
"tokens": {
|
|
610
|
+
"admin": "admin-secret-key",
|
|
611
|
+
"user": "user-secret-key",
|
|
612
|
+
"readonly": "readonly-secret-key"
|
|
613
|
+
},
|
|
614
|
+
"roles": {
|
|
615
|
+
"admin": ["*"],
|
|
616
|
+
"user": ["health", "echo"],
|
|
617
|
+
"readonly": ["health"]
|
|
618
|
+
},
|
|
619
|
+
"roles_file": null
|
|
620
|
+
},
|
|
621
|
+
"roles": {
|
|
622
|
+
"enabled": false,
|
|
623
|
+
"config_file": null,
|
|
624
|
+
"default_policy": {
|
|
625
|
+
"deny_by_default": true,
|
|
626
|
+
"require_role_match": true,
|
|
627
|
+
"case_sensitive": false,
|
|
628
|
+
"allow_wildcard": true
|
|
629
|
+
},
|
|
630
|
+
"auto_load": true,
|
|
631
|
+
"validation_enabled": true
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
For more detailed configuration documentation, see `docs/EN/ALL_CONFIG_SETTINGS.md`.
|
|
637
|
+
|
|
638
|
+
### SimpleConfig Format
|
|
639
|
+
|
|
640
|
+
The framework supports a simplified configuration format (`SimpleConfig`) that provides a minimal, explicit configuration model with three main sections: **server**, **client**, and **registration**. Each section can operate independently with its own protocol (HTTP, HTTPS, or mTLS), certificates, keys, and CRL (Certificate Revocation List).
|
|
641
|
+
|
|
642
|
+
#### SimpleConfig Structure
|
|
643
|
+
|
|
644
|
+
```json
|
|
645
|
+
{
|
|
646
|
+
"server": { ... },
|
|
647
|
+
"client": { ... },
|
|
648
|
+
"registration": { ... },
|
|
649
|
+
"auth": { ... }
|
|
650
|
+
}
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
#### 1. `server` Section
|
|
654
|
+
|
|
655
|
+
**Purpose**: Server endpoint configuration (listening for incoming connections)
|
|
656
|
+
|
|
657
|
+
| Field | Type | Required | Description | Allowed Values |
|
|
658
|
+
|-------|------|----------|-------------|----------------|
|
|
659
|
+
| `host` | string | YES | Server host address | Any valid IP or hostname |
|
|
660
|
+
| `port` | integer | YES | Server port number | 1-65535 |
|
|
661
|
+
| `protocol` | string | YES | Server protocol | `"http"`, `"https"`, `"mtls"` |
|
|
662
|
+
| `cert_file` | string | Conditional | Server certificate file path | Valid file path (required for HTTPS/mTLS) |
|
|
663
|
+
| `key_file` | string | Conditional | Server private key file path | Valid file path (required for HTTPS/mTLS) |
|
|
664
|
+
| `ca_cert_file` | string | Conditional | CA certificate file path | Valid file path (required for mTLS if `use_system_ca=false`) |
|
|
665
|
+
| `crl_file` | string | Optional | Certificate Revocation List file path | Valid CRL file path |
|
|
666
|
+
| `use_system_ca` | boolean | NO | Allow system CA store when `ca_cert_file` is not provided | `true`, `false` (default: `false`) |
|
|
667
|
+
| `log_dir` | string | NO | Directory for log files | Valid directory path (default: `"./logs"`) |
|
|
668
|
+
|
|
669
|
+
**Protocol Requirements**:
|
|
670
|
+
- **HTTP**: No certificates required
|
|
671
|
+
- **HTTPS**: `cert_file` and `key_file` are optional but recommended. If one is specified, both must be provided.
|
|
672
|
+
- **mTLS**: `cert_file` and `key_file` are required. `ca_cert_file` is required if `use_system_ca=false` (default).
|
|
673
|
+
|
|
674
|
+
**CRL Validation**:
|
|
675
|
+
- If `crl_file` is specified, it must:
|
|
676
|
+
- Exist and be accessible
|
|
677
|
+
- Be a valid CRL file format (PEM or DER)
|
|
678
|
+
- Not be expired (checked against `next_update` field)
|
|
679
|
+
- Pass format validation
|
|
680
|
+
- If CRL validation fails, the server will log an error and stop
|
|
681
|
+
|
|
682
|
+
**Example**:
|
|
683
|
+
```json
|
|
684
|
+
{
|
|
685
|
+
"server": {
|
|
686
|
+
"host": "0.0.0.0",
|
|
687
|
+
"port": 8080,
|
|
688
|
+
"protocol": "mtls",
|
|
689
|
+
"cert_file": "./certs/server.crt",
|
|
690
|
+
"key_file": "./certs/server.key",
|
|
691
|
+
"ca_cert_file": "./certs/ca.crt",
|
|
692
|
+
"crl_file": "./certs/server.crl",
|
|
693
|
+
"use_system_ca": false,
|
|
694
|
+
"log_dir": "./logs"
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
#### 2. `client` Section
|
|
700
|
+
|
|
701
|
+
**Purpose**: Client configuration (for connecting to external servers)
|
|
702
|
+
|
|
703
|
+
| Field | Type | Required | Description | Allowed Values |
|
|
704
|
+
|-------|------|----------|-------------|----------------|
|
|
705
|
+
| `enabled` | boolean | NO | Enable client configuration | `true`, `false` (default: `false`) |
|
|
706
|
+
| `protocol` | string | Conditional | Client protocol | `"http"`, `"https"`, `"mtls"` (default: `"http"`) |
|
|
707
|
+
| `cert_file` | string | Conditional | Client certificate file path | Valid file path (required for mTLS when enabled) |
|
|
708
|
+
| `key_file` | string | Conditional | Client private key file path | Valid file path (required for mTLS when enabled) |
|
|
709
|
+
| `ca_cert_file` | string | Conditional | CA certificate file path | Valid file path (required for mTLS if `use_system_ca=false`) |
|
|
710
|
+
| `crl_file` | string | Optional | Certificate Revocation List file path | Valid CRL file path |
|
|
711
|
+
| `use_system_ca` | boolean | NO | Allow system CA store when `ca_cert_file` is not provided | `true`, `false` (default: `false`) |
|
|
712
|
+
|
|
713
|
+
**Protocol Requirements**:
|
|
714
|
+
- **HTTP**: No certificates required
|
|
715
|
+
- **HTTPS**: `cert_file` and `key_file` are optional but recommended. If one is specified, both must be provided.
|
|
716
|
+
- **mTLS**: `cert_file` and `key_file` are required when `enabled=true`. `ca_cert_file` is required if `use_system_ca=false` (default).
|
|
717
|
+
|
|
718
|
+
**CRL Validation**:
|
|
719
|
+
- Same validation rules as `server` section
|
|
720
|
+
- If `crl_file` is specified and validation fails, the client connection will fail
|
|
721
|
+
|
|
722
|
+
**Example**:
|
|
723
|
+
```json
|
|
724
|
+
{
|
|
725
|
+
"client": {
|
|
726
|
+
"enabled": true,
|
|
727
|
+
"protocol": "mtls",
|
|
728
|
+
"cert_file": "./certs/client.crt",
|
|
729
|
+
"key_file": "./certs/client.key",
|
|
730
|
+
"ca_cert_file": "./certs/ca.crt",
|
|
731
|
+
"crl_file": "./certs/client.crl",
|
|
732
|
+
"use_system_ca": false
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
#### 3. `registration` Section
|
|
738
|
+
|
|
739
|
+
**Purpose**: Proxy registration configuration (for registering with proxy server)
|
|
740
|
+
|
|
741
|
+
| Field | Type | Required | Description | Allowed Values |
|
|
742
|
+
|-------|------|----------|-------------|----------------|
|
|
743
|
+
| `enabled` | boolean | NO | Enable proxy registration | `true`, `false` (default: `false`) |
|
|
744
|
+
| `host` | string | Conditional | Proxy server host | Valid hostname or IP (required when enabled) |
|
|
745
|
+
| `port` | integer | Conditional | Proxy server port | 1-65535 (required when enabled, default: `3005`) |
|
|
746
|
+
| `protocol` | string | Conditional | Registration protocol | `"http"`, `"https"`, `"mtls"` (default: `"http"`) |
|
|
747
|
+
| `server_id` | string | Optional | Server identifier for registration | Valid string (preferred over `server_name`) |
|
|
748
|
+
| `server_name` | string | Optional | Legacy server name | Valid string (deprecated, use `server_id`) |
|
|
749
|
+
| `cert_file` | string | Conditional | Registration certificate file path | Valid file path (required for mTLS when enabled) |
|
|
750
|
+
| `key_file` | string | Conditional | Registration private key file path | Valid file path (required for mTLS when enabled) |
|
|
751
|
+
| `ca_cert_file` | string | Conditional | CA certificate file path | Valid file path (required for mTLS if `use_system_ca=false`) |
|
|
752
|
+
| `crl_file` | string | Optional | Certificate Revocation List file path | Valid CRL file path |
|
|
753
|
+
| `use_system_ca` | boolean | NO | Allow system CA store when `ca_cert_file` is not provided | `true`, `false` (default: `false`) |
|
|
754
|
+
| `register_endpoint` | string | NO | Registration endpoint path | Valid path (default: `"/register"`) |
|
|
755
|
+
| `unregister_endpoint` | string | NO | Unregistration endpoint path | Valid path (default: `"/unregister"`) |
|
|
756
|
+
| `auto_on_startup` | boolean | NO | Auto-register on startup | `true`, `false` (default: `true`) |
|
|
757
|
+
| `auto_on_shutdown` | boolean | NO | Auto-unregister on shutdown | `true`, `false` (default: `true`) |
|
|
758
|
+
| `heartbeat` | object | NO | Heartbeat configuration | See HeartbeatConfig below |
|
|
759
|
+
|
|
760
|
+
**Heartbeat Configuration** (`registration.heartbeat`):
|
|
761
|
+
|
|
762
|
+
| Field | Type | Required | Description | Default |
|
|
763
|
+
|-------|------|----------|-------------|---------|
|
|
764
|
+
| `endpoint` | string | NO | Heartbeat endpoint path | `"/heartbeat"` |
|
|
765
|
+
| `interval` | integer | NO | Heartbeat interval in seconds | `30` |
|
|
766
|
+
|
|
767
|
+
**Protocol Requirements**:
|
|
768
|
+
- **HTTP**: No certificates required
|
|
769
|
+
- **HTTPS**: `cert_file` and `key_file` are optional but recommended. If one is specified, both must be provided.
|
|
770
|
+
- **mTLS**: `cert_file` and `key_file` are required when `enabled=true`. `ca_cert_file` is required if `use_system_ca=false` (default).
|
|
771
|
+
|
|
772
|
+
**CRL Validation**:
|
|
773
|
+
- Same validation rules as `server` section
|
|
774
|
+
- If `crl_file` is specified and validation fails, registration will fail
|
|
775
|
+
|
|
776
|
+
**Example**:
|
|
777
|
+
```json
|
|
778
|
+
{
|
|
779
|
+
"registration": {
|
|
780
|
+
"enabled": true,
|
|
781
|
+
"host": "localhost",
|
|
782
|
+
"port": 3005,
|
|
783
|
+
"protocol": "mtls",
|
|
784
|
+
"server_id": "my-server-001",
|
|
785
|
+
"cert_file": "./certs/registration.crt",
|
|
786
|
+
"key_file": "./certs/registration.key",
|
|
787
|
+
"ca_cert_file": "./certs/ca.crt",
|
|
788
|
+
"crl_file": "./certs/registration.crl",
|
|
789
|
+
"use_system_ca": false,
|
|
790
|
+
"register_endpoint": "/register",
|
|
791
|
+
"unregister_endpoint": "/unregister",
|
|
792
|
+
"auto_on_startup": true,
|
|
793
|
+
"auto_on_shutdown": true,
|
|
794
|
+
"heartbeat": {
|
|
795
|
+
"endpoint": "/heartbeat",
|
|
796
|
+
"interval": 30
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
```
|
|
801
|
+
|
|
802
|
+
#### 4. `auth` Section
|
|
803
|
+
|
|
804
|
+
**Purpose**: Authentication and authorization configuration
|
|
805
|
+
|
|
806
|
+
| Field | Type | Required | Description | Allowed Values |
|
|
807
|
+
|-------|------|----------|-------------|----------------|
|
|
808
|
+
| `use_token` | boolean | NO | Enable token-based authentication | `true`, `false` (default: `false`) |
|
|
809
|
+
| `use_roles` | boolean | NO | Enable role-based authorization | `true`, `false` (default: `false`) |
|
|
810
|
+
| `tokens` | object | Conditional | Token-to-role mapping | Object with token strings as keys and role arrays as values (required if `use_token=true`) |
|
|
811
|
+
| `roles` | object | Conditional | Role-to-command mapping | Object with role strings as keys and command arrays as values (required if `use_roles=true`) |
|
|
812
|
+
|
|
813
|
+
**Note**: `use_roles` requires `use_token=true`
|
|
814
|
+
|
|
815
|
+
**Example**:
|
|
816
|
+
```json
|
|
817
|
+
{
|
|
818
|
+
"auth": {
|
|
819
|
+
"use_token": true,
|
|
820
|
+
"use_roles": true,
|
|
821
|
+
"tokens": {
|
|
822
|
+
"admin-secret-key": ["admin"],
|
|
823
|
+
"user-secret-key": ["user"],
|
|
824
|
+
"readonly-secret-key": ["readonly"]
|
|
825
|
+
},
|
|
826
|
+
"roles": {
|
|
827
|
+
"admin": ["*"],
|
|
828
|
+
"user": ["health", "echo"],
|
|
829
|
+
"readonly": ["health"]
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
#### Complete SimpleConfig Example
|
|
836
|
+
|
|
837
|
+
```json
|
|
838
|
+
{
|
|
839
|
+
"server": {
|
|
840
|
+
"host": "0.0.0.0",
|
|
841
|
+
"port": 8080,
|
|
842
|
+
"protocol": "mtls",
|
|
843
|
+
"cert_file": "./certs/server.crt",
|
|
844
|
+
"key_file": "./certs/server.key",
|
|
845
|
+
"ca_cert_file": "./certs/ca.crt",
|
|
846
|
+
"crl_file": "./certs/server.crl",
|
|
847
|
+
"use_system_ca": false,
|
|
848
|
+
"log_dir": "./logs"
|
|
849
|
+
},
|
|
850
|
+
"client": {
|
|
851
|
+
"enabled": true,
|
|
852
|
+
"protocol": "mtls",
|
|
853
|
+
"cert_file": "./certs/client.crt",
|
|
854
|
+
"key_file": "./certs/client.key",
|
|
855
|
+
"ca_cert_file": "./certs/ca.crt",
|
|
856
|
+
"crl_file": "./certs/client.crl",
|
|
857
|
+
"use_system_ca": false
|
|
858
|
+
},
|
|
859
|
+
"registration": {
|
|
860
|
+
"enabled": true,
|
|
861
|
+
"host": "localhost",
|
|
862
|
+
"port": 3005,
|
|
863
|
+
"protocol": "mtls",
|
|
864
|
+
"server_id": "my-server-001",
|
|
865
|
+
"cert_file": "./certs/registration.crt",
|
|
866
|
+
"key_file": "./certs/registration.key",
|
|
867
|
+
"ca_cert_file": "./certs/ca.crt",
|
|
868
|
+
"crl_file": "./certs/registration.crl",
|
|
869
|
+
"use_system_ca": false,
|
|
870
|
+
"register_endpoint": "/register",
|
|
871
|
+
"unregister_endpoint": "/unregister",
|
|
872
|
+
"auto_on_startup": true,
|
|
873
|
+
"auto_on_shutdown": true,
|
|
874
|
+
"heartbeat": {
|
|
875
|
+
"endpoint": "/heartbeat",
|
|
876
|
+
"interval": 30
|
|
877
|
+
}
|
|
878
|
+
},
|
|
879
|
+
"auth": {
|
|
880
|
+
"use_token": false,
|
|
881
|
+
"use_roles": false,
|
|
882
|
+
"tokens": {},
|
|
883
|
+
"roles": {}
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
#### CRL Validation Details
|
|
889
|
+
|
|
890
|
+
**Certificate Revocation List (CRL)** validation is performed for all sections (`server`, `client`, `registration`) when a `crl_file` is specified:
|
|
891
|
+
|
|
892
|
+
1. **File Existence**: The CRL file must exist and be accessible
|
|
893
|
+
2. **Format Validation**: The file must be a valid CRL in PEM or DER format
|
|
894
|
+
3. **Expiration Check**: The CRL must not be expired (checked against the `next_update` field)
|
|
895
|
+
4. **Certificate Revocation Check**: If the CRL is valid, certificates are checked against it to ensure they are not revoked
|
|
896
|
+
|
|
897
|
+
**Error Handling**:
|
|
898
|
+
- If CRL file is specified but not found: **Error logged, server stops**
|
|
899
|
+
- If CRL file is not a valid CRL format: **Error logged, server stops**
|
|
900
|
+
- If CRL is expired: **Error logged, server stops**
|
|
901
|
+
- If certificate is revoked according to CRL: **Error logged, server stops**
|
|
902
|
+
|
|
903
|
+
**CRL Validation Process**:
|
|
904
|
+
1. Check file exists → If not: Error and stop
|
|
905
|
+
2. Validate CRL format (PEM/DER) → If invalid: Error and stop
|
|
906
|
+
3. Check CRL expiration (`next_update`) → If expired: Error and stop
|
|
907
|
+
4. Check certificate serial number against CRL → If revoked: Error and stop
|
|
908
|
+
|
|
909
|
+
#### Generating SimpleConfig
|
|
910
|
+
|
|
911
|
+
Use the `adapter-cfg-gen` command to generate SimpleConfig files:
|
|
912
|
+
|
|
913
|
+
```bash
|
|
914
|
+
# Generate HTTP configuration
|
|
915
|
+
adapter-cfg-gen --protocol http --out config.json
|
|
916
|
+
|
|
917
|
+
# Generate HTTPS configuration with server certificates
|
|
918
|
+
adapter-cfg-gen --protocol https \
|
|
919
|
+
--server-cert-file ./certs/server.crt \
|
|
920
|
+
--server-key-file ./certs/server.key \
|
|
921
|
+
--out config.json
|
|
922
|
+
|
|
923
|
+
# Generate mTLS configuration with all three sections
|
|
924
|
+
adapter-cfg-gen --protocol mtls \
|
|
925
|
+
--server-cert-file ./certs/server.crt \
|
|
926
|
+
--server-key-file ./certs/server.key \
|
|
927
|
+
--server-ca-cert-file ./certs/ca.crt \
|
|
928
|
+
--server-crl-file ./certs/server.crl \
|
|
929
|
+
--client-enabled \
|
|
930
|
+
--client-protocol mtls \
|
|
931
|
+
--client-cert-file ./certs/client.crt \
|
|
932
|
+
--client-key-file ./certs/client.key \
|
|
933
|
+
--client-ca-cert-file ./certs/ca.crt \
|
|
934
|
+
--client-crl-file ./certs/client.crl \
|
|
935
|
+
--with-proxy \
|
|
936
|
+
--registration-protocol mtls \
|
|
937
|
+
--registration-cert-file ./certs/registration.crt \
|
|
938
|
+
--registration-key-file ./certs/registration.key \
|
|
939
|
+
--registration-ca-cert-file ./certs/ca.crt \
|
|
940
|
+
--registration-crl-file ./certs/registration.crl \
|
|
941
|
+
--out config.json
|
|
942
|
+
```
|
|
943
|
+
|
|
944
|
+
#### Validating SimpleConfig
|
|
945
|
+
|
|
946
|
+
Use the `adapter-cfg-val` command to validate SimpleConfig files:
|
|
947
|
+
|
|
948
|
+
```bash
|
|
949
|
+
# Validate configuration file
|
|
950
|
+
adapter-cfg-val --file config.json
|
|
951
|
+
```
|
|
952
|
+
|
|
953
|
+
The validator checks:
|
|
954
|
+
- Required fields are present
|
|
955
|
+
- File paths exist and are accessible
|
|
956
|
+
- Certificate-key pairs match
|
|
957
|
+
- Certificates are not expired
|
|
958
|
+
- CRL files are valid and not expired
|
|
959
|
+
- Certificates are not revoked according to CRL
|
|
960
|
+
- Certificate chains are valid
|
|
961
|
+
|
|
962
|
+
## Built-in Commands
|
|
963
|
+
|
|
964
|
+
- `health` - Server health check
|
|
965
|
+
- `echo` - Echo test command
|
|
966
|
+
- `config` - Configuration management
|
|
967
|
+
- `help` - Command help and documentation
|
|
968
|
+
- `reload` - Configuration reload
|
|
969
|
+
- `settings` - Settings management
|
|
970
|
+
- `load`/`unload` - Command loading/unloading
|
|
971
|
+
- `plugins` - Plugin management
|
|
972
|
+
- `proxy_registration` - Proxy registration control
|
|
973
|
+
- `transport_management` - Transport protocol management
|
|
974
|
+
- `role_test` - Role-based access testing
|
|
975
|
+
|
|
976
|
+
## Security Features
|
|
977
|
+
|
|
978
|
+
- **Authentication**: API keys, JWT tokens, certificate-based auth
|
|
979
|
+
- **Authorization**: Role-based permissions with wildcard support
|
|
980
|
+
- **SSL/TLS**: Full SSL/TLS and mTLS support
|
|
981
|
+
- **Rate Limiting**: Configurable request rate limiting
|
|
982
|
+
- **Security Headers**: Automatic security header injection
|
|
983
|
+
|
|
984
|
+
## Examples
|
|
985
|
+
|
|
986
|
+
The `mcp_proxy_adapter/examples/` directory contains comprehensive examples for different use cases:
|
|
987
|
+
|
|
988
|
+
- **Basic Framework**: Simple HTTP server setup
|
|
989
|
+
- **Full Application**: Complete application with custom commands and hooks
|
|
990
|
+
- **Security Testing**: Comprehensive security test suite
|
|
991
|
+
- **Certificate Generation**: SSL/TLS certificate management
|
|
992
|
+
|
|
993
|
+
### Test Environment Setup
|
|
994
|
+
|
|
995
|
+
The framework includes a comprehensive test environment setup that automatically creates configurations, generates certificates, and runs tests:
|
|
996
|
+
|
|
997
|
+
```bash
|
|
998
|
+
# Create a complete test environment with all configurations and certificates
|
|
999
|
+
python -m mcp_proxy_adapter.examples.setup_test_environment
|
|
1000
|
+
|
|
1001
|
+
# Create test environment in a specific directory
|
|
1002
|
+
python -m mcp_proxy_adapter.examples.setup_test_environment /path/to/test/dir
|
|
1003
|
+
|
|
1004
|
+
# Skip certificate generation (use existing certificates)
|
|
1005
|
+
python -m mcp_proxy_adapter.examples.setup_test_environment --skip-certs
|
|
1006
|
+
|
|
1007
|
+
# Skip running tests (setup only)
|
|
1008
|
+
python -m mcp_proxy_adapter.examples.setup_test_environment --skip-tests
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
### Configuration Generation
|
|
1012
|
+
|
|
1013
|
+
Generate test configurations from a comprehensive template:
|
|
1014
|
+
|
|
1015
|
+
```bash
|
|
1016
|
+
# Generate all test configurations
|
|
1017
|
+
python -m mcp_proxy_adapter.examples.create_test_configs
|
|
1018
|
+
|
|
1019
|
+
# Generate from specific comprehensive config
|
|
1020
|
+
python -m mcp_proxy_adapter.examples.create_test_configs --comprehensive-config config.json
|
|
1021
|
+
|
|
1022
|
+
# Generate specific configuration types
|
|
1023
|
+
python -m mcp_proxy_adapter.examples.create_test_configs --types http,https,mtls
|
|
1024
|
+
```
|
|
1025
|
+
|
|
1026
|
+
### Certificate Generation
|
|
1027
|
+
|
|
1028
|
+
Generate SSL/TLS certificates for testing:
|
|
1029
|
+
|
|
1030
|
+
```bash
|
|
1031
|
+
# Generate all certificates using mcp_security_framework
|
|
1032
|
+
python -m mcp_proxy_adapter.examples.generate_all_certificates
|
|
1033
|
+
|
|
1034
|
+
# Generate certificates with custom configuration
|
|
1035
|
+
python -m mcp_proxy_adapter.examples.generate_certificates_framework --config cert_config.json
|
|
1036
|
+
```
|
|
1037
|
+
|
|
1038
|
+
### Security Testing
|
|
1039
|
+
|
|
1040
|
+
Run comprehensive security tests:
|
|
1041
|
+
|
|
1042
|
+
```bash
|
|
1043
|
+
# Run all security tests
|
|
1044
|
+
python -m mcp_proxy_adapter.examples.run_security_tests_fixed
|
|
1045
|
+
|
|
1046
|
+
# Run full test suite (includes setup, config generation, certificate generation, and testing)
|
|
1047
|
+
python -m mcp_proxy_adapter.examples.run_full_test_suite
|
|
1048
|
+
```
|
|
1049
|
+
|
|
1050
|
+
### Complete Workflow Example
|
|
1051
|
+
|
|
1052
|
+
```bash
|
|
1053
|
+
# 1. Install the package
|
|
1054
|
+
pip install mcp-proxy-adapter
|
|
1055
|
+
|
|
1056
|
+
# 2. Create test environment (automatically runs tests)
|
|
1057
|
+
python -m mcp_proxy_adapter.examples.setup_test_environment
|
|
1058
|
+
|
|
1059
|
+
# 3. Or run individual steps:
|
|
1060
|
+
# Generate certificates
|
|
1061
|
+
python -m mcp_proxy_adapter.examples.generate_all_certificates
|
|
1062
|
+
|
|
1063
|
+
# Generate configurations
|
|
1064
|
+
python -m mcp_proxy_adapter.examples.create_test_configs
|
|
1065
|
+
|
|
1066
|
+
# Run security tests
|
|
1067
|
+
python -m mcp_proxy_adapter.examples.run_security_tests_fixed
|
|
1068
|
+
|
|
1069
|
+
# 4. Start server with generated configuration
|
|
1070
|
+
python -m mcp_proxy_adapter --config configs/http_simple.json
|
|
1071
|
+
```
|
|
1072
|
+
|
|
1073
|
+
## Development
|
|
1074
|
+
|
|
1075
|
+
The project follows a modular architecture:
|
|
1076
|
+
|
|
1077
|
+
- `mcp_proxy_adapter/api/` - FastAPI application and handlers
|
|
1078
|
+
- `mcp_proxy_adapter/commands/` - Command system and built-in commands
|
|
1079
|
+
- `mcp_proxy_adapter/core/` - Core functionality and utilities
|
|
1080
|
+
- `mcp_proxy_adapter/config.py` - Configuration management
|
|
1081
|
+
|
|
1082
|
+
## License
|
|
1083
|
+
|
|
1084
|
+
This project is licensed under the MIT License.
|
|
1085
|
+
|
|
1086
|
+
## Support
|
|
1087
|
+
|
|
1088
|
+
For issues and questions, please contact vasilyvz@gmail.com.
|