mcp-proxy-adapter 6.0.0__py3-none-any.whl → 6.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. mcp_proxy_adapter/api/app.py +174 -80
  2. mcp_proxy_adapter/api/handlers.py +16 -5
  3. mcp_proxy_adapter/api/middleware/__init__.py +7 -2
  4. mcp_proxy_adapter/api/middleware/command_permission_middleware.py +148 -0
  5. mcp_proxy_adapter/api/middleware/factory.py +36 -12
  6. mcp_proxy_adapter/api/middleware/unified_security.py +152 -0
  7. mcp_proxy_adapter/api/middleware/user_info_middleware.py +83 -0
  8. mcp_proxy_adapter/commands/__init__.py +7 -1
  9. mcp_proxy_adapter/commands/base.py +7 -4
  10. mcp_proxy_adapter/commands/builtin_commands.py +8 -2
  11. mcp_proxy_adapter/commands/command_registry.py +8 -0
  12. mcp_proxy_adapter/commands/echo_command.py +81 -0
  13. mcp_proxy_adapter/commands/help_command.py +21 -14
  14. mcp_proxy_adapter/commands/proxy_registration_command.py +326 -185
  15. mcp_proxy_adapter/commands/role_test_command.py +141 -0
  16. mcp_proxy_adapter/commands/security_command.py +488 -0
  17. mcp_proxy_adapter/commands/ssl_setup_command.py +2 -2
  18. mcp_proxy_adapter/commands/token_management_command.py +1 -1
  19. mcp_proxy_adapter/config.py +81 -21
  20. mcp_proxy_adapter/core/app_factory.py +326 -0
  21. mcp_proxy_adapter/core/client_security.py +384 -0
  22. mcp_proxy_adapter/core/logging.py +8 -3
  23. mcp_proxy_adapter/core/mtls_asgi.py +156 -0
  24. mcp_proxy_adapter/core/mtls_asgi_app.py +187 -0
  25. mcp_proxy_adapter/core/protocol_manager.py +9 -0
  26. mcp_proxy_adapter/core/proxy_client.py +602 -0
  27. mcp_proxy_adapter/core/proxy_registration.py +299 -47
  28. mcp_proxy_adapter/core/security_adapter.py +12 -15
  29. mcp_proxy_adapter/core/security_integration.py +277 -0
  30. mcp_proxy_adapter/core/server_adapter.py +345 -0
  31. mcp_proxy_adapter/core/server_engine.py +364 -0
  32. mcp_proxy_adapter/core/unified_config_adapter.py +579 -0
  33. mcp_proxy_adapter/examples/README.md +230 -97
  34. mcp_proxy_adapter/examples/README_EN.md +258 -0
  35. mcp_proxy_adapter/examples/SECURITY_TESTING.md +455 -0
  36. mcp_proxy_adapter/examples/__pycache__/security_configurations.cpython-312.pyc +0 -0
  37. mcp_proxy_adapter/examples/__pycache__/security_test_client.cpython-312.pyc +0 -0
  38. mcp_proxy_adapter/examples/basic_framework/configs/http_auth.json +37 -0
  39. mcp_proxy_adapter/examples/basic_framework/configs/http_simple.json +23 -0
  40. mcp_proxy_adapter/examples/basic_framework/configs/https_auth.json +39 -0
  41. mcp_proxy_adapter/examples/basic_framework/configs/https_simple.json +25 -0
  42. mcp_proxy_adapter/examples/basic_framework/configs/mtls_no_roles.json +39 -0
  43. mcp_proxy_adapter/examples/basic_framework/configs/mtls_with_roles.json +45 -0
  44. mcp_proxy_adapter/examples/basic_framework/main.py +63 -0
  45. mcp_proxy_adapter/examples/basic_framework/roles.json +21 -0
  46. mcp_proxy_adapter/examples/cert_config.json +9 -0
  47. mcp_proxy_adapter/examples/certs/admin.crt +32 -0
  48. mcp_proxy_adapter/examples/certs/admin.key +52 -0
  49. mcp_proxy_adapter/examples/certs/admin_cert.pem +21 -0
  50. mcp_proxy_adapter/examples/certs/admin_key.pem +28 -0
  51. mcp_proxy_adapter/examples/certs/ca_cert.pem +23 -0
  52. mcp_proxy_adapter/examples/certs/ca_cert.srl +1 -0
  53. mcp_proxy_adapter/examples/certs/ca_key.pem +28 -0
  54. mcp_proxy_adapter/examples/certs/cert_config.json +9 -0
  55. mcp_proxy_adapter/examples/certs/client.crt +32 -0
  56. mcp_proxy_adapter/examples/certs/client.key +52 -0
  57. mcp_proxy_adapter/examples/certs/client_admin.crt +32 -0
  58. mcp_proxy_adapter/examples/certs/client_admin.key +52 -0
  59. mcp_proxy_adapter/examples/certs/client_user.crt +32 -0
  60. mcp_proxy_adapter/examples/certs/client_user.key +52 -0
  61. mcp_proxy_adapter/examples/certs/guest_cert.pem +21 -0
  62. mcp_proxy_adapter/examples/certs/guest_key.pem +28 -0
  63. mcp_proxy_adapter/examples/certs/mcp_proxy_adapter_ca_ca.crt +23 -0
  64. mcp_proxy_adapter/examples/certs/proxy_cert.pem +21 -0
  65. mcp_proxy_adapter/examples/certs/proxy_key.pem +28 -0
  66. mcp_proxy_adapter/examples/certs/readonly.crt +32 -0
  67. mcp_proxy_adapter/examples/certs/readonly.key +52 -0
  68. mcp_proxy_adapter/examples/certs/readonly_cert.pem +21 -0
  69. mcp_proxy_adapter/examples/certs/readonly_key.pem +28 -0
  70. mcp_proxy_adapter/examples/certs/server.crt +32 -0
  71. mcp_proxy_adapter/examples/certs/server.key +52 -0
  72. mcp_proxy_adapter/examples/certs/server_cert.pem +32 -0
  73. mcp_proxy_adapter/examples/certs/server_key.pem +52 -0
  74. mcp_proxy_adapter/examples/certs/test_ca_ca.crt +20 -0
  75. mcp_proxy_adapter/examples/certs/user.crt +32 -0
  76. mcp_proxy_adapter/examples/certs/user.key +52 -0
  77. mcp_proxy_adapter/examples/certs/user_cert.pem +21 -0
  78. mcp_proxy_adapter/examples/certs/user_key.pem +28 -0
  79. mcp_proxy_adapter/examples/client_configs/api_key_client.json +13 -0
  80. mcp_proxy_adapter/examples/client_configs/basic_auth_client.json +13 -0
  81. mcp_proxy_adapter/examples/client_configs/certificate_client.json +22 -0
  82. mcp_proxy_adapter/examples/client_configs/jwt_client.json +15 -0
  83. mcp_proxy_adapter/examples/client_configs/no_auth_client.json +9 -0
  84. mcp_proxy_adapter/examples/commands/__init__.py +1 -0
  85. mcp_proxy_adapter/examples/create_certificates_simple.py +307 -0
  86. mcp_proxy_adapter/examples/debug_request_state.py +144 -0
  87. mcp_proxy_adapter/examples/debug_role_chain.py +205 -0
  88. mcp_proxy_adapter/examples/demo_client.py +341 -0
  89. mcp_proxy_adapter/examples/full_application/commands/custom_echo_command.py +99 -0
  90. mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.py +106 -0
  91. mcp_proxy_adapter/examples/full_application/configs/http_auth.json +37 -0
  92. mcp_proxy_adapter/examples/full_application/configs/http_simple.json +23 -0
  93. mcp_proxy_adapter/examples/full_application/configs/https_auth.json +39 -0
  94. mcp_proxy_adapter/examples/full_application/configs/https_simple.json +25 -0
  95. mcp_proxy_adapter/examples/full_application/configs/mtls_no_roles.json +39 -0
  96. mcp_proxy_adapter/examples/full_application/configs/mtls_with_roles.json +45 -0
  97. mcp_proxy_adapter/examples/full_application/hooks/application_hooks.py +97 -0
  98. mcp_proxy_adapter/examples/full_application/hooks/builtin_command_hooks.py +95 -0
  99. mcp_proxy_adapter/examples/full_application/main.py +138 -0
  100. mcp_proxy_adapter/examples/full_application/roles.json +21 -0
  101. mcp_proxy_adapter/examples/generate_all_certificates.py +429 -0
  102. mcp_proxy_adapter/examples/generate_certificates.py +121 -0
  103. mcp_proxy_adapter/examples/keys/ca_key.pem +28 -0
  104. mcp_proxy_adapter/examples/keys/mcp_proxy_adapter_ca_ca.key +28 -0
  105. mcp_proxy_adapter/examples/keys/test_ca_ca.key +28 -0
  106. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log +220 -0
  107. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.1 +1 -0
  108. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.2 +1 -0
  109. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.3 +1 -0
  110. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.4 +1 -0
  111. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.5 +1 -0
  112. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log +220 -0
  113. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.1 +1 -0
  114. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.2 +1 -0
  115. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.3 +1 -0
  116. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.4 +1 -0
  117. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.5 +1 -0
  118. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log +2 -0
  119. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.1 +1 -0
  120. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.2 +1 -0
  121. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.3 +1 -0
  122. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.4 +1 -0
  123. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.5 +1 -0
  124. mcp_proxy_adapter/examples/proxy_registration_example.py +401 -0
  125. mcp_proxy_adapter/examples/roles.json +38 -0
  126. mcp_proxy_adapter/examples/run_example.py +81 -0
  127. mcp_proxy_adapter/examples/run_security_tests.py +326 -0
  128. mcp_proxy_adapter/examples/run_security_tests_fixed.py +300 -0
  129. mcp_proxy_adapter/examples/security_test_client.py +743 -0
  130. mcp_proxy_adapter/examples/server_configs/config_basic_http.json +204 -0
  131. mcp_proxy_adapter/examples/server_configs/config_http_token.json +238 -0
  132. mcp_proxy_adapter/examples/server_configs/config_https.json +215 -0
  133. mcp_proxy_adapter/examples/server_configs/config_https_token.json +231 -0
  134. mcp_proxy_adapter/examples/server_configs/config_mtls.json +215 -0
  135. mcp_proxy_adapter/examples/server_configs/config_proxy_registration.json +250 -0
  136. mcp_proxy_adapter/examples/server_configs/config_simple.json +46 -0
  137. mcp_proxy_adapter/examples/server_configs/roles.json +38 -0
  138. mcp_proxy_adapter/examples/test_examples.py +344 -0
  139. mcp_proxy_adapter/examples/universal_client.py +628 -0
  140. mcp_proxy_adapter/main.py +21 -10
  141. mcp_proxy_adapter/utils/config_generator.py +639 -0
  142. mcp_proxy_adapter/version.py +2 -1
  143. mcp_proxy_adapter-6.1.0.dist-info/METADATA +205 -0
  144. mcp_proxy_adapter-6.1.0.dist-info/RECORD +193 -0
  145. mcp_proxy_adapter-6.1.0.dist-info/entry_points.txt +2 -0
  146. {mcp_proxy_adapter-6.0.0.dist-info → mcp_proxy_adapter-6.1.0.dist-info}/licenses/LICENSE +2 -2
  147. mcp_proxy_adapter/api/middleware/auth.py +0 -146
  148. mcp_proxy_adapter/api/middleware/auth_adapter.py +0 -235
  149. mcp_proxy_adapter/api/middleware/mtls_adapter.py +0 -305
  150. mcp_proxy_adapter/api/middleware/mtls_middleware.py +0 -296
  151. mcp_proxy_adapter/api/middleware/rate_limit.py +0 -152
  152. mcp_proxy_adapter/api/middleware/rate_limit_adapter.py +0 -241
  153. mcp_proxy_adapter/api/middleware/roles_adapter.py +0 -365
  154. mcp_proxy_adapter/api/middleware/roles_middleware.py +0 -381
  155. mcp_proxy_adapter/api/middleware/security.py +0 -376
  156. mcp_proxy_adapter/api/middleware/token_auth_middleware.py +0 -261
  157. mcp_proxy_adapter/examples/__init__.py +0 -7
  158. mcp_proxy_adapter/examples/basic_server/README.md +0 -60
  159. mcp_proxy_adapter/examples/basic_server/__init__.py +0 -7
  160. mcp_proxy_adapter/examples/basic_server/basic_custom_settings.json +0 -39
  161. mcp_proxy_adapter/examples/basic_server/config.json +0 -70
  162. mcp_proxy_adapter/examples/basic_server/config_all_protocols.json +0 -54
  163. mcp_proxy_adapter/examples/basic_server/config_http.json +0 -70
  164. mcp_proxy_adapter/examples/basic_server/config_http_only.json +0 -52
  165. mcp_proxy_adapter/examples/basic_server/config_https.json +0 -58
  166. mcp_proxy_adapter/examples/basic_server/config_mtls.json +0 -58
  167. mcp_proxy_adapter/examples/basic_server/config_ssl.json +0 -46
  168. mcp_proxy_adapter/examples/basic_server/custom_settings_example.py +0 -238
  169. mcp_proxy_adapter/examples/basic_server/server.py +0 -114
  170. mcp_proxy_adapter/examples/custom_commands/README.md +0 -127
  171. mcp_proxy_adapter/examples/custom_commands/__init__.py +0 -27
  172. mcp_proxy_adapter/examples/custom_commands/advanced_hooks.py +0 -566
  173. mcp_proxy_adapter/examples/custom_commands/auto_commands/__init__.py +0 -6
  174. mcp_proxy_adapter/examples/custom_commands/auto_commands/auto_echo_command.py +0 -103
  175. mcp_proxy_adapter/examples/custom_commands/auto_commands/auto_info_command.py +0 -111
  176. mcp_proxy_adapter/examples/custom_commands/auto_commands/test_command.py +0 -105
  177. mcp_proxy_adapter/examples/custom_commands/catalog/commands/test_command.py +0 -129
  178. mcp_proxy_adapter/examples/custom_commands/config.json +0 -118
  179. mcp_proxy_adapter/examples/custom_commands/config_all_protocols.json +0 -46
  180. mcp_proxy_adapter/examples/custom_commands/config_https_only.json +0 -46
  181. mcp_proxy_adapter/examples/custom_commands/config_https_transport.json +0 -33
  182. mcp_proxy_adapter/examples/custom_commands/config_mtls_only.json +0 -46
  183. mcp_proxy_adapter/examples/custom_commands/config_mtls_transport.json +0 -33
  184. mcp_proxy_adapter/examples/custom_commands/config_single_transport.json +0 -33
  185. mcp_proxy_adapter/examples/custom_commands/custom_health_command.py +0 -169
  186. mcp_proxy_adapter/examples/custom_commands/custom_help_command.py +0 -215
  187. mcp_proxy_adapter/examples/custom_commands/custom_openapi_generator.py +0 -76
  188. mcp_proxy_adapter/examples/custom_commands/custom_settings.json +0 -96
  189. mcp_proxy_adapter/examples/custom_commands/custom_settings_manager.py +0 -241
  190. mcp_proxy_adapter/examples/custom_commands/data_transform_command.py +0 -135
  191. mcp_proxy_adapter/examples/custom_commands/echo_command.py +0 -122
  192. mcp_proxy_adapter/examples/custom_commands/full_help_response.json +0 -1
  193. mcp_proxy_adapter/examples/custom_commands/generated_openapi.json +0 -629
  194. mcp_proxy_adapter/examples/custom_commands/get_openapi.py +0 -103
  195. mcp_proxy_adapter/examples/custom_commands/hooks.py +0 -230
  196. mcp_proxy_adapter/examples/custom_commands/intercept_command.py +0 -123
  197. mcp_proxy_adapter/examples/custom_commands/loadable_commands/test_ignored.py +0 -129
  198. mcp_proxy_adapter/examples/custom_commands/manual_echo_command.py +0 -103
  199. mcp_proxy_adapter/examples/custom_commands/proxy_connection_manager.py +0 -278
  200. mcp_proxy_adapter/examples/custom_commands/server.py +0 -252
  201. mcp_proxy_adapter/examples/custom_commands/simple_openapi_server.py +0 -75
  202. mcp_proxy_adapter/examples/custom_commands/start_server_with_proxy_manager.py +0 -299
  203. mcp_proxy_adapter/examples/custom_commands/start_server_with_registration.py +0 -278
  204. mcp_proxy_adapter/examples/custom_commands/test_hooks.py +0 -176
  205. mcp_proxy_adapter/examples/custom_commands/test_openapi.py +0 -27
  206. mcp_proxy_adapter/examples/custom_commands/test_registry.py +0 -23
  207. mcp_proxy_adapter/examples/custom_commands/test_simple.py +0 -19
  208. mcp_proxy_adapter/examples/custom_project_example/README.md +0 -103
  209. mcp_proxy_adapter/examples/custom_project_example/README_EN.md +0 -103
  210. mcp_proxy_adapter/examples/deployment/README.md +0 -49
  211. mcp_proxy_adapter/examples/deployment/__init__.py +0 -7
  212. mcp_proxy_adapter/examples/deployment/config.development.json +0 -8
  213. mcp_proxy_adapter/examples/deployment/config.json +0 -29
  214. mcp_proxy_adapter/examples/deployment/config.production.json +0 -12
  215. mcp_proxy_adapter/examples/deployment/config.staging.json +0 -11
  216. mcp_proxy_adapter/examples/deployment/docker-compose.yml +0 -31
  217. mcp_proxy_adapter/examples/deployment/run.sh +0 -43
  218. mcp_proxy_adapter/examples/deployment/run_docker.sh +0 -84
  219. mcp_proxy_adapter/examples/simple_custom_commands/README.md +0 -149
  220. mcp_proxy_adapter/examples/simple_custom_commands/README_EN.md +0 -149
  221. mcp_proxy_adapter/schemas/base_schema.json +0 -114
  222. mcp_proxy_adapter/schemas/openapi_schema.json +0 -314
  223. mcp_proxy_adapter/schemas/roles_schema.json +0 -162
  224. mcp_proxy_adapter/tests/__init__.py +0 -0
  225. mcp_proxy_adapter/tests/api/__init__.py +0 -3
  226. mcp_proxy_adapter/tests/api/test_cmd_endpoint.py +0 -115
  227. mcp_proxy_adapter/tests/api/test_custom_openapi.py +0 -617
  228. mcp_proxy_adapter/tests/api/test_handlers.py +0 -522
  229. mcp_proxy_adapter/tests/api/test_middleware.py +0 -340
  230. mcp_proxy_adapter/tests/api/test_schemas.py +0 -546
  231. mcp_proxy_adapter/tests/api/test_tool_integration.py +0 -531
  232. mcp_proxy_adapter/tests/commands/__init__.py +0 -3
  233. mcp_proxy_adapter/tests/commands/test_config_command.py +0 -211
  234. mcp_proxy_adapter/tests/commands/test_echo_command.py +0 -127
  235. mcp_proxy_adapter/tests/commands/test_help_command.py +0 -136
  236. mcp_proxy_adapter/tests/conftest.py +0 -131
  237. mcp_proxy_adapter/tests/functional/__init__.py +0 -3
  238. mcp_proxy_adapter/tests/functional/test_api.py +0 -253
  239. mcp_proxy_adapter/tests/integration/__init__.py +0 -3
  240. mcp_proxy_adapter/tests/integration/test_cmd_integration.py +0 -129
  241. mcp_proxy_adapter/tests/integration/test_integration.py +0 -255
  242. mcp_proxy_adapter/tests/performance/__init__.py +0 -3
  243. mcp_proxy_adapter/tests/performance/test_performance.py +0 -189
  244. mcp_proxy_adapter/tests/stubs/__init__.py +0 -10
  245. mcp_proxy_adapter/tests/stubs/echo_command.py +0 -104
  246. mcp_proxy_adapter/tests/test_api_endpoints.py +0 -271
  247. mcp_proxy_adapter/tests/test_api_handlers.py +0 -289
  248. mcp_proxy_adapter/tests/test_base_command.py +0 -123
  249. mcp_proxy_adapter/tests/test_batch_requests.py +0 -117
  250. mcp_proxy_adapter/tests/test_command_registry.py +0 -281
  251. mcp_proxy_adapter/tests/test_config.py +0 -127
  252. mcp_proxy_adapter/tests/test_utils.py +0 -65
  253. mcp_proxy_adapter/tests/unit/__init__.py +0 -3
  254. mcp_proxy_adapter/tests/unit/test_base_command.py +0 -436
  255. mcp_proxy_adapter/tests/unit/test_config.py +0 -270
  256. mcp_proxy_adapter-6.0.0.dist-info/METADATA +0 -201
  257. mcp_proxy_adapter-6.0.0.dist-info/RECORD +0 -179
  258. {mcp_proxy_adapter-6.0.0.dist-info → mcp_proxy_adapter-6.1.0.dist-info}/WHEEL +0 -0
  259. {mcp_proxy_adapter-6.0.0.dist-info → mcp_proxy_adapter-6.1.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,231 @@
1
+ {
2
+ "server": {
3
+ "host": "0.0.0.0",
4
+ "port": 8444,
5
+ "debug": false,
6
+ "log_level": "INFO",
7
+ "workers": 1,
8
+ "reload": false
9
+ },
10
+ "ssl": {
11
+ "enabled": true,
12
+ "cert_file": "./mcp_proxy_adapter/examples/certs/server_cert.pem",
13
+ "key_file": "./mcp_proxy_adapter/examples/certs/server_key.pem",
14
+ "ca_cert": "./mcp_proxy_adapter/examples/certs/ca_cert.pem",
15
+ "verify_client": false,
16
+ "client_cert_required": false,
17
+ "cipher_suites": ["TLS_AES_256_GCM_SHA384", "TLS_CHACHA20_POLY1305_SHA256"],
18
+ "min_tls_version": "TLSv1.2",
19
+ "max_tls_version": "1.3"
20
+ },
21
+ "security": {
22
+ "framework": "mcp_security_framework",
23
+ "enabled": true,
24
+ "debug": false,
25
+ "environment": "test",
26
+ "version": "1.0.0",
27
+
28
+ "ssl": {
29
+ "enabled": true,
30
+ "cert_file": "./mcp_proxy_adapter/examples/certs/server_cert.pem",
31
+ "key_file": "./mcp_proxy_adapter/examples/certs/server_key.pem",
32
+ "ca_cert_file": "./mcp_proxy_adapter/examples/certs/ca_cert.pem",
33
+ "client_cert_file": null,
34
+ "client_key_file": null,
35
+ "verify_mode": "CERT_NONE",
36
+ "min_tls_version": "TLSv1.2",
37
+ "max_tls_version": null,
38
+ "cipher_suite": null,
39
+ "check_hostname": false,
40
+ "check_expiry": true,
41
+ "expiry_warning_days": 30
42
+ },
43
+
44
+ "auth": {
45
+ "enabled": true,
46
+ "methods": ["api_key"],
47
+ "api_keys": {
48
+ "test-token-123": {
49
+ "roles": ["admin"],
50
+ "permissions": ["*"],
51
+ "expires": null
52
+ },
53
+ "user-token-456": {
54
+ "roles": ["user"],
55
+ "permissions": ["read", "execute"],
56
+ "expires": null
57
+ },
58
+ "readonly-token-123": {
59
+ "roles": ["readonly"],
60
+ "permissions": ["read"],
61
+ "expires": null
62
+ }
63
+ },
64
+ "user_roles": {},
65
+ "jwt_secret": null,
66
+ "jwt_algorithm": "HS256",
67
+ "jwt_expiry_hours": 24,
68
+ "certificate_auth": false,
69
+ "certificate_roles_oid": "1.3.6.1.4.1.99999.1.1",
70
+ "certificate_permissions_oid": "1.3.6.1.4.1.99999.1.2",
71
+ "basic_auth": false,
72
+ "oauth2_config": null,
73
+ "public_paths": ["/health", "/docs", "/openapi.json"],
74
+ "security_headers": {
75
+ "X-Content-Type-Options": "nosniff",
76
+ "X-Frame-Options": "DENY",
77
+ "X-XSS-Protection": "1; mode=block",
78
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains"
79
+ }
80
+ },
81
+
82
+ "certificates": {
83
+ "enabled": true,
84
+ "ca_cert_path": "./mcp_proxy_adapter/examples/certs/ca_cert.pem",
85
+ "ca_key_path": "./mcp_proxy_adapter/examples/keys/mcp_proxy_adapter_ca_ca.key",
86
+ "cert_storage_path": "./mcp_proxy_adapter/examples/certs",
87
+ "key_storage_path": "./mcp_proxy_adapter/examples/keys",
88
+ "default_validity_days": 365,
89
+ "key_size": 2048,
90
+ "hash_algorithm": "sha256",
91
+ "crl_enabled": false,
92
+ "crl_path": null,
93
+ "crl_validity_days": 30,
94
+ "auto_renewal": false,
95
+ "renewal_threshold_days": 30
96
+ },
97
+
98
+ "permissions": {
99
+ "enabled": true,
100
+ "roles_file": "./server_configs/roles.json",
101
+ "default_role": "guest",
102
+ "admin_role": "admin",
103
+ "role_hierarchy": {},
104
+ "permission_cache_enabled": false,
105
+ "permission_cache_ttl": 300,
106
+ "wildcard_permissions": false,
107
+ "strict_mode": false,
108
+ "roles": {}
109
+ },
110
+
111
+ "rate_limit": {
112
+ "enabled": false,
113
+ "default_requests_per_minute": 60,
114
+ "default_requests_per_hour": 1000,
115
+ "burst_limit": 2,
116
+ "window_size_seconds": 60,
117
+ "storage_backend": "memory",
118
+ "redis_config": null,
119
+ "cleanup_interval": 300,
120
+ "exempt_paths": ["/health", "/docs", "/openapi.json"],
121
+ "exempt_roles": ["admin"]
122
+ },
123
+
124
+ "logging": {
125
+ "enabled": true,
126
+ "level": "INFO",
127
+ "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
128
+ "date_format": "%Y-%m-%d %H:%M:%S",
129
+ "file_path": "./logs/security.log",
130
+ "max_file_size": 10,
131
+ "backup_count": 5,
132
+ "console_output": true,
133
+ "json_format": false,
134
+ "include_timestamp": true,
135
+ "include_level": true,
136
+ "include_module": true
137
+ }
138
+ },
139
+
140
+ "registration": {
141
+ "enabled": false,
142
+ "server_url": null,
143
+ "auth_method": "none",
144
+ "certificate": {
145
+ "enabled": false,
146
+ "cert_file": null,
147
+ "key_file": null,
148
+ "ca_cert_file": null,
149
+ "verify_server": false
150
+ },
151
+ "token": {
152
+ "enabled": false,
153
+ "token": null,
154
+ "token_type": "bearer",
155
+ "refresh_interval": 3600
156
+ },
157
+ "api_key": {
158
+ "enabled": false,
159
+ "key": null,
160
+ "key_header": "X-Proxy-API-Key"
161
+ },
162
+ "proxy_info": {
163
+ "name": "mcp_proxy_adapter",
164
+ "version": "1.0.0",
165
+ "description": "MCP Proxy Adapter - HTTPS + Token",
166
+ "capabilities": ["jsonrpc", "rest", "ssl", "auth"],
167
+ "endpoints": {
168
+ "jsonrpc": "/api/jsonrpc",
169
+ "rest": "/cmd",
170
+ "health": "/health"
171
+ }
172
+ },
173
+ "heartbeat": {
174
+ "enabled": false,
175
+ "interval": 300,
176
+ "timeout": 30,
177
+ "retry_attempts": 3,
178
+ "retry_delay": 60
179
+ },
180
+ "auto_discovery": {
181
+ "enabled": false,
182
+ "discovery_urls": [],
183
+ "discovery_interval": 3600,
184
+ "register_on_discovery": false
185
+ }
186
+ },
187
+
188
+ "logging": {
189
+ "level": "INFO",
190
+ "console_output": true,
191
+ "file_output": true,
192
+ "file_path": "./logs/server.log",
193
+ "max_file_size": 10,
194
+ "backup_count": 5,
195
+ "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
196
+ },
197
+
198
+ "commands": {
199
+ "auto_discovery": true,
200
+ "commands_directory": "./commands",
201
+ "builtin_commands": ["echo", "health", "config"],
202
+ "custom_commands": [],
203
+ "command_timeout": 30
204
+ },
205
+
206
+ "hooks": {
207
+ "enabled": true,
208
+ "application_hooks": {
209
+ "on_startup": [],
210
+ "on_shutdown": [],
211
+ "before_request": [],
212
+ "after_request": [],
213
+ "on_error": []
214
+ },
215
+ "command_hooks": {
216
+ "before_echo_command": [],
217
+ "after_echo_command": [],
218
+ "before_health_command": [],
219
+ "after_health_command": [],
220
+ "before_config_command": [],
221
+ "after_config_command": []
222
+ }
223
+ },
224
+
225
+ "protocols": {
226
+ "enabled": true,
227
+ "allowed_protocols": ["http", "https"],
228
+ "default_protocol": "https",
229
+ "strict_mode": false
230
+ }
231
+ }
@@ -0,0 +1,215 @@
1
+ {
2
+ "server": {
3
+ "host": "0.0.0.0",
4
+ "port": 8445,
5
+ "debug": false,
6
+ "log_level": "INFO",
7
+ "workers": 1,
8
+ "reload": false
9
+ },
10
+ "ssl": {
11
+ "enabled": true,
12
+ "cert_file": "./certs/server_cert.pem",
13
+ "key_file": "./certs/server_key.pem",
14
+ "ca_cert": "./certs/ca_cert.pem",
15
+ "verify_client": true,
16
+ "client_cert_required": true,
17
+ "cipher_suites": ["TLS_AES_256_GCM_SHA384", "TLS_CHACHA20_POLY1305_SHA256"],
18
+ "min_tls_version": "TLSv1.2",
19
+ "max_tls_version": "1.3"
20
+ },
21
+ "security": {
22
+ "framework": "mcp_security_framework",
23
+ "enabled": true,
24
+ "debug": false,
25
+ "environment": "test",
26
+ "version": "1.0.0",
27
+
28
+ "ssl": {
29
+ "enabled": true,
30
+ "cert_file": "./certs/server_cert.pem",
31
+ "key_file": "./certs/server_key.pem",
32
+ "ca_cert_file": "./certs/ca_cert.pem",
33
+ "client_cert_file": "./certs/user_cert.pem",
34
+ "client_key_file": "./certs/user_key.pem",
35
+ "verify_mode": "CERT_REQUIRED",
36
+ "min_tls_version": "TLSv1.2",
37
+ "max_tls_version": null,
38
+ "cipher_suite": null,
39
+ "check_hostname": false,
40
+ "check_expiry": true,
41
+ "expiry_warning_days": 30
42
+ },
43
+
44
+ "auth": {
45
+ "enabled": true,
46
+ "methods": ["certificate"],
47
+ "api_keys": {},
48
+ "user_roles": {},
49
+ "jwt_secret": null,
50
+ "jwt_algorithm": "HS256",
51
+ "jwt_expiry_hours": 24,
52
+ "certificate_auth": true,
53
+ "certificate_roles_oid": "1.3.6.1.4.1.99999.1.1",
54
+ "certificate_permissions_oid": "1.3.6.1.4.1.99999.1.2",
55
+ "basic_auth": false,
56
+ "oauth2_config": null,
57
+ "public_paths": ["/health", "/docs", "/openapi.json"],
58
+ "security_headers": {
59
+ "X-Content-Type-Options": "nosniff",
60
+ "X-Frame-Options": "DENY",
61
+ "X-XSS-Protection": "1; mode=block",
62
+ "Strict-Transport-Security": "max-age=31536000; includeSubDomains"
63
+ }
64
+ },
65
+
66
+ "certificates": {
67
+ "enabled": true,
68
+ "ca_cert_path": "./certs/ca_cert.pem",
69
+ "ca_key_path": "./keys/ca_key.pem",
70
+ "cert_storage_path": "./certs",
71
+ "key_storage_path": "./keys",
72
+ "default_validity_days": 365,
73
+ "key_size": 2048,
74
+ "hash_algorithm": "sha256",
75
+ "crl_enabled": false,
76
+ "crl_path": null,
77
+ "crl_validity_days": 30,
78
+ "auto_renewal": false,
79
+ "renewal_threshold_days": 30
80
+ },
81
+
82
+ "permissions": {
83
+ "enabled": true,
84
+ "roles_file": "./server_configs/roles.json",
85
+ "default_role": "guest",
86
+ "admin_role": "admin",
87
+ "role_hierarchy": {},
88
+ "permission_cache_enabled": false,
89
+ "permission_cache_ttl": 300,
90
+ "wildcard_permissions": false,
91
+ "strict_mode": false,
92
+ "roles": {}
93
+ },
94
+
95
+ "rate_limit": {
96
+ "enabled": false,
97
+ "default_requests_per_minute": 60,
98
+ "default_requests_per_hour": 1000,
99
+ "burst_limit": 2,
100
+ "window_size_seconds": 60,
101
+ "storage_backend": "memory",
102
+ "redis_config": null,
103
+ "cleanup_interval": 300,
104
+ "exempt_paths": ["/health", "/docs", "/openapi.json"],
105
+ "exempt_roles": ["admin"]
106
+ },
107
+
108
+ "logging": {
109
+ "enabled": true,
110
+ "level": "INFO",
111
+ "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
112
+ "date_format": "%Y-%m-%d %H:%M:%S",
113
+ "file_path": "./logs/security.log",
114
+ "max_file_size": 10,
115
+ "backup_count": 5,
116
+ "console_output": true,
117
+ "json_format": false,
118
+ "include_timestamp": true,
119
+ "include_level": true,
120
+ "include_module": true
121
+ }
122
+ },
123
+
124
+ "registration": {
125
+ "enabled": false,
126
+ "server_url": null,
127
+ "auth_method": "none",
128
+ "certificate": {
129
+ "enabled": false,
130
+ "cert_file": null,
131
+ "key_file": null,
132
+ "ca_cert_file": null,
133
+ "verify_server": false
134
+ },
135
+ "token": {
136
+ "enabled": false,
137
+ "token": null,
138
+ "token_type": "bearer",
139
+ "refresh_interval": 3600
140
+ },
141
+ "api_key": {
142
+ "enabled": false,
143
+ "key": null,
144
+ "key_header": "X-Proxy-API-Key"
145
+ },
146
+ "proxy_info": {
147
+ "name": "mcp_proxy_adapter",
148
+ "version": "1.0.0",
149
+ "description": "MCP Proxy Adapter - mTLS",
150
+ "capabilities": ["jsonrpc", "rest", "ssl", "mtls", "cert_auth"],
151
+ "endpoints": {
152
+ "jsonrpc": "/api/jsonrpc",
153
+ "rest": "/cmd",
154
+ "health": "/health"
155
+ }
156
+ },
157
+ "heartbeat": {
158
+ "enabled": false,
159
+ "interval": 300,
160
+ "timeout": 30,
161
+ "retry_attempts": 3,
162
+ "retry_delay": 60
163
+ },
164
+ "auto_discovery": {
165
+ "enabled": false,
166
+ "discovery_urls": [],
167
+ "discovery_interval": 3600,
168
+ "register_on_discovery": false
169
+ }
170
+ },
171
+
172
+ "logging": {
173
+ "level": "INFO",
174
+ "console_output": true,
175
+ "file_output": true,
176
+ "file_path": "./logs/server.log",
177
+ "max_file_size": 10,
178
+ "backup_count": 5,
179
+ "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
180
+ },
181
+
182
+ "commands": {
183
+ "auto_discovery": true,
184
+ "commands_directory": "./commands",
185
+ "builtin_commands": ["echo", "health", "config"],
186
+ "custom_commands": [],
187
+ "command_timeout": 30
188
+ },
189
+
190
+ "hooks": {
191
+ "enabled": true,
192
+ "application_hooks": {
193
+ "on_startup": [],
194
+ "on_shutdown": [],
195
+ "before_request": [],
196
+ "after_request": [],
197
+ "on_error": []
198
+ },
199
+ "command_hooks": {
200
+ "before_echo_command": [],
201
+ "after_echo_command": [],
202
+ "before_health_command": [],
203
+ "after_health_command": [],
204
+ "before_config_command": [],
205
+ "after_config_command": []
206
+ }
207
+ },
208
+
209
+ "protocols": {
210
+ "enabled": true,
211
+ "allowed_protocols": ["http", "https"],
212
+ "default_protocol": "https",
213
+ "strict_mode": false
214
+ }
215
+ }
@@ -0,0 +1,250 @@
1
+ {
2
+ "server": {
3
+ "host": "0.0.0.0",
4
+ "port": 8002,
5
+ "debug": false,
6
+ "workers": 1
7
+ },
8
+
9
+ "security": {
10
+ "framework": "mcp_security_framework",
11
+ "enabled": true,
12
+ "debug": false,
13
+ "environment": "dev",
14
+ "version": "1.0.0",
15
+
16
+ "auth": {
17
+ "enabled": true,
18
+ "methods": ["api_key"],
19
+ "api_keys": {
20
+ "test-token-123": {
21
+ "roles": ["admin"],
22
+ "permissions": ["*", "register", "heartbeat", "discover", "unregister"],
23
+ "expires": null
24
+ },
25
+ "user-token-456": {
26
+ "roles": ["user"],
27
+ "permissions": ["read", "execute", "register", "heartbeat", "discover"],
28
+ "expires": null
29
+ },
30
+ "readonly-token-123": {
31
+ "roles": ["readonly"],
32
+ "permissions": ["read", "discover"],
33
+ "expires": null
34
+ }
35
+ },
36
+ "user_roles": {
37
+ "admin": ["admin"],
38
+ "user": ["user"],
39
+ "readonly": ["readonly"],
40
+ "test": ["user"]
41
+ },
42
+ "jwt_secret": "test-jwt-secret-key-change-in-production",
43
+ "jwt_algorithm": "HS256",
44
+ "jwt_expiry_hours": 24,
45
+ "certificate_auth": false,
46
+ "certificate_roles_oid": "1.3.6.1.4.1.99999.1.1",
47
+ "certificate_permissions_oid": "1.3.6.1.4.1.99999.1.2",
48
+ "basic_auth": false,
49
+ "oauth2_config": null,
50
+ "public_paths": ["/health", "/docs", "/openapi.json"],
51
+ "security_headers": {
52
+ "X-Content-Type-Options": "nosniff",
53
+ "X-Frame-Options": "DENY",
54
+ "X-XSS-Protection": "1; mode=block"
55
+ }
56
+ },
57
+
58
+ "ssl": {
59
+ "enabled": false,
60
+ "cert_file": null,
61
+ "key_file": null,
62
+ "ca_cert_file": null,
63
+ "client_cert_file": null,
64
+ "client_key_file": null,
65
+ "verify_mode": "CERT_NONE",
66
+ "min_tls_version": "TLSv1.2",
67
+ "max_tls_version": null,
68
+ "cipher_suite": null,
69
+ "check_hostname": true,
70
+ "check_expiry": true,
71
+ "expiry_warning_days": 30
72
+ },
73
+
74
+ "certificates": {
75
+ "enabled": false,
76
+ "ca_cert_path": null,
77
+ "ca_key_path": null,
78
+ "cert_storage_path": "./certs",
79
+ "key_storage_path": "./keys",
80
+ "default_validity_days": 365,
81
+ "key_size": 2048,
82
+ "hash_algorithm": "sha256",
83
+ "crl_enabled": false,
84
+ "crl_path": null,
85
+ "crl_validity_days": 30,
86
+ "auto_renewal": false,
87
+ "renewal_threshold_days": 30
88
+ },
89
+
90
+ "permissions": {
91
+ "enabled": true,
92
+ "roles_file": "./server_configs/roles.json",
93
+ "default_role": "guest",
94
+ "admin_role": "admin",
95
+ "role_hierarchy": {
96
+ "admin": ["user", "readonly", "guest"],
97
+ "user": ["readonly", "guest"],
98
+ "readonly": ["guest"]
99
+ },
100
+ "permission_cache_enabled": true,
101
+ "permission_cache_ttl": 300,
102
+ "wildcard_permissions": false,
103
+ "strict_mode": true,
104
+ "roles": {
105
+ "admin": ["*"],
106
+ "user": ["read", "write"],
107
+ "readonly": ["read"],
108
+ "guest": ["read"]
109
+ }
110
+ },
111
+
112
+ "rate_limit": {
113
+ "enabled": true,
114
+ "default_requests_per_minute": 60,
115
+ "default_requests_per_hour": 1000,
116
+ "burst_limit": 2,
117
+ "window_size_seconds": 60,
118
+ "storage_backend": "memory",
119
+ "redis_config": null,
120
+ "cleanup_interval": 300,
121
+ "exempt_paths": ["/health", "/docs", "/openapi.json"],
122
+ "exempt_roles": ["admin"]
123
+ },
124
+
125
+ "logging": {
126
+ "enabled": true,
127
+ "level": "INFO",
128
+ "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
129
+ "date_format": "%Y-%m-%d %H:%M:%S",
130
+ "file_path": "./logs/security.log",
131
+ "max_file_size": 10,
132
+ "backup_count": 5,
133
+ "console_output": true,
134
+ "json_format": false,
135
+ "include_timestamp": true,
136
+ "include_level": true,
137
+ "include_module": true
138
+ }
139
+ },
140
+
141
+ "registration": {
142
+ "enabled": true,
143
+ "server_url": "https://proxy-registry.example.com",
144
+ "auth_method": "api_key",
145
+
146
+ "certificate": {
147
+ "enabled": false,
148
+ "cert_file": "./certs/client_cert.pem",
149
+ "key_file": "./keys/client_key.pem",
150
+ "ca_cert_file": "./certs/ca_cert.pem",
151
+ "verify_server": true
152
+ },
153
+
154
+ "token": {
155
+ "enabled": false,
156
+ "token": "proxy-registration-token-123",
157
+ "token_type": "bearer",
158
+ "refresh_interval": 3600
159
+ },
160
+
161
+ "api_key": {
162
+ "enabled": true,
163
+ "key": "proxy-api-key-456",
164
+ "key_header": "X-Proxy-API-Key"
165
+ },
166
+
167
+ "proxy_info": {
168
+ "name": "mcp_proxy_adapter",
169
+ "version": "1.0.0",
170
+ "description": "MCP Proxy Adapter - Proxy Registration Example",
171
+ "capabilities": ["jsonrpc", "rest", "security", "proxy_registration"],
172
+ "endpoints": {
173
+ "jsonrpc": "/api/jsonrpc",
174
+ "rest": "/cmd",
175
+ "health": "/health",
176
+ "registration": "/register"
177
+ }
178
+ },
179
+
180
+ "heartbeat": {
181
+ "enabled": true,
182
+ "interval": 300,
183
+ "timeout": 30,
184
+ "retry_attempts": 3,
185
+ "retry_delay": 60
186
+ },
187
+
188
+ "auto_discovery": {
189
+ "enabled": true,
190
+ "discovery_urls": [
191
+ "https://proxy-registry.example.com/discover",
192
+ "https://backup-proxy.example.com/discover"
193
+ ],
194
+ "discovery_interval": 3600,
195
+ "register_on_discovery": true
196
+ },
197
+
198
+ "client_security": {
199
+ "enabled": true,
200
+ "ssl_enabled": true,
201
+ "auth_methods": ["api_key", "certificate", "token"],
202
+ "certificate_auth": {
203
+ "enabled": true,
204
+ "cert_file": "./certs/client_cert.pem",
205
+ "key_file": "./keys/client_key.pem",
206
+ "ca_cert_file": "./certs/ca_cert.pem"
207
+ },
208
+ "api_key_auth": {
209
+ "enabled": true,
210
+ "key": "proxy-api-key-456",
211
+ "header": "X-Proxy-API-Key"
212
+ },
213
+ "token_auth": {
214
+ "enabled": true,
215
+ "token": "proxy-registration-token-123",
216
+ "type": "bearer"
217
+ }
218
+ }
219
+ },
220
+
221
+ "logging": {
222
+ "level": "INFO",
223
+ "console_output": true,
224
+ "file_output": true,
225
+ "file_path": "./logs/server.log",
226
+ "max_file_size": 10,
227
+ "backup_count": 5,
228
+ "format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
229
+ },
230
+
231
+ "commands": {
232
+ "auto_discovery": true,
233
+ "commands_directory": "./commands",
234
+ "builtin_commands": ["echo", "health", "config", "roletest"],
235
+ "custom_commands": [],
236
+ "command_timeout": 30
237
+ },
238
+
239
+ "protocol": {
240
+ "jsonrpc": {
241
+ "enabled": true,
242
+ "version": "2.0",
243
+ "endpoint": "/api/jsonrpc"
244
+ },
245
+ "rest": {
246
+ "enabled": true,
247
+ "endpoint": "/cmd"
248
+ }
249
+ }
250
+ }