mcp-proxy-adapter 6.1.0__tar.gz → 6.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. {mcp_proxy_adapter-6.1.0/mcp_proxy_adapter.egg-info → mcp_proxy_adapter-6.1.1}/PKG-INFO +1 -1
  2. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/__init__.py +2 -2
  3. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/protocol_middleware.py +32 -13
  4. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/unified_security.py +12 -4
  5. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/protocol_manager.py +132 -10
  6. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/security_integration.py +19 -11
  7. mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/docs/EN/TROUBLESHOOTING.md +285 -0
  8. mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/docs/RU/TROUBLESHOOTING.md +285 -0
  9. {mcp_proxy_adapter-6.1.0/mcp_proxy_adapter/examples/full_application → mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/examples/basic_framework}/configs/https_auth.json +4 -0
  10. mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/examples/basic_framework/configs/https_no_protocol_middleware.json +36 -0
  11. {mcp_proxy_adapter-6.1.0/mcp_proxy_adapter/examples/full_application → mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/examples/basic_framework}/configs/https_simple.json +4 -0
  12. mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/examples/basic_framework/configs/mtls_no_protocol_middleware.json +34 -0
  13. mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/examples/basic_framework/configs/mtls_simple.json +35 -0
  14. mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/examples/test_config_generator.py +110 -0
  15. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/utils/config_generator.py +90 -2
  16. mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/version.py +6 -0
  17. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1/mcp_proxy_adapter.egg-info}/PKG-INFO +1 -1
  18. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter.egg-info/SOURCES.txt +15 -0
  19. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/pyproject.toml +1 -1
  20. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/requirements.txt +1 -1
  21. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/setup.py +1 -1
  22. mcp_proxy_adapter-6.1.1/test_config_basic_http.json +228 -0
  23. mcp_proxy_adapter-6.1.1/test_config_http_token.json +250 -0
  24. mcp_proxy_adapter-6.1.1/test_config_https.json +251 -0
  25. mcp_proxy_adapter-6.1.1/test_config_https_no_protocol_middleware.json +251 -0
  26. mcp_proxy_adapter-6.1.1/test_config_https_token.json +251 -0
  27. mcp_proxy_adapter-6.1.1/test_config_mtls.json +251 -0
  28. mcp_proxy_adapter-6.1.1/test_config_mtls_no_protocol_middleware.json +251 -0
  29. mcp_proxy_adapter-6.1.1/test_generated_config.json +272 -0
  30. mcp_proxy_adapter-6.1.1/test_https_with_comments.json +250 -0
  31. mcp_proxy_adapter-6.1.0/mcp_proxy_adapter/version.py +0 -4
  32. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/LICENSE +0 -0
  33. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/MANIFEST.in +0 -0
  34. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/README.md +0 -0
  35. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/TODO_SECURITY_INTEGRATION.md +0 -0
  36. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/__init__.py +0 -0
  37. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/__main__.py +0 -0
  38. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/__init__.py +0 -0
  39. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/app.py +0 -0
  40. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/handlers.py +0 -0
  41. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/base.py +0 -0
  42. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/command_permission_middleware.py +0 -0
  43. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/error_handling.py +0 -0
  44. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/factory.py +0 -0
  45. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/logging.py +0 -0
  46. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/performance.py +0 -0
  47. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/transport_middleware.py +0 -0
  48. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/middleware/user_info_middleware.py +0 -0
  49. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/schemas.py +0 -0
  50. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/tool_integration.py +0 -0
  51. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/api/tools.py +0 -0
  52. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/__init__.py +0 -0
  53. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/auth_validation_command.py +0 -0
  54. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/base.py +0 -0
  55. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/builtin_commands.py +0 -0
  56. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/catalog_manager.py +0 -0
  57. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/cert_monitor_command.py +0 -0
  58. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/certificate_management_command.py +0 -0
  59. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/command_registry.py +0 -0
  60. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/config_command.py +0 -0
  61. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/dependency_container.py +0 -0
  62. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/dependency_manager.py +0 -0
  63. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/echo_command.py +0 -0
  64. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/health_command.py +0 -0
  65. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/help_command.py +0 -0
  66. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/hooks.py +0 -0
  67. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/key_management_command.py +0 -0
  68. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/load_command.py +0 -0
  69. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/plugins_command.py +0 -0
  70. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/protocol_management_command.py +0 -0
  71. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/proxy_registration_command.py +0 -0
  72. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/reload_command.py +0 -0
  73. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/result.py +0 -0
  74. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/role_test_command.py +0 -0
  75. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/roles_management_command.py +0 -0
  76. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/security_command.py +0 -0
  77. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/settings_command.py +0 -0
  78. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/ssl_setup_command.py +0 -0
  79. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/token_management_command.py +0 -0
  80. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/transport_management_command.py +0 -0
  81. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/commands/unload_command.py +0 -0
  82. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/config.py +0 -0
  83. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/__init__.py +0 -0
  84. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/app_factory.py +0 -0
  85. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/auth_validator.py +0 -0
  86. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/certificate_utils.py +0 -0
  87. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/client_security.py +0 -0
  88. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/config_converter.py +0 -0
  89. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/config_validator.py +0 -0
  90. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/errors.py +0 -0
  91. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/logging.py +0 -0
  92. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/mtls_asgi.py +0 -0
  93. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/mtls_asgi_app.py +0 -0
  94. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/proxy_client.py +0 -0
  95. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/proxy_registration.py +0 -0
  96. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/role_utils.py +0 -0
  97. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/security_adapter.py +0 -0
  98. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/security_factory.py +0 -0
  99. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/server_adapter.py +0 -0
  100. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/server_engine.py +0 -0
  101. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/settings.py +0 -0
  102. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/ssl_utils.py +0 -0
  103. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/transport_manager.py +0 -0
  104. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/unified_config_adapter.py +0 -0
  105. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/core/utils.py +0 -0
  106. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/custom_openapi.py +0 -0
  107. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/README.md +0 -0
  108. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/README_EN.md +0 -0
  109. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/SECURITY_TESTING.md +0 -0
  110. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/basic_framework/configs/http_auth.json +0 -0
  111. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/basic_framework/configs/http_simple.json +0 -0
  112. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/basic_framework/configs/mtls_no_roles.json +0 -0
  113. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/basic_framework/configs/mtls_with_roles.json +0 -0
  114. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/basic_framework/main.py +0 -0
  115. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/basic_framework/roles.json +0 -0
  116. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/cert_config.json +0 -0
  117. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/admin.crt +0 -0
  118. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/admin.key +0 -0
  119. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/admin_cert.pem +0 -0
  120. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/admin_key.pem +0 -0
  121. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/ca_cert.pem +0 -0
  122. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/ca_cert.srl +0 -0
  123. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/ca_key.pem +0 -0
  124. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/cert_config.json +0 -0
  125. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/client.crt +0 -0
  126. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/client.key +0 -0
  127. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/client_admin.crt +0 -0
  128. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/client_admin.key +0 -0
  129. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/client_user.crt +0 -0
  130. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/client_user.key +0 -0
  131. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/guest_cert.pem +0 -0
  132. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/guest_key.pem +0 -0
  133. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/mcp_proxy_adapter_ca_ca.crt +0 -0
  134. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/proxy_cert.pem +0 -0
  135. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/proxy_key.pem +0 -0
  136. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/readonly.crt +0 -0
  137. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/readonly.key +0 -0
  138. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/readonly_cert.pem +0 -0
  139. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/readonly_key.pem +0 -0
  140. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/server.crt +0 -0
  141. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/server.key +0 -0
  142. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/server_cert.pem +0 -0
  143. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/server_key.pem +0 -0
  144. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/test_ca_ca.crt +0 -0
  145. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/user.crt +0 -0
  146. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/user.key +0 -0
  147. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/user_cert.pem +0 -0
  148. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/certs/user_key.pem +0 -0
  149. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/client_configs/api_key_client.json +0 -0
  150. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/client_configs/basic_auth_client.json +0 -0
  151. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/client_configs/certificate_client.json +0 -0
  152. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/client_configs/jwt_client.json +0 -0
  153. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/client_configs/no_auth_client.json +0 -0
  154. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/commands/__init__.py +0 -0
  155. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/create_certificates_simple.py +0 -0
  156. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/debug_request_state.py +0 -0
  157. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/debug_role_chain.py +0 -0
  158. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/demo_client.py +0 -0
  159. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/full_application/commands/custom_echo_command.py +0 -0
  160. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.py +0 -0
  161. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/full_application/configs/http_auth.json +0 -0
  162. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/full_application/configs/http_simple.json +0 -0
  163. {mcp_proxy_adapter-6.1.0/mcp_proxy_adapter/examples/basic_framework → mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/examples/full_application}/configs/https_auth.json +0 -0
  164. {mcp_proxy_adapter-6.1.0/mcp_proxy_adapter/examples/basic_framework → mcp_proxy_adapter-6.1.1/mcp_proxy_adapter/examples/full_application}/configs/https_simple.json +0 -0
  165. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/full_application/configs/mtls_no_roles.json +0 -0
  166. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/full_application/configs/mtls_with_roles.json +0 -0
  167. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/full_application/hooks/application_hooks.py +0 -0
  168. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/full_application/hooks/builtin_command_hooks.py +0 -0
  169. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/full_application/main.py +0 -0
  170. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/full_application/roles.json +0 -0
  171. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/generate_all_certificates.py +0 -0
  172. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/generate_certificates.py +0 -0
  173. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/keys/ca_key.pem +0 -0
  174. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/keys/mcp_proxy_adapter_ca_ca.key +0 -0
  175. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/keys/test_ca_ca.key +0 -0
  176. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log +0 -0
  177. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.1 +0 -0
  178. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.2 +0 -0
  179. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.3 +0 -0
  180. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.4 +0 -0
  181. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.5 +0 -0
  182. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log +0 -0
  183. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.1 +0 -0
  184. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.2 +0 -0
  185. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.3 +0 -0
  186. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.4 +0 -0
  187. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.5 +0 -0
  188. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log +0 -0
  189. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.1 +0 -0
  190. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.2 +0 -0
  191. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.3 +0 -0
  192. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.4 +0 -0
  193. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.5 +0 -0
  194. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/proxy_registration_example.py +0 -0
  195. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/roles.json +0 -0
  196. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/run_example.py +0 -0
  197. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/run_security_tests.py +0 -0
  198. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/run_security_tests_fixed.py +0 -0
  199. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/security_test_client.py +0 -0
  200. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/server_configs/config_basic_http.json +0 -0
  201. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/server_configs/config_http_token.json +0 -0
  202. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/server_configs/config_https.json +0 -0
  203. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/server_configs/config_https_token.json +0 -0
  204. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/server_configs/config_mtls.json +0 -0
  205. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/server_configs/config_proxy_registration.json +0 -0
  206. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/server_configs/config_simple.json +0 -0
  207. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/server_configs/roles.json +0 -0
  208. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/test_examples.py +0 -0
  209. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/examples/universal_client.py +0 -0
  210. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/main.py +0 -0
  211. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter/openapi.py +0 -0
  212. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter.egg-info/dependency_links.txt +0 -0
  213. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter.egg-info/entry_points.txt +0 -0
  214. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter.egg-info/requires.txt +0 -0
  215. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/mcp_proxy_adapter.egg-info/top_level.txt +0 -0
  216. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/setup.cfg +0 -0
  217. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/__init__.py +0 -0
  218. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/api/__init__.py +0 -0
  219. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/api/test_cmd_endpoint.py +0 -0
  220. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/api/test_custom_openapi.py +0 -0
  221. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/api/test_handlers.py +0 -0
  222. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/api/test_schemas.py +0 -0
  223. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/api/test_tool_integration.py +0 -0
  224. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/clients/__init__.py +0 -0
  225. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/clients/security_test_client.py +0 -0
  226. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/commands/__init__.py +0 -0
  227. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/commands/test_config_command.py +0 -0
  228. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/commands/test_echo_command.py +0 -0
  229. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/commands/test_help_command.py +0 -0
  230. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/common/mock_classes.py +0 -0
  231. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/conftest.py +0 -0
  232. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/functional/__init__.py +0 -0
  233. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/functional/test_api.py +0 -0
  234. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/integration/__init__.py +0 -0
  235. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/integration/test_cmd_integration.py +0 -0
  236. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/integration/test_configuration_scenarios.py +0 -0
  237. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/integration/test_integration.py +0 -0
  238. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/integration/test_security_integration.py +0 -0
  239. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/performance/__init__.py +0 -0
  240. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/performance/test_performance.py +0 -0
  241. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/performance/test_security_performance.py +0 -0
  242. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/stubs/__init__.py +0 -0
  243. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/test_api_endpoints.py +0 -0
  244. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/test_batch_requests.py +0 -0
  245. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/test_command_registry.py +0 -0
  246. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/test_security_examples.py +0 -0
  247. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/test_utils.py +0 -0
  248. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/unit/__init__.py +0 -0
  249. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/unit/test_base_command.py +0 -0
  250. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/unit/test_config.py +0 -0
  251. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/unit/test_unified_config_adapter.py +0 -0
  252. {mcp_proxy_adapter-6.1.0 → mcp_proxy_adapter-6.1.1}/tests/unit/test_unified_security_middleware.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-proxy-adapter
3
- Version: 6.1.0
3
+ Version: 6.1.1
4
4
  Summary: Model Context Protocol Proxy Adapter with Security Framework
5
5
  Home-page: https://github.com/maverikod/mcp-proxy-adapter
6
6
  Author: Vasiliy Zdanovskiy
@@ -43,8 +43,8 @@ def setup_middleware(app: FastAPI, app_config: Optional[Dict[str, Any]] = None)
43
43
  else:
44
44
  logger.warning(f"Middleware {middleware.__class__.__name__} doesn't have dispatch method")
45
45
 
46
- # Add protocol middleware (always needed)
47
- setup_protocol_middleware(app)
46
+ # Add protocol middleware with current configuration
47
+ setup_protocol_middleware(app, current_config)
48
48
 
49
49
  # Log middleware information
50
50
  middleware_info = factory.get_middleware_info()
@@ -4,12 +4,12 @@ Protocol middleware module.
4
4
  This module provides middleware for validating protocol access based on configuration.
5
5
  """
6
6
 
7
- from typing import Callable
7
+ from typing import Callable, Dict, Any, Optional
8
8
  from fastapi import Request, Response
9
9
  from starlette.middleware.base import BaseHTTPMiddleware
10
10
  from starlette.responses import JSONResponse
11
11
 
12
- from mcp_proxy_adapter.core.protocol_manager import protocol_manager
12
+ from mcp_proxy_adapter.core.protocol_manager import get_protocol_manager
13
13
  from mcp_proxy_adapter.core.logging import logger
14
14
 
15
15
 
@@ -21,16 +21,29 @@ class ProtocolMiddleware(BaseHTTPMiddleware):
21
21
  based on the protocol configuration.
22
22
  """
23
23
 
24
- def __init__(self, app, protocol_manager_instance=None):
24
+ def __init__(self, app, app_config: Optional[Dict[str, Any]] = None):
25
25
  """
26
26
  Initialize protocol middleware.
27
27
 
28
28
  Args:
29
29
  app: FastAPI application
30
- protocol_manager_instance: Protocol manager instance (optional)
30
+ app_config: Application configuration dictionary (optional)
31
31
  """
32
32
  super().__init__(app)
33
- self.protocol_manager = protocol_manager_instance or protocol_manager
33
+ self.app_config = app_config
34
+ # Get protocol manager with current configuration
35
+ self.protocol_manager = get_protocol_manager(app_config)
36
+
37
+ def update_config(self, new_config: Dict[str, Any]):
38
+ """
39
+ Update configuration and reload protocol manager.
40
+
41
+ Args:
42
+ new_config: New configuration dictionary
43
+ """
44
+ self.app_config = new_config
45
+ self.protocol_manager = get_protocol_manager(new_config)
46
+ logger.info("Protocol middleware configuration updated")
34
47
 
35
48
  async def dispatch(self, request: Request, call_next: Callable) -> Response:
36
49
  """
@@ -116,20 +129,26 @@ class ProtocolMiddleware(BaseHTTPMiddleware):
116
129
  return "http"
117
130
 
118
131
 
119
- def setup_protocol_middleware(app, protocol_manager_instance=None):
132
+ def setup_protocol_middleware(app, app_config: Optional[Dict[str, Any]] = None):
120
133
  """
121
134
  Setup protocol middleware for FastAPI application.
122
135
 
123
136
  Args:
124
137
  app: FastAPI application
125
- protocol_manager_instance: Protocol manager instance (optional)
138
+ app_config: Application configuration dictionary (optional)
126
139
  """
127
- if protocol_manager_instance is None:
128
- protocol_manager_instance = protocol_manager
140
+ # Check if protocol management is enabled
141
+ if app_config is None:
142
+ from mcp_proxy_adapter.config import config
143
+ app_config = config.get_all()
144
+
145
+ protocols_config = app_config.get("protocols", {})
146
+ enabled = protocols_config.get("enabled", True)
129
147
 
130
- # Only add middleware if protocol management is enabled
131
- if protocol_manager_instance.enabled:
132
- app.add_middleware(ProtocolMiddleware, protocol_manager_instance=protocol_manager_instance)
148
+ if enabled:
149
+ # Create protocol middleware with current configuration
150
+ middleware = ProtocolMiddleware(app, app_config)
151
+ app.add_middleware(ProtocolMiddleware, app_config=app_config)
133
152
  logger.info("Protocol middleware added to application")
134
153
  else:
135
- logger.debug("Protocol management is disabled, skipping protocol middleware")
154
+ logger.info("Protocol management is disabled, skipping protocol middleware")
@@ -66,9 +66,12 @@ class UnifiedSecurityMiddleware(BaseHTTPMiddleware):
66
66
  logger.info("Using mcp_security_framework FastAPI middleware")
67
67
  except Exception as e:
68
68
  logger.error(f"Security framework integration failed: {e}")
69
- raise RuntimeError("Security framework integration failed - framework must be available for production use") from e
69
+ # Instead of raising error, log warning and continue without security
70
+ logger.warning("Continuing without security framework - some security features will be disabled")
71
+ self.security_integration = None
72
+ self.framework_middleware = None
70
73
 
71
- logger.info("Unified security middleware initialized with mcp_security_framework")
74
+ logger.info("Unified security middleware initialized")
72
75
 
73
76
  async def dispatch(self, request: Request, call_next: Callable[[Request], Awaitable[Response]]) -> Response:
74
77
  """
@@ -82,8 +85,13 @@ class UnifiedSecurityMiddleware(BaseHTTPMiddleware):
82
85
  Response object
83
86
  """
84
87
  try:
85
- # Use framework middleware only
86
- return await self.framework_middleware.dispatch(request, call_next)
88
+ # Use framework middleware if available
89
+ if self.framework_middleware is not None:
90
+ return await self.framework_middleware.dispatch(request, call_next)
91
+ else:
92
+ # Fallback: continue without security middleware
93
+ logger.debug("Security framework not available, continuing without security checks")
94
+ return await call_next(request)
87
95
 
88
96
  except SecurityValidationError as e:
89
97
  # Handle security validation errors
@@ -21,19 +21,84 @@ class ProtocolManager:
21
21
  ensuring that only configured protocols are accessible.
22
22
  """
23
23
 
24
- def __init__(self):
25
- """Initialize the protocol manager."""
24
+ def __init__(self, app_config: Optional[Dict] = None):
25
+ """
26
+ Initialize the protocol manager.
27
+
28
+ Args:
29
+ app_config: Application configuration dictionary (optional)
30
+ """
31
+ self.app_config = app_config
26
32
  self._load_config()
27
33
 
28
34
  def _load_config(self):
29
35
  """Load protocol configuration from config."""
30
- self.protocols_config = config.get("protocols", {})
36
+ # Use provided config or fallback to global config
37
+ current_config = self.app_config if self.app_config is not None else config.get_all()
38
+
39
+ # Get protocols configuration
40
+ self.protocols_config = current_config.get("protocols", {})
31
41
  self.enabled = self.protocols_config.get("enabled", True)
32
- self.allowed_protocols = self.protocols_config.get("allowed_protocols", ["http"])
33
- logger.debug(f"Protocol manager loaded config: enabled={self.enabled}, allowed_protocols={self.allowed_protocols}")
42
+
43
+ # Get SSL configuration to determine allowed protocols
44
+ ssl_enabled = self._is_ssl_enabled(current_config)
45
+
46
+ # Set allowed protocols based on SSL configuration
47
+ if ssl_enabled:
48
+ # If SSL is enabled, allow both HTTP and HTTPS
49
+ self.allowed_protocols = self.protocols_config.get("allowed_protocols", ["http", "https"])
50
+ # Ensure HTTPS is in allowed protocols if SSL is enabled
51
+ if "https" not in self.allowed_protocols:
52
+ self.allowed_protocols.append("https")
53
+ else:
54
+ # If SSL is disabled, only allow HTTP
55
+ self.allowed_protocols = self.protocols_config.get("allowed_protocols", ["http"])
56
+ # Remove HTTPS from allowed protocols if SSL is disabled
57
+ if "https" in self.allowed_protocols:
58
+ self.allowed_protocols.remove("https")
59
+
60
+ logger.debug(f"Protocol manager loaded config: enabled={self.enabled}, allowed_protocols={self.allowed_protocols}, ssl_enabled={ssl_enabled}")
61
+
62
+ def _is_ssl_enabled(self, current_config: Dict) -> bool:
63
+ """
64
+ Check if SSL is enabled in configuration.
65
+
66
+ Args:
67
+ current_config: Current configuration dictionary
68
+
69
+ Returns:
70
+ True if SSL is enabled, False otherwise
71
+ """
72
+ # Try security framework SSL config first
73
+ security_config = current_config.get("security", {})
74
+ ssl_config = security_config.get("ssl", {})
75
+
76
+ if ssl_config.get("enabled", False):
77
+ logger.debug("SSL enabled via security.ssl configuration")
78
+ return True
79
+
80
+ # Fallback to legacy SSL config
81
+ legacy_ssl_config = current_config.get("ssl", {})
82
+ if legacy_ssl_config.get("enabled", False):
83
+ logger.debug("SSL enabled via legacy ssl configuration")
84
+ return True
85
+
86
+ logger.debug("SSL is disabled in configuration")
87
+ return False
88
+
89
+ def update_config(self, new_config: Dict):
90
+ """
91
+ Update configuration and reload protocol settings.
92
+
93
+ Args:
94
+ new_config: New configuration dictionary
95
+ """
96
+ self.app_config = new_config
97
+ self._load_config()
98
+ logger.info(f"Protocol manager configuration updated: allowed_protocols={self.allowed_protocols}")
34
99
 
35
100
  def reload_config(self):
36
- """Reload protocol configuration."""
101
+ """Reload protocol configuration from global config."""
37
102
  self._load_config()
38
103
 
39
104
  def is_protocol_allowed(self, protocol: str) -> bool:
@@ -137,7 +202,11 @@ class ProtocolManager:
137
202
  if protocol.lower() not in ["https", "mtls"]:
138
203
  return None
139
204
 
140
- ssl_config = config.get("ssl", {})
205
+ # Use provided config or fallback to global config
206
+ current_config = self.app_config if self.app_config is not None else config.get_all()
207
+
208
+ # Get SSL configuration
209
+ ssl_config = self._get_ssl_config(current_config)
141
210
 
142
211
  if not ssl_config.get("enabled", False):
143
212
  logger.warning(f"SSL required for protocol '{protocol}' but SSL is disabled")
@@ -170,6 +239,33 @@ class ProtocolManager:
170
239
  logger.error(f"Failed to create SSL context for protocol '{protocol}': {e}")
171
240
  return None
172
241
 
242
+ def _get_ssl_config(self, current_config: Dict) -> Dict:
243
+ """
244
+ Get SSL configuration from config.
245
+
246
+ Args:
247
+ current_config: Current configuration dictionary
248
+
249
+ Returns:
250
+ SSL configuration dictionary
251
+ """
252
+ # Try security framework SSL config first
253
+ security_config = current_config.get("security", {})
254
+ ssl_config = security_config.get("ssl", {})
255
+
256
+ if ssl_config.get("enabled", False):
257
+ logger.debug("Using security.ssl configuration")
258
+ return ssl_config
259
+
260
+ # Fallback to legacy SSL config
261
+ legacy_ssl_config = current_config.get("ssl", {})
262
+ if legacy_ssl_config.get("enabled", False):
263
+ logger.debug("Using legacy ssl configuration")
264
+ return legacy_ssl_config
265
+
266
+ # Return empty config if SSL is disabled
267
+ return {"enabled": False}
268
+
173
269
  def get_protocol_info(self) -> Dict[str, Dict]:
174
270
  """
175
271
  Get information about all configured protocols.
@@ -222,7 +318,10 @@ class ProtocolManager:
222
318
 
223
319
  # Check SSL requirements
224
320
  if protocol in ["https", "mtls"]:
225
- ssl_config = config.get("ssl", {})
321
+ # Use provided config or fallback to global config
322
+ current_config = self.app_config if self.app_config is not None else config.get_all()
323
+ ssl_config = self._get_ssl_config(current_config)
324
+
226
325
  if not ssl_config.get("enabled", False):
227
326
  errors.append(f"Protocol '{protocol}' requires SSL but SSL is disabled")
228
327
  elif not ssl_config.get("cert_file") or not ssl_config.get("key_file"):
@@ -231,5 +330,28 @@ class ProtocolManager:
231
330
  return errors
232
331
 
233
332
 
234
- # Global protocol manager instance
235
- protocol_manager = ProtocolManager()
333
+ # Global protocol manager instance - will be updated with config when needed
334
+ protocol_manager = None
335
+
336
+ def get_protocol_manager(app_config: Optional[Dict] = None) -> ProtocolManager:
337
+ """
338
+ Get protocol manager instance with current configuration.
339
+
340
+ Args:
341
+ app_config: Application configuration dictionary (optional)
342
+
343
+ Returns:
344
+ ProtocolManager instance
345
+ """
346
+ global protocol_manager
347
+
348
+ # If no app_config provided, use global config
349
+ if app_config is None:
350
+ app_config = config.get_all()
351
+
352
+ # Create new instance if none exists or config changed
353
+ if protocol_manager is None or protocol_manager.app_config != app_config:
354
+ protocol_manager = ProtocolManager(app_config)
355
+ logger.info("Protocol manager created with new configuration")
356
+
357
+ return protocol_manager
@@ -102,18 +102,26 @@ class SecurityIntegration:
102
102
  public_paths=security_section.get("auth", {}).get("public_paths", [])
103
103
  )
104
104
 
105
- # Create permission config
105
+ # Create permission config - handle null values properly
106
+ permissions_section = security_section.get("permissions", {})
107
+ roles_file = permissions_section.get("roles_file")
108
+
109
+ # If roles_file is None or empty string, don't pass it to avoid framework errors
110
+ if roles_file is None or roles_file == "":
111
+ logger.warning("roles_file is None or empty, permissions will use default configuration")
112
+ roles_file = None
113
+
106
114
  permission_config = PermissionConfig(
107
- enabled=security_section.get("permissions", {}).get("enabled", True),
108
- roles_file=security_section.get("permissions", {}).get("roles_file"),
109
- default_role=security_section.get("permissions", {}).get("default_role", "guest"),
110
- admin_role=security_section.get("permissions", {}).get("admin_role", "admin"),
111
- role_hierarchy=security_section.get("permissions", {}).get("role_hierarchy", {}),
112
- permission_cache_enabled=security_section.get("permissions", {}).get("permission_cache_enabled", True),
113
- permission_cache_ttl=security_section.get("permissions", {}).get("permission_cache_ttl", 300),
114
- wildcard_permissions=security_section.get("permissions", {}).get("wildcard_permissions", False),
115
- strict_mode=security_section.get("permissions", {}).get("strict_mode", True),
116
- roles=security_section.get("permissions", {}).get("roles")
115
+ enabled=permissions_section.get("enabled", True),
116
+ roles_file=roles_file,
117
+ default_role=permissions_section.get("default_role", "guest"),
118
+ admin_role=permissions_section.get("admin_role", "admin"),
119
+ role_hierarchy=permissions_section.get("role_hierarchy", {}),
120
+ permission_cache_enabled=permissions_section.get("permission_cache_enabled", True),
121
+ permission_cache_ttl=permissions_section.get("permission_cache_ttl", 300),
122
+ wildcard_permissions=permissions_section.get("wildcard_permissions", False),
123
+ strict_mode=permissions_section.get("strict_mode", True),
124
+ roles=permissions_section.get("roles")
117
125
  )
118
126
 
119
127
  # Create rate limit config
@@ -0,0 +1,285 @@
1
+ # Troubleshooting Guide
2
+
3
+ This guide addresses common issues with MCP Proxy Adapter Framework, particularly related to ProtocolMiddleware and SSL/TLS configuration.
4
+
5
+ ## Common Issues
6
+
7
+ ### Issue 1: ProtocolMiddleware blocks HTTPS requests
8
+
9
+ **Problem:** ProtocolMiddleware is initialized with default settings and doesn't update when SSL configuration changes.
10
+
11
+ **Symptoms:**
12
+ ```
13
+ Protocol 'https' not allowed for request to /health
14
+ INFO: 127.0.0.1:42038 - "GET /health HTTP/1.1" 403 Forbidden
15
+ ```
16
+
17
+ **Root Cause:** ProtocolMiddleware was created as a global instance with default settings and didn't update when SSL was enabled.
18
+
19
+ **Solution:**
20
+ 1. **Use updated ProtocolManager** (Fixed in v1.1.0):
21
+ - ProtocolManager now dynamically updates based on SSL configuration
22
+ - Automatically allows HTTPS when SSL is enabled
23
+
24
+ 2. **Disable ProtocolMiddleware for HTTPS** (Temporary workaround):
25
+ ```json
26
+ {
27
+ "server": {"host": "127.0.0.1", "port": 10004},
28
+ "ssl": {"enabled": true, "cert_file": "./certs/server.crt", "key_file": "./certs/server.key"},
29
+ "security": {"enabled": true, "auth": {"enabled": true, "methods": ["api_key"]}},
30
+ "protocols": {"enabled": false}
31
+ }
32
+ ```
33
+
34
+ ### Issue 2: SSL Configuration Conflicts
35
+
36
+ **Problem:** Framework reads SSL configuration from both `ssl` (legacy) and `security.ssl` sections, causing confusion.
37
+
38
+ **Symptoms:**
39
+ ```
40
+ 🔍 Debug: SSL config at start of validation: enabled=False
41
+ 🔍 Debug: Root SSL section found: enabled=True
42
+ 🔍 Debug: _get_ssl_config: security.ssl key_file=None
43
+ 🔍 Debug: _get_ssl_config: legacy ssl key_file=./certs/server.key
44
+ ```
45
+
46
+ **Solution:**
47
+ 1. **Use unified SSL configuration** (Recommended):
48
+ ```json
49
+ {
50
+ "security": {
51
+ "ssl": {
52
+ "enabled": true,
53
+ "cert_file": "./certs/server.crt",
54
+ "key_file": "./certs/server.key"
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ 2. **Use legacy SSL configuration** (Backward compatible):
61
+ ```json
62
+ {
63
+ "ssl": {
64
+ "enabled": true,
65
+ "cert_file": "./certs/server.crt",
66
+ "key_file": "./certs/server.key"
67
+ }
68
+ }
69
+ ```
70
+
71
+ ### Issue 3: Security Framework Initialization Errors
72
+
73
+ **Problem:** Security framework fails to initialize due to missing or null configuration values.
74
+
75
+ **Symptoms:**
76
+ ```
77
+ Failed to initialize security components: Failed to load roles configuration: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType'
78
+ ```
79
+
80
+ **Solution:**
81
+ 1. **Provide roles file** (If using roles):
82
+ ```json
83
+ {
84
+ "security": {
85
+ "permissions": {
86
+ "enabled": true,
87
+ "roles_file": "./roles.json"
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ 2. **Disable permissions** (If not using roles):
94
+ ```json
95
+ {
96
+ "security": {
97
+ "permissions": {
98
+ "enabled": false
99
+ }
100
+ }
101
+ }
102
+ ```
103
+
104
+ 3. **Use graceful fallback** (Fixed in v1.1.0):
105
+ - Security framework now continues without roles if roles_file is null
106
+ - Logs warning instead of crashing
107
+
108
+ ## Configuration Examples
109
+
110
+ ### HTTP Simple
111
+ ```json
112
+ {
113
+ "server": {"host": "127.0.0.1", "port": 10001},
114
+ "ssl": {"enabled": false},
115
+ "security": {"enabled": false},
116
+ "protocols": {"enabled": true, "allowed_protocols": ["http"]}
117
+ }
118
+ ```
119
+
120
+ ### HTTPS Simple
121
+ ```json
122
+ {
123
+ "server": {"host": "127.0.0.1", "port": 10002},
124
+ "ssl": {"enabled": true, "cert_file": "./certs/server.crt", "key_file": "./certs/server.key"},
125
+ "security": {"enabled": false},
126
+ "protocols": {"enabled": true, "allowed_protocols": ["http", "https"]}
127
+ }
128
+ ```
129
+
130
+ ### HTTPS with Token Auth
131
+ ```json
132
+ {
133
+ "server": {"host": "127.0.0.1", "port": 10003},
134
+ "ssl": {"enabled": true, "cert_file": "./certs/server.crt", "key_file": "./certs/server.key"},
135
+ "security": {
136
+ "enabled": true,
137
+ "auth": {"enabled": true, "methods": ["api_key"]}
138
+ },
139
+ "protocols": {"enabled": true, "allowed_protocols": ["http", "https"]}
140
+ }
141
+ ```
142
+
143
+ ### HTTPS without ProtocolMiddleware
144
+ ```json
145
+ {
146
+ "server": {"host": "127.0.0.1", "port": 10004},
147
+ "ssl": {"enabled": true, "cert_file": "./certs/server.crt", "key_file": "./certs/server.key"},
148
+ "security": {
149
+ "enabled": true,
150
+ "auth": {"enabled": true, "methods": ["api_key"]}
151
+ },
152
+ "protocols": {"enabled": false}
153
+ }
154
+ ```
155
+
156
+ ### mTLS Simple
157
+ ```json
158
+ {
159
+ "server": {"host": "127.0.0.1", "port": 10005},
160
+ "ssl": {
161
+ "enabled": true,
162
+ "cert_file": "./certs/server.crt",
163
+ "key_file": "./certs/server.key",
164
+ "ca_cert": "./certs/ca.crt",
165
+ "verify_client": true
166
+ },
167
+ "security": {
168
+ "enabled": true,
169
+ "auth": {"enabled": true, "methods": ["certificate"]}
170
+ },
171
+ "protocols": {"enabled": true, "allowed_protocols": ["https", "mtls"]}
172
+ }
173
+ ```
174
+
175
+ ## Testing Your Configuration
176
+
177
+ ### Test HTTP
178
+ ```bash
179
+ curl http://127.0.0.1:10001/health
180
+ ```
181
+
182
+ ### Test HTTPS
183
+ ```bash
184
+ curl -k https://127.0.0.1:10002/health
185
+ ```
186
+
187
+ ### Test HTTPS with Auth
188
+ ```bash
189
+ curl -k -H "Authorization: Bearer your-api-key" https://127.0.0.1:10003/health
190
+ ```
191
+
192
+ ### Test mTLS
193
+ ```bash
194
+ curl -k --cert ./certs/client.crt --key ./certs/client.key https://127.0.0.1:10005/health
195
+ ```
196
+
197
+ ## Debugging
198
+
199
+ ### Enable Debug Logging
200
+ ```json
201
+ {
202
+ "logging": {
203
+ "level": "DEBUG",
204
+ "console_output": true
205
+ }
206
+ }
207
+ ```
208
+
209
+ ### Check Protocol Manager Status
210
+ ```python
211
+ from mcp_proxy_adapter.core.protocol_manager import get_protocol_manager
212
+ from mcp_proxy_adapter.config import config
213
+
214
+ pm = get_protocol_manager(config.get_all())
215
+ print(f"Allowed protocols: {pm.get_allowed_protocols()}")
216
+ print(f"Protocol info: {pm.get_protocol_info()}")
217
+ ```
218
+
219
+ ### Check SSL Configuration
220
+ ```python
221
+ from mcp_proxy_adapter.config import config
222
+
223
+ ssl_config = config.get("ssl", {})
224
+ security_ssl = config.get("security", {}).get("ssl", {})
225
+ print(f"Legacy SSL: {ssl_config}")
226
+ print(f"Security SSL: {security_ssl}")
227
+ ```
228
+
229
+ ## Migration Guide
230
+
231
+ ### From Legacy to New Configuration
232
+
233
+ **Old (Legacy):**
234
+ ```json
235
+ {
236
+ "ssl": {"enabled": true, "cert_file": "./certs/server.crt", "key_file": "./certs/server.key"}
237
+ }
238
+ ```
239
+
240
+ **New (Recommended):**
241
+ ```json
242
+ {
243
+ "security": {
244
+ "ssl": {"enabled": true, "cert_file": "./certs/server.crt", "key_file": "./certs/server.key"}
245
+ }
246
+ }
247
+ ```
248
+
249
+ ### Adding Protocol Management
250
+
251
+ **Without Protocol Management:**
252
+ ```json
253
+ {
254
+ "protocols": {"enabled": false}
255
+ }
256
+ ```
257
+
258
+ **With Protocol Management:**
259
+ ```json
260
+ {
261
+ "protocols": {
262
+ "enabled": true,
263
+ "allowed_protocols": ["http", "https"]
264
+ }
265
+ }
266
+ ```
267
+
268
+ ## Best Practices
269
+
270
+ 1. **Use security.ssl instead of legacy ssl** for new configurations
271
+ 2. **Disable ProtocolMiddleware** if you don't need protocol validation
272
+ 3. **Provide roles_file** or disable permissions if using security framework
273
+ 4. **Test configurations** before deploying to production
274
+ 5. **Use debug logging** for troubleshooting
275
+ 6. **Keep certificates and keys secure** and properly configured
276
+
277
+ ## Support
278
+
279
+ If you encounter issues not covered in this guide:
280
+
281
+ 1. Check the logs for detailed error messages
282
+ 2. Enable debug logging for more information
283
+ 3. Verify certificate files exist and are readable
284
+ 4. Test with simple configurations first
285
+ 5. Report issues with full configuration and error logs