mcp-proxy-adapter 6.9.14__py3-none-any.whl → 6.9.15__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.
@@ -146,7 +146,7 @@ def create_lifespan(config_path: Optional[str] = None):
146
146
  # Compute server_url EARLY and inject into registration manager so
147
147
  # that reload_system (which may perform registration) uses the correct
148
148
  # externally reachable address.
149
- server_config = config.get("server")
149
+ server_config = current_config.get("server")
150
150
  if not server_config:
151
151
  raise ValueError("server configuration is required")
152
152
  server_host = server_config.get("host")
@@ -362,9 +362,16 @@ def create_app(
362
362
  elif hasattr(app_config, "keys"):
363
363
  current_config = app_config
364
364
  else:
365
- current_config = config.get_all()
365
+ # If app_config is not a dict-like object, use it as is
366
+ current_config = app_config
366
367
  else:
367
- current_config = config.get_all()
368
+ # If no app_config provided, try to get global config
369
+ try:
370
+ from mcp_proxy_adapter.config import get_config
371
+ current_config = get_config().get_all()
372
+ except Exception:
373
+ # If global config is not available, create empty config
374
+ current_config = {}
368
375
 
369
376
  # Debug: Check what config is passed to create_app
370
377
  if app_config:
@@ -52,7 +52,7 @@ class Config:
52
52
  if VALIDATION_AVAILABLE:
53
53
  self.validator = ConfigValidator()
54
54
 
55
- self.load_config()
55
+ # Don't auto-load config - let user call load_from_file explicitly
56
56
 
57
57
  def load_config(self) -> None:
58
58
  """
@@ -78,6 +78,8 @@ async def create_and_run_server(
78
78
  sys.exit(1)
79
79
 
80
80
  try:
81
+ from mcp_proxy_adapter.config import Config
82
+ config = Config()
81
83
  config.load_from_file(str(config_file))
82
84
  app_config = config.get_all()
83
85
  print(f"✅ Configuration loaded from: {config_path}")
@@ -169,7 +171,6 @@ async def create_and_run_server(
169
171
  f"Fix your configuration file."
170
172
  )
171
173
 
172
- from pathlib import Path
173
174
  if not Path(cert_file).exists():
174
175
  raise ValueError(
175
176
  f"CRITICAL CONFIG ERROR: SSL certificate file does not exist: {cert_file}. "
@@ -509,6 +510,8 @@ def validate_config_file(config_path: str) -> bool:
509
510
  return False
510
511
 
511
512
  # Try to load configuration to validate JSON format
513
+ from mcp_proxy_adapter.config import Config
514
+ config = Config()
512
515
  config.load_from_file(str(config_file))
513
516
  return True
514
517
 
@@ -120,46 +120,29 @@ def setup_logging(
120
120
  Returns:
121
121
  Configured logger.
122
122
  """
123
- # Get parameters from configuration if not explicitly specified
124
- level = level or get_config().get("logging.level", "INFO")
125
-
126
- # Check debug level from config if debug is enabled
127
- if get_config().get("debug.enabled", False):
128
- debug_level = get_config().get("debug.level", "INFO")
129
- # Use debug level if it's more verbose than the logging level
130
- debug_level_num = getattr(logging, debug_level.upper(), logging.INFO)
131
- level_num = getattr(logging, level.upper(), logging.INFO)
132
- if debug_level_num < level_num:
133
- level = debug_level
134
- logger.debug(f"Using debug level from config: {debug_level}")
135
-
136
- log_file = log_file or get_config().get("logging.file")
137
- rotation_type = rotation_type or "size" # Default to size-based rotation
138
-
139
- # Get log directory and file settings from config
140
- log_dir = get_config().get("logging.log_dir", "./logs")
141
- log_file_name = get_config().get("logging.log_file", "mcp_proxy_adapter.log")
142
- error_log_file = get_config().get("logging.error_log_file", "mcp_proxy_adapter_error.log")
143
- access_log_file = get_config().get(
144
- "logging.access_log_file", "mcp_proxy_adapter_access.log"
145
- )
146
-
147
- # Get rotation settings from config
148
- max_file_size_str = get_config().get("logging.max_file_size", "10MB")
149
- backup_count = backup_count or get_config().get("logging.backup_count", 5)
123
+ # Use provided parameters or defaults
124
+ level = level or "INFO"
125
+ log_file = log_file
126
+ rotation_type = rotation_type or "size"
127
+ log_dir = "./logs"
128
+ log_file_name = "mcp_proxy_adapter.log"
129
+ error_log_file = "mcp_proxy_adapter_error.log"
130
+ access_log_file = "mcp_proxy_adapter_access.log"
131
+
132
+ # Get rotation settings
133
+ max_file_size_str = "10MB"
134
+ backup_count = backup_count or 5
150
135
 
151
136
  # Parse max file size (e.g., "10MB" -> 10 * 1024 * 1024)
152
137
  max_bytes = max_bytes or _parse_file_size(max_file_size_str)
153
138
 
154
139
  # Get format settings
155
- log_format = get_config().get(
156
- "logging.format", "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
157
- )
158
- date_format = get_config().get("logging.date_format", "%Y-%m-%d %H:%M:%S")
140
+ log_format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
141
+ date_format = "%Y-%m-%d %H:%M:%S"
159
142
 
160
143
  # Get output settings
161
- console_output = get_config().get("logging.console_output", True)
162
- file_output = get_config().get("logging.file_output", True)
144
+ console_output = True
145
+ file_output = True
163
146
 
164
147
  # Convert string logging level to constant
165
148
  numeric_level = getattr(logging, level.upper(), None)
@@ -227,7 +210,7 @@ def setup_logging(
227
210
  logger.addHandler(access_handler)
228
211
 
229
212
  # Configure loggers for external libraries
230
- log_levels = get_config().get("logging.levels", {})
213
+ log_levels = {}
231
214
  for logger_name, logger_level in log_levels.items():
232
215
  lib_logger = logging.getLogger(logger_name)
233
216
  lib_logger.setLevel(getattr(logging, logger_level.upper(), logging.INFO))
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Minimal server test without lifespan issues.
4
+ """
5
+
6
+ import sys
7
+ import os
8
+ from pathlib import Path
9
+
10
+ # Add the project root to the path
11
+ project_root = Path(__file__).parent.parent.parent.parent
12
+ sys.path.insert(0, str(project_root))
13
+
14
+ from fastapi import FastAPI
15
+ from mcp_proxy_adapter.api.handlers import execute_command
16
+ import uvicorn
17
+
18
+ def main():
19
+ """Test minimal server startup."""
20
+ print("🚀 Testing Minimal Server Startup")
21
+ print("=" * 50)
22
+
23
+ # Create minimal FastAPI app
24
+ app = FastAPI(
25
+ title="Test Server",
26
+ description="Minimal test server",
27
+ version="1.0.0"
28
+ )
29
+
30
+ # Add health endpoint
31
+ @app.get("/health")
32
+ async def health():
33
+ return {"status": "ok", "message": "Server is running"}
34
+
35
+ # Add JSON-RPC endpoint
36
+ @app.post("/api/jsonrpc")
37
+ async def jsonrpc_endpoint(request: dict):
38
+ try:
39
+ # Simple health command
40
+ if request.get("method") == "health":
41
+ return {
42
+ "jsonrpc": "2.0",
43
+ "id": request.get("id"),
44
+ "result": {"status": "ok", "message": "Health check passed"}
45
+ }
46
+ else:
47
+ return {
48
+ "jsonrpc": "2.0",
49
+ "id": request.get("id"),
50
+ "error": {"code": -32601, "message": "Method not found"}
51
+ }
52
+ except Exception as e:
53
+ return {
54
+ "jsonrpc": "2.0",
55
+ "id": request.get("id"),
56
+ "error": {"code": -32603, "message": str(e)}
57
+ }
58
+
59
+ print("✅ FastAPI app created successfully")
60
+
61
+ # Start server
62
+ print("🚀 Starting server on http://0.0.0.0:8000")
63
+ print("📡 Test with: curl -X POST http://localhost:8000/api/jsonrpc -H 'Content-Type: application/json' -d '{\"jsonrpc\": \"2.0\", \"method\": \"health\", \"id\": 1}'")
64
+ print("🛑 Press Ctrl+C to stop")
65
+
66
+ uvicorn.run(app, host="0.0.0.0", port=8000)
67
+
68
+ if __name__ == "__main__":
69
+ main()
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Simple server test without complex lifespan.
4
+ """
5
+
6
+ import sys
7
+ import os
8
+ from pathlib import Path
9
+
10
+ # Add the project root to the path
11
+ project_root = Path(__file__).parent.parent.parent.parent
12
+ sys.path.insert(0, str(project_root))
13
+
14
+ from mcp_proxy_adapter.api.app import create_app
15
+ from mcp_proxy_adapter.config import Config
16
+ import uvicorn
17
+
18
+ def main():
19
+ """Test simple server startup."""
20
+ print("🚀 Testing Simple Server Startup")
21
+ print("=" * 50)
22
+
23
+ # Load configuration
24
+ config_path = "configs/http_simple_correct.json"
25
+ if not os.path.exists(config_path):
26
+ print(f"❌ Configuration file not found: {config_path}")
27
+ return 1
28
+
29
+ try:
30
+ # Load config
31
+ config = Config()
32
+ config.load_from_file(config_path)
33
+ app_config = config.get_all()
34
+
35
+ print(f"✅ Configuration loaded: {config_path}")
36
+ print(f"🔍 Config keys: {list(app_config.keys())}")
37
+
38
+ # Create app
39
+ app = create_app(
40
+ title="Test Server",
41
+ description="Simple test server",
42
+ version="1.0.0",
43
+ app_config=app_config
44
+ )
45
+
46
+ print("✅ FastAPI app created successfully")
47
+
48
+ # Start server
49
+ print("🚀 Starting server on http://0.0.0.0:8000")
50
+ print("📡 Test with: curl -X POST http://localhost:8000/api/jsonrpc -H 'Content-Type: application/json' -d '{\"jsonrpc\": \"2.0\", \"method\": \"health\", \"id\": 1}'")
51
+ print("🛑 Press Ctrl+C to stop")
52
+
53
+ uvicorn.run(app, host="0.0.0.0", port=8000)
54
+
55
+ except Exception as e:
56
+ print(f"❌ Error: {e}")
57
+ import traceback
58
+ traceback.print_exc()
59
+ return 1
60
+
61
+ if __name__ == "__main__":
62
+ sys.exit(main())
@@ -2,4 +2,4 @@
2
2
  Version information for MCP Proxy Adapter.
3
3
  """
4
4
 
5
- __version__ = "6.9.14"
5
+ __version__ = "6.9.15"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-proxy-adapter
3
- Version: 6.9.14
3
+ Version: 6.9.15
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
@@ -1,12 +1,12 @@
1
1
  mcp_proxy_adapter/__init__.py,sha256=iH0EBBsRj_cfZJpAIsgN_8tTdfefhnl6uUKHjLHhWDQ,1037
2
2
  mcp_proxy_adapter/__main__.py,sha256=sq3tANRuTd18euamt0Bmn1sJeAyzXENZ5VvsMwbrDFA,579
3
- mcp_proxy_adapter/config.py,sha256=1Ngxri2IPGoytYdCF5pXzbLUXsWcf6qYENkaDkAppg0,25323
3
+ mcp_proxy_adapter/config.py,sha256=ow9zL4fRK6vr0ZYukUIGcHo2VKup9NCJqflrDDeGFQU,25371
4
4
  mcp_proxy_adapter/custom_openapi.py,sha256=XRviX-C-ZkSKdBhORhDTdeN_1FWyEfXZADiASft3t9I,28149
5
5
  mcp_proxy_adapter/main.py,sha256=NFcSW7WaEnimRWe5zj28D0CH9otHlRZ92d2Um6XiGjE,10399
6
6
  mcp_proxy_adapter/openapi.py,sha256=2UZOI09ZDRJuBYBjKbMyb2U4uASszoCMD5o_4ktRpvg,13480
7
- mcp_proxy_adapter/version.py,sha256=ZzA45mtQabpralicB2254g484POKePR2iPCTeg_clhc,75
7
+ mcp_proxy_adapter/version.py,sha256=wNd8p-JNrRUaPPjPgiZdeLFjvBYBXlFIAoT2Vcww0L4,75
8
8
  mcp_proxy_adapter/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- mcp_proxy_adapter/api/app.py,sha256=La7xt02j4Zbg4sSc1iL72DM3UNFVddPlN4_xpaRauVo,37214
9
+ mcp_proxy_adapter/api/app.py,sha256=FoZ6YU_ZbvWmg_1nz9TQoyu7urd-tDybdLAGrM-moY4,37556
10
10
  mcp_proxy_adapter/api/handlers.py,sha256=X-hcMNVeTAu4yVkKJEChEsj2bFptUS6sLNN-Wysjkow,10011
11
11
  mcp_proxy_adapter/api/schemas.py,sha256=mevUvQnYgWQfkJAs3-vq3HalBzh6-Saa-Au1VVf0peE,12377
12
12
  mcp_proxy_adapter/api/tool_integration.py,sha256=AeUyvJVN-c3FrX5fHdagHL51saRH5d1ZKqc2YEx0rTE,10147
@@ -54,7 +54,7 @@ mcp_proxy_adapter/commands/token_management_command.py,sha256=tCVjhWqAQ3KhcwSsZU
54
54
  mcp_proxy_adapter/commands/transport_management_command.py,sha256=HEnUyL4S014jheyBwO90u9gnzk0qxBlOJdC_0Sxhq9E,4585
55
55
  mcp_proxy_adapter/commands/unload_command.py,sha256=6CUM9B9c-mNxw7uvt2vcvZSnxMySfoMT5UmDhzNXq38,4984
56
56
  mcp_proxy_adapter/core/__init__.py,sha256=3yt0CFZdsIG8Ln4bg-r4ISYzipm3ZUAxTn0twYTs9FI,867
57
- mcp_proxy_adapter/core/app_factory.py,sha256=9nCt7NahHF8zaTjyy8X9qzN0YdrFmR9lHSDWr3G72hs,23332
57
+ mcp_proxy_adapter/core/app_factory.py,sha256=oTSmhHTZeEqTNX9b-nXACp0Vootupsk5ZWzZqU-CtkE,23451
58
58
  mcp_proxy_adapter/core/app_runner.py,sha256=n8_rBojzKUpHLN5ksiXcR8UWoBYk6Tt5OtWk-X2kVPc,11868
59
59
  mcp_proxy_adapter/core/auth_validator.py,sha256=q8TNkdolvP-gM6Bvecc6nrVG9al5J31pocdwhguhTBk,19742
60
60
  mcp_proxy_adapter/core/certificate_utils.py,sha256=yeDwi-j42CxK_g-r5_ragGFY_HdSgDfTWHVUjDHF6nI,38480
@@ -65,7 +65,7 @@ mcp_proxy_adapter/core/config_converter.py,sha256=Wnnsrbw7DxtgDfLG-IyyzK-hkKu0_1
65
65
  mcp_proxy_adapter/core/config_validator.py,sha256=B5Tu8nE_iSvB1jFJ6qseOZrUpd0QoK7phU9Sznv1HDI,54858
66
66
  mcp_proxy_adapter/core/crl_utils.py,sha256=Jnwq2UN52IoCDZCwByRP3XNMOJexftb-mVaH6zes6Fc,11706
67
67
  mcp_proxy_adapter/core/errors.py,sha256=CyhQgvMt0ooQjONa65XRBJ44y-l-E5_ES4KOuRvIpBk,8557
68
- mcp_proxy_adapter/core/logging.py,sha256=VIpiC6QTGLukRjiJoVpq3VEoLKhUeLNl8IdfljpW6ZU,9654
68
+ mcp_proxy_adapter/core/logging.py,sha256=dplInPvL4Ff4P0cRDszOiCcFzwu7NXAw2qkBB2OW7_E,8452
69
69
  mcp_proxy_adapter/core/mtls_asgi.py,sha256=tvk0P9024s18dcCHY9AaQIecT4ojOTv21EuQWXwooU0,5200
70
70
  mcp_proxy_adapter/core/mtls_asgi_app.py,sha256=DT_fTUH1RkvBa3ThbyCyNb-XUHyCb4DqaKA1gcZC6z4,6538
71
71
  mcp_proxy_adapter/core/mtls_proxy.py,sha256=5APlWs0ImiHGEC65W_7F-PbVO3NZ2BVSj9r14AcUtTE,6011
@@ -124,7 +124,9 @@ mcp_proxy_adapter/examples/full_application/main.py,sha256=uQBvnIBu6C2Y9P2j5hg0-
124
124
  mcp_proxy_adapter/examples/full_application/proxy_endpoints.py,sha256=Kt_WAsG61HLTMkKQ1mQqjvlX9I4TcfwYq0NaRR9HKvM,6179
125
125
  mcp_proxy_adapter/examples/full_application/run_mtls.py,sha256=neYnzO9lfCEEruv-R__dHey18DXav5RG6hNKwu54G6Y,9455
126
126
  mcp_proxy_adapter/examples/full_application/run_simple.py,sha256=Rnmsi68EfiFEWrXx5DfUnxSks9uhmJR-ERlo-BOm9tQ,5163
127
+ mcp_proxy_adapter/examples/full_application/test_minimal_server.py,sha256=7gAnvWOuO3AiLBWRdThm1X-g14zz1mi95bwaxzxgro8,2062
127
128
  mcp_proxy_adapter/examples/full_application/test_server.py,sha256=VRAxvx7rnhUxTgm_5muXYtTrxS7nTolYc7h0WyLmU9s,7600
129
+ mcp_proxy_adapter/examples/full_application/test_simple_server.py,sha256=3reGMunQLHIIkgbRwFffU3IH_b4yu96JpZORCrmc_Wk,1798
128
130
  mcp_proxy_adapter/examples/full_application/commands/__init__.py,sha256=yQHxVSFkAyFLUOdk42QOebUODPlQV9IbydPgF3UKsGM,217
129
131
  mcp_proxy_adapter/examples/full_application/commands/custom_echo_command.py,sha256=H7FPJmVJNWT61rPWxep06-7hsYRt8XYBUSBiwqpBurU,3096
130
132
  mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.py,sha256=DFTqVnIDt6nBdZ27-vD_f1X2cFcDInVQiCEq9ltw4lA,3428
@@ -135,8 +137,8 @@ mcp_proxy_adapter/schemas/base_schema.json,sha256=v9G9cGMd4dRhCZsOQ_FMqOi5VFyVbI
135
137
  mcp_proxy_adapter/schemas/openapi_schema.json,sha256=C3yLkwmDsvnLW9B5gnKKdBGl4zxkeU-rEmjTrNVsQU0,8405
136
138
  mcp_proxy_adapter/schemas/roles.json,sha256=pgf_ZyqKyXbfGUxvobpiLiSJz9zzxrMuoVWEkEpz3N8,764
137
139
  mcp_proxy_adapter/schemas/roles_schema.json,sha256=deHgI7L6GwfBXacOlNtDgDJelDThppClC3Ti4Eh8rJY,5659
138
- mcp_proxy_adapter-6.9.14.dist-info/METADATA,sha256=3AiYjcUebs6vjYdgggkM-SWBMIR-UsXsxiXE_GgBmBA,8511
139
- mcp_proxy_adapter-6.9.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
140
- mcp_proxy_adapter-6.9.14.dist-info/entry_points.txt,sha256=Bf-O5Aq80n22Ayu9fI9BgidzWqwzIVaqextAddTuHZw,563
141
- mcp_proxy_adapter-6.9.14.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
142
- mcp_proxy_adapter-6.9.14.dist-info/RECORD,,
140
+ mcp_proxy_adapter-6.9.15.dist-info/METADATA,sha256=6tBPggVIw3Pa8iQmsEPd0kW7mFhW1uAv1HHD5adIop4,8511
141
+ mcp_proxy_adapter-6.9.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
142
+ mcp_proxy_adapter-6.9.15.dist-info/entry_points.txt,sha256=Bf-O5Aq80n22Ayu9fI9BgidzWqwzIVaqextAddTuHZw,563
143
+ mcp_proxy_adapter-6.9.15.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
144
+ mcp_proxy_adapter-6.9.15.dist-info/RECORD,,