mcp-proxy-adapter 6.1.1__py3-none-any.whl → 6.2.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 (145) hide show
  1. mcp_proxy_adapter/__main__.py +27 -7
  2. mcp_proxy_adapter/api/app.py +18 -7
  3. mcp_proxy_adapter/commands/ssl_setup_command.py +234 -351
  4. mcp_proxy_adapter/core/app_factory.py +87 -3
  5. mcp_proxy_adapter/core/app_runner.py +272 -0
  6. mcp_proxy_adapter/core/certificate_utils.py +291 -73
  7. mcp_proxy_adapter/core/client.py +574 -0
  8. mcp_proxy_adapter/core/client_manager.py +284 -0
  9. mcp_proxy_adapter/core/server_adapter.py +17 -80
  10. mcp_proxy_adapter/core/server_engine.py +5 -99
  11. mcp_proxy_adapter/core/ssl_utils.py +13 -12
  12. mcp_proxy_adapter/core/transport_manager.py +5 -5
  13. mcp_proxy_adapter/examples/__init__.py +16 -0
  14. mcp_proxy_adapter/examples/basic_framework/__init__.py +7 -0
  15. mcp_proxy_adapter/examples/basic_framework/commands/__init__.py +4 -0
  16. mcp_proxy_adapter/examples/basic_framework/hooks/__init__.py +4 -0
  17. mcp_proxy_adapter/examples/basic_framework/main.py +21 -40
  18. mcp_proxy_adapter/examples/commands/__init__.py +5 -1
  19. mcp_proxy_adapter/examples/create_certificates_simple.py +260 -75
  20. mcp_proxy_adapter/examples/debug_request_state.py +4 -36
  21. mcp_proxy_adapter/examples/debug_role_chain.py +2 -49
  22. mcp_proxy_adapter/examples/demo_client.py +0 -66
  23. mcp_proxy_adapter/examples/full_application/__init__.py +11 -0
  24. mcp_proxy_adapter/examples/full_application/commands/__init__.py +7 -0
  25. mcp_proxy_adapter/examples/full_application/commands/custom_echo_command.py +0 -19
  26. mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.py +0 -16
  27. mcp_proxy_adapter/examples/full_application/hooks/__init__.py +7 -0
  28. mcp_proxy_adapter/examples/full_application/hooks/application_hooks.py +0 -22
  29. mcp_proxy_adapter/examples/full_application/hooks/builtin_command_hooks.py +0 -24
  30. mcp_proxy_adapter/examples/full_application/main.py +65 -44
  31. mcp_proxy_adapter/examples/full_application/proxy_endpoints.py +154 -0
  32. mcp_proxy_adapter/examples/generate_all_certificates.py +0 -67
  33. mcp_proxy_adapter/examples/generate_certificates.py +0 -15
  34. mcp_proxy_adapter/examples/generate_certificates_and_tokens.py +369 -0
  35. mcp_proxy_adapter/examples/generate_test_configs.py +204 -0
  36. mcp_proxy_adapter/examples/proxy_registration_example.py +3 -70
  37. mcp_proxy_adapter/examples/run_example.py +1 -23
  38. mcp_proxy_adapter/examples/run_security_tests.py +2 -60
  39. mcp_proxy_adapter/examples/run_security_tests_fixed.py +0 -53
  40. mcp_proxy_adapter/examples/security_test_client.py +18 -123
  41. mcp_proxy_adapter/examples/setup_test_environment.py +179 -0
  42. mcp_proxy_adapter/examples/test_config.py +148 -0
  43. mcp_proxy_adapter/examples/test_config_generator.py +1 -25
  44. mcp_proxy_adapter/examples/test_examples.py +4 -67
  45. mcp_proxy_adapter/examples/universal_client.py +154 -162
  46. mcp_proxy_adapter/main.py +51 -161
  47. mcp_proxy_adapter/version.py +1 -1
  48. mcp_proxy_adapter-6.2.0.dist-info/METADATA +687 -0
  49. mcp_proxy_adapter-6.2.0.dist-info/RECORD +122 -0
  50. mcp_proxy_adapter/docs/EN/TROUBLESHOOTING.md +0 -285
  51. mcp_proxy_adapter/docs/RU/TROUBLESHOOTING.md +0 -285
  52. mcp_proxy_adapter/examples/README.md +0 -257
  53. mcp_proxy_adapter/examples/README_EN.md +0 -258
  54. mcp_proxy_adapter/examples/SECURITY_TESTING.md +0 -455
  55. mcp_proxy_adapter/examples/basic_framework/configs/http_auth.json +0 -37
  56. mcp_proxy_adapter/examples/basic_framework/configs/http_simple.json +0 -23
  57. mcp_proxy_adapter/examples/basic_framework/configs/https_auth.json +0 -43
  58. mcp_proxy_adapter/examples/basic_framework/configs/https_no_protocol_middleware.json +0 -36
  59. mcp_proxy_adapter/examples/basic_framework/configs/https_simple.json +0 -29
  60. mcp_proxy_adapter/examples/basic_framework/configs/mtls_no_protocol_middleware.json +0 -34
  61. mcp_proxy_adapter/examples/basic_framework/configs/mtls_no_roles.json +0 -39
  62. mcp_proxy_adapter/examples/basic_framework/configs/mtls_simple.json +0 -35
  63. mcp_proxy_adapter/examples/basic_framework/configs/mtls_with_roles.json +0 -45
  64. mcp_proxy_adapter/examples/basic_framework/roles.json +0 -21
  65. mcp_proxy_adapter/examples/cert_config.json +0 -9
  66. mcp_proxy_adapter/examples/certs/admin.crt +0 -32
  67. mcp_proxy_adapter/examples/certs/admin.key +0 -52
  68. mcp_proxy_adapter/examples/certs/admin_cert.pem +0 -21
  69. mcp_proxy_adapter/examples/certs/admin_key.pem +0 -28
  70. mcp_proxy_adapter/examples/certs/ca_cert.pem +0 -23
  71. mcp_proxy_adapter/examples/certs/ca_cert.srl +0 -1
  72. mcp_proxy_adapter/examples/certs/ca_key.pem +0 -28
  73. mcp_proxy_adapter/examples/certs/cert_config.json +0 -9
  74. mcp_proxy_adapter/examples/certs/client.crt +0 -32
  75. mcp_proxy_adapter/examples/certs/client.key +0 -52
  76. mcp_proxy_adapter/examples/certs/client_admin.crt +0 -32
  77. mcp_proxy_adapter/examples/certs/client_admin.key +0 -52
  78. mcp_proxy_adapter/examples/certs/client_user.crt +0 -32
  79. mcp_proxy_adapter/examples/certs/client_user.key +0 -52
  80. mcp_proxy_adapter/examples/certs/guest_cert.pem +0 -21
  81. mcp_proxy_adapter/examples/certs/guest_key.pem +0 -28
  82. mcp_proxy_adapter/examples/certs/mcp_proxy_adapter_ca_ca.crt +0 -23
  83. mcp_proxy_adapter/examples/certs/proxy_cert.pem +0 -21
  84. mcp_proxy_adapter/examples/certs/proxy_key.pem +0 -28
  85. mcp_proxy_adapter/examples/certs/readonly.crt +0 -32
  86. mcp_proxy_adapter/examples/certs/readonly.key +0 -52
  87. mcp_proxy_adapter/examples/certs/readonly_cert.pem +0 -21
  88. mcp_proxy_adapter/examples/certs/readonly_key.pem +0 -28
  89. mcp_proxy_adapter/examples/certs/server.crt +0 -32
  90. mcp_proxy_adapter/examples/certs/server.key +0 -52
  91. mcp_proxy_adapter/examples/certs/server_cert.pem +0 -32
  92. mcp_proxy_adapter/examples/certs/server_key.pem +0 -52
  93. mcp_proxy_adapter/examples/certs/test_ca_ca.crt +0 -20
  94. mcp_proxy_adapter/examples/certs/user.crt +0 -32
  95. mcp_proxy_adapter/examples/certs/user.key +0 -52
  96. mcp_proxy_adapter/examples/certs/user_cert.pem +0 -21
  97. mcp_proxy_adapter/examples/certs/user_key.pem +0 -28
  98. mcp_proxy_adapter/examples/client_configs/api_key_client.json +0 -13
  99. mcp_proxy_adapter/examples/client_configs/basic_auth_client.json +0 -13
  100. mcp_proxy_adapter/examples/client_configs/certificate_client.json +0 -22
  101. mcp_proxy_adapter/examples/client_configs/jwt_client.json +0 -15
  102. mcp_proxy_adapter/examples/client_configs/no_auth_client.json +0 -9
  103. mcp_proxy_adapter/examples/full_application/configs/http_auth.json +0 -37
  104. mcp_proxy_adapter/examples/full_application/configs/http_simple.json +0 -23
  105. mcp_proxy_adapter/examples/full_application/configs/https_auth.json +0 -39
  106. mcp_proxy_adapter/examples/full_application/configs/https_simple.json +0 -25
  107. mcp_proxy_adapter/examples/full_application/configs/mtls_no_roles.json +0 -39
  108. mcp_proxy_adapter/examples/full_application/configs/mtls_with_roles.json +0 -45
  109. mcp_proxy_adapter/examples/full_application/roles.json +0 -21
  110. mcp_proxy_adapter/examples/keys/ca_key.pem +0 -28
  111. mcp_proxy_adapter/examples/keys/mcp_proxy_adapter_ca_ca.key +0 -28
  112. mcp_proxy_adapter/examples/keys/test_ca_ca.key +0 -28
  113. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log +0 -220
  114. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.1 +0 -1
  115. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.2 +0 -1
  116. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.3 +0 -1
  117. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.4 +0 -1
  118. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter.log.5 +0 -1
  119. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log +0 -220
  120. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.1 +0 -1
  121. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.2 +0 -1
  122. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.3 +0 -1
  123. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.4 +0 -1
  124. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_access.log.5 +0 -1
  125. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log +0 -2
  126. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.1 +0 -1
  127. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.2 +0 -1
  128. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.3 +0 -1
  129. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.4 +0 -1
  130. mcp_proxy_adapter/examples/logs/mcp_proxy_adapter_error.log.5 +0 -1
  131. mcp_proxy_adapter/examples/roles.json +0 -38
  132. mcp_proxy_adapter/examples/server_configs/config_basic_http.json +0 -204
  133. mcp_proxy_adapter/examples/server_configs/config_http_token.json +0 -238
  134. mcp_proxy_adapter/examples/server_configs/config_https.json +0 -215
  135. mcp_proxy_adapter/examples/server_configs/config_https_token.json +0 -231
  136. mcp_proxy_adapter/examples/server_configs/config_mtls.json +0 -215
  137. mcp_proxy_adapter/examples/server_configs/config_proxy_registration.json +0 -250
  138. mcp_proxy_adapter/examples/server_configs/config_simple.json +0 -46
  139. mcp_proxy_adapter/examples/server_configs/roles.json +0 -38
  140. mcp_proxy_adapter-6.1.1.dist-info/METADATA +0 -205
  141. mcp_proxy_adapter-6.1.1.dist-info/RECORD +0 -197
  142. {mcp_proxy_adapter-6.1.1.dist-info → mcp_proxy_adapter-6.2.0.dist-info}/WHEEL +0 -0
  143. {mcp_proxy_adapter-6.1.1.dist-info → mcp_proxy_adapter-6.2.0.dist-info}/entry_points.txt +0 -0
  144. {mcp_proxy_adapter-6.1.1.dist-info → mcp_proxy_adapter-6.2.0.dist-info}/licenses/LICENSE +0 -0
  145. {mcp_proxy_adapter-6.1.1.dist-info → mcp_proxy_adapter-6.2.0.dist-info}/top_level.txt +0 -0
@@ -1,231 +0,0 @@
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
- }
@@ -1,215 +0,0 @@
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
- }
@@ -1,250 +0,0 @@
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
- }