mcp-proxy-adapter 6.9.30__py3-none-any.whl → 6.9.32__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mcp-proxy-adapter might be problematic. Click here for more details.

@@ -16,6 +16,7 @@ from fastapi import FastAPI
16
16
  from mcp_proxy_adapter.api.app import create_app
17
17
  from mcp_proxy_adapter.core.logging import setup_logging, get_global_logger
18
18
  from mcp_proxy_adapter.config import config
19
+
19
20
  # Built-in command registration is temporarily disabled in this startup path
20
21
 
21
22
  logger = get_global_logger()
@@ -72,9 +73,9 @@ async def create_and_run_server(
72
73
 
73
74
  try:
74
75
  from mcp_proxy_adapter.config import Config
75
- config = Config()
76
- config.load_from_file(str(config_file))
77
- app_config = config.get_all()
76
+
77
+ config_instance = Config(config_path=str(config_file))
78
+ app_config = config_instance.config_data
78
79
  print(f"✅ Configuration loaded from: {config_path}")
79
80
 
80
81
  # Validate UUID configuration (mandatory)
@@ -92,14 +93,10 @@ async def create_and_run_server(
92
93
  print("✅ Configuration validation passed")
93
94
 
94
95
  # Debug: Check what config.get_all() actually returns
95
- print(
96
- f"🔍 Debug: config.get_all() keys: {list(app_config.keys())}"
97
- )
96
+ print(f"🔍 Debug: config.get_all() keys: {list(app_config.keys())}")
98
97
  if "security" in app_config:
99
98
  security_ssl = app_config["security"].get("ssl", {})
100
- print(
101
- f"🔍 Debug: config.get_all() security.ssl: {security_ssl}"
102
- )
99
+ print(f"🔍 Debug: config.get_all() security.ssl: {security_ssl}")
103
100
 
104
101
  # Debug: Check if root ssl section exists after loading
105
102
  if "ssl" in app_config:
@@ -113,7 +110,7 @@ async def create_and_run_server(
113
110
  f"🔍 Debug: Root SSL section after loading: key_file={app_config['ssl'].get('key_file')}"
114
111
  )
115
112
  else:
116
- print(f"🔍 Debug: No root SSL section after loading")
113
+ print("🔍 Debug: No root SSL section after loading")
117
114
 
118
115
  # Debug: Check app_config immediately after get_all()
119
116
  if app_config and "ssl" in app_config:
@@ -131,11 +128,11 @@ async def create_and_run_server(
131
128
  # CRITICAL: Validate SSL configuration - NO FALLBACKS!
132
129
  if app_config and "ssl" in app_config:
133
130
  ssl_config = app_config["ssl"]
134
- ssl_enabled = ssl_config.get('enabled', False)
131
+ ssl_enabled = ssl_config.get("enabled", False)
135
132
  protocol = app_config.get("server", {}).get("protocol", "http")
136
-
133
+
137
134
  print(f"🔍 Debug: SSL enabled={ssl_enabled}, protocol={protocol}")
138
-
135
+
139
136
  # CRITICAL CHECK: If SSL is enabled, protocol MUST be https or mtls
140
137
  if ssl_enabled and protocol not in ["https", "mtls"]:
141
138
  raise ValueError(
@@ -143,7 +140,7 @@ async def create_and_run_server(
143
140
  f"Protocol MUST be 'https' or 'mtls' when SSL is enabled. "
144
141
  f"Fix your configuration file."
145
142
  )
146
-
143
+
147
144
  # CRITICAL CHECK: If protocol is https/mtls, SSL MUST be enabled
148
145
  if protocol in ["https", "mtls"] and not ssl_enabled:
149
146
  raise ValueError(
@@ -151,39 +148,39 @@ async def create_and_run_server(
151
148
  f"SSL MUST be enabled when protocol is 'https' or 'mtls'. "
152
149
  f"Fix your configuration file."
153
150
  )
154
-
151
+
155
152
  # CRITICAL CHECK: If SSL is enabled, cert and key files MUST exist
156
153
  if ssl_enabled:
157
- cert_file = ssl_config.get('cert_file')
158
- key_file = ssl_config.get('key_file')
159
-
154
+ cert_file = ssl_config.get("cert_file")
155
+ key_file = ssl_config.get("key_file")
156
+
160
157
  if not cert_file or not key_file:
161
158
  raise ValueError(
162
159
  f"CRITICAL CONFIG ERROR: SSL is enabled but cert_file or key_file is missing. "
163
160
  f"cert_file={cert_file}, key_file={key_file}. "
164
161
  f"Fix your configuration file."
165
162
  )
166
-
163
+
167
164
  if not Path(cert_file).exists():
168
165
  raise ValueError(
169
166
  f"CRITICAL CONFIG ERROR: SSL certificate file does not exist: {cert_file}. "
170
167
  f"Fix your configuration file or create the certificate."
171
168
  )
172
-
169
+
173
170
  if not Path(key_file).exists():
174
171
  raise ValueError(
175
172
  f"CRITICAL CONFIG ERROR: SSL key file does not exist: {key_file}. "
176
173
  f"Fix your configuration file or create the key."
177
174
  )
178
-
179
- print(f"✅ SSL configuration validated: cert={cert_file}, key={key_file}")
175
+
176
+ print(
177
+ f"✅ SSL configuration validated: cert={cert_file}, key={key_file}"
178
+ )
180
179
 
181
180
  # Validate security framework configuration only if enabled
182
181
  security_config = app_config.get("security", {})
183
182
  if security_config.get("enabled", False):
184
- framework = security_config.get(
185
- "framework", "mcp_security_framework"
186
- )
183
+ framework = security_config.get("framework", "mcp_security_framework")
187
184
  print(f"🔒 Security framework: {framework}")
188
185
 
189
186
  # Debug: Check SSL config before validation
@@ -226,16 +223,14 @@ async def create_and_run_server(
226
223
  sys.exit(1)
227
224
  else:
228
225
  print("⚠️ No configuration file provided, using defaults")
229
- app_config = config.get_all()
226
+ app_config = config.config_data
230
227
 
231
228
  # 2. Setup logging
232
229
  try:
233
230
  if log_config_path:
234
231
  log_config_file = Path(log_config_path)
235
232
  if not log_config_file.exists():
236
- print(
237
- f"❌ Log configuration file not found: {log_config_path}"
238
- )
233
+ print(f"❌ Log configuration file not found: {log_config_path}")
239
234
  sys.exit(1)
240
235
  setup_logging(log_config_path=str(log_config_file))
241
236
  print(f"✅ Logging configured from: {log_config_path}")
@@ -278,12 +273,9 @@ async def create_and_run_server(
278
273
 
279
274
  # 5. Create server configuration
280
275
  # Get port from config if available, otherwise use default
281
- server_port = (
282
- app_config.get("server", {}).get("port", 8000) if app_config else 8000
283
- )
276
+ server_port = app_config.get("server", {}).get("port", 8000) if app_config else 8000
284
277
  print(f"🔌 Port: {server_port}")
285
278
 
286
-
287
279
  server_config = {
288
280
  "host": host,
289
281
  "port": server_port,
@@ -324,13 +316,9 @@ async def create_and_run_server(
324
316
  # Check for SSL config in security section (fallback)
325
317
  if app_config and "security" in app_config:
326
318
  security_config = app_config["security"]
327
- print(
328
- f"🔍 Debug: security_config keys: {list(security_config.keys())}"
329
- )
319
+ print(f"🔍 Debug: security_config keys: {list(security_config.keys())}")
330
320
  if "ssl" in security_config:
331
- print(
332
- f"🔍 Debug: SSL config found in security: {security_config['ssl']}"
333
- )
321
+ print(f"🔍 Debug: SSL config found in security: {security_config['ssl']}")
334
322
  print(
335
323
  f"🔍 Debug: SSL enabled: {security_config['ssl'].get('enabled', False)}"
336
324
  )
@@ -397,11 +385,9 @@ async def create_and_run_server(
397
385
 
398
386
  # Configure hypercorn
399
387
  config_hypercorn = hypercorn.config.Config()
400
- config_hypercorn.bind = [
401
- f"{server_config['host']}:{server_config['port']}"
402
- ]
388
+ config_hypercorn.bind = [f"{server_config['host']}:{server_config['port']}"]
403
389
  config_hypercorn.loglevel = server_config.get("log_level", "info")
404
-
390
+
405
391
  # Add SSL shutdown timeout to prevent SSL shutdown timeout errors
406
392
  config_hypercorn.ssl_handshake_timeout = 10.0
407
393
  config_hypercorn.keep_alive_timeout = 5.0
@@ -417,15 +403,11 @@ async def create_and_run_server(
417
403
  import ssl
418
404
 
419
405
  # Use the verify_mode from configuration, default to CERT_NONE
420
- verify_mode = getattr(
421
- ssl, server_config["verify_mode"], ssl.CERT_NONE
422
- )
406
+ verify_mode = getattr(ssl, server_config["verify_mode"], ssl.CERT_NONE)
423
407
  config_hypercorn.verify_mode = verify_mode
424
408
 
425
409
  # Determine if SSL is enabled
426
- ssl_enabled = any(
427
- key in server_config for key in ["certfile", "keyfile"]
428
- )
410
+ ssl_enabled = any(key in server_config for key in ["certfile", "keyfile"])
429
411
 
430
412
  if ssl_enabled:
431
413
  if verify_client:
@@ -433,9 +415,9 @@ async def create_and_run_server(
433
415
  f"🔐 Starting external mTLS proxy with hypercorn (internal server on port {mtls_server.port if mtls_server else 'N/A'})..."
434
416
  )
435
417
  else:
436
- print(f"🔐 Starting HTTPS server with hypercorn...")
418
+ print("🔐 Starting HTTPS server with hypercorn...")
437
419
  else:
438
- print(f"🌐 Starting HTTP server with hypercorn...")
420
+ print("🌐 Starting HTTP server with hypercorn...")
439
421
 
440
422
  # Final port check disabled in this refactor; rely on OS errors
441
423
 
@@ -457,6 +439,7 @@ async def create_and_run_server(
457
439
  print("🛑 Stopping mTLS server...")
458
440
  mtls_server.stop()
459
441
  import traceback
442
+
460
443
  traceback.print_exc()
461
444
  sys.exit(1)
462
445
  except Exception as e:
@@ -489,8 +472,8 @@ def validate_config_file(config_path: str) -> bool:
489
472
 
490
473
  # Try to load configuration to validate JSON format
491
474
  from mcp_proxy_adapter.config import Config
492
- config = Config()
493
- config.load_from_file(str(config_file))
475
+
476
+ Config(config_path=str(config_file))
494
477
  return True
495
478
 
496
479
  except Exception as e:
@@ -2,4 +2,4 @@
2
2
  Version information for MCP Proxy Adapter.
3
3
  """
4
4
 
5
- __version__ = "6.9.30"
5
+ __version__ = "6.9.32"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-proxy-adapter
3
- Version: 6.9.30
3
+ Version: 6.9.32
4
4
  Summary: Powerful JSON-RPC microservices framework with built-in security, authentication, and proxy registration
5
5
  Home-page: https://github.com/maverikod/mcp-proxy-adapter
6
6
  Author: Vasiliy Zdanovskiy
@@ -4,7 +4,7 @@ mcp_proxy_adapter/config.py,sha256=Nj5Cpyt2_BHRCWF_TsdL6W5Eb7_yNe7WVsCNZSx2LT0,5
4
4
  mcp_proxy_adapter/custom_openapi.py,sha256=WY9JTPoi5uofaopU4tm703qQ8ak2qezPmk98dUyWm2U,1482
5
5
  mcp_proxy_adapter/main.py,sha256=K_ulceLTzo6fqJsr5J3AvBO-63q7sm-xyR6XUaQH0d8,10952
6
6
  mcp_proxy_adapter/openapi.py,sha256=N3iJ4h6vJKz_pjoHiJxM_mFEodsbz8aN3v0NVV7YX7w,12885
7
- mcp_proxy_adapter/version.py,sha256=lTERyxydTdH-2Ybchzz6ai7J8Ziz2hn8jWOGWEEjKL0,75
7
+ mcp_proxy_adapter/version.py,sha256=ZOknzBzX6vOn3T1ee-kkR4_uOa-AYfSqrloJGp0FQZw,75
8
8
  mcp_proxy_adapter/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  mcp_proxy_adapter/api/app.py,sha256=zvqMxMVx0YJ32Q6zFKhpyDdaF8BKVGokBxpwbqBTWmU,1921
10
10
  mcp_proxy_adapter/api/handlers.py,sha256=jNzWrks7throenjQ6salj4C8tBxIvx-QBhK9IkfixxM,6370
@@ -94,7 +94,7 @@ mcp_proxy_adapter/commands/registry/command_loader.py,sha256=OBRkKCtDHRxQGFgZKdu
94
94
  mcp_proxy_adapter/commands/registry/command_manager.py,sha256=dMQWKNwACiknHdECya2DIE8beZaeJDV4dpHid--Sk6Q,3979
95
95
  mcp_proxy_adapter/commands/registry/command_registry.py,sha256=XURwiKUoUNbzp32p1awtS7nedqO3RW8scy7qqzdBk3o,6410
96
96
  mcp_proxy_adapter/core/__init__.py,sha256=aKs8nj8jamwV8xwZgtwxmzPKUgCZincqGZHuMj7qki0,196
97
- mcp_proxy_adapter/core/app_factory.py,sha256=qydxVnkrwDkScph1xfteBJhtJaxpLKj1x5DcwG4ku6U,22624
97
+ mcp_proxy_adapter/core/app_factory.py,sha256=rvNp2hXgUq6tI2U55R5ddVWxxD0FCxF5YY-sDFVsFP8,22201
98
98
  mcp_proxy_adapter/core/app_runner.py,sha256=7FF9MVdMiVpXpJcu-a8DhI-VstS0y_Ee5TF5HmrOry0,10670
99
99
  mcp_proxy_adapter/core/auth_validator.py,sha256=BuvGEHLvNU8Rv5wmdB8qd-TPlCDJF0cSwnWMHe9h18w,16565
100
100
  mcp_proxy_adapter/core/certificate_utils.py,sha256=Jeftf420a_tsBjOqUwZrK5azqrqkK10YFD0ll-lgWHo,7499
@@ -228,8 +228,8 @@ mcp_proxy_adapter/schemas/base_schema.json,sha256=v9G9cGMd4dRhCZsOQ_FMqOi5VFyVbI
228
228
  mcp_proxy_adapter/schemas/openapi_schema.json,sha256=C3yLkwmDsvnLW9B5gnKKdBGl4zxkeU-rEmjTrNVsQU0,8405
229
229
  mcp_proxy_adapter/schemas/roles.json,sha256=pgf_ZyqKyXbfGUxvobpiLiSJz9zzxrMuoVWEkEpz3N8,764
230
230
  mcp_proxy_adapter/schemas/roles_schema.json,sha256=deHgI7L6GwfBXacOlNtDgDJelDThppClC3Ti4Eh8rJY,5659
231
- mcp_proxy_adapter-6.9.30.dist-info/METADATA,sha256=Ajq0oP9spGq-C1BXZwJKPMBMsvz-89AioHOTrlwC7gk,8570
232
- mcp_proxy_adapter-6.9.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
233
- mcp_proxy_adapter-6.9.30.dist-info/entry_points.txt,sha256=9nRLPijE8MJY-OmY0VnSvOH8VzGCUzVwOZT6ZJKMQYA,563
234
- mcp_proxy_adapter-6.9.30.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
235
- mcp_proxy_adapter-6.9.30.dist-info/RECORD,,
231
+ mcp_proxy_adapter-6.9.32.dist-info/METADATA,sha256=dT9BHnVAHHuOyphK3Bz4G2P1lFW7j2tolEVHSJakP_E,8570
232
+ mcp_proxy_adapter-6.9.32.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
233
+ mcp_proxy_adapter-6.9.32.dist-info/entry_points.txt,sha256=9nRLPijE8MJY-OmY0VnSvOH8VzGCUzVwOZT6ZJKMQYA,563
234
+ mcp_proxy_adapter-6.9.32.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
235
+ mcp_proxy_adapter-6.9.32.dist-info/RECORD,,