mcp-proxy-adapter 6.3.23__py3-none-any.whl → 6.3.25__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.
@@ -30,28 +30,32 @@ class BaseMiddleware(BaseHTTPMiddleware):
30
30
  Response.
31
31
  """
32
32
  middleware_name = self.__class__.__name__
33
- logger.debug(f"🔍 {middleware_name}.dispatch START - {request.method} {request.url.path}")
33
+ logger.info(f"🔍 STEP 1: {middleware_name}.dispatch START - {request.method} {request.url.path}")
34
+ logger.info(f"🔍 STEP 1.1: {middleware_name} - Request headers: {dict(request.headers)}")
35
+ logger.info(f"🔍 STEP 1.2: {middleware_name} - Request URL: {request.url}")
36
+ logger.info(f"🔍 STEP 1.3: {middleware_name} - Request scope: {request.scope}")
34
37
 
35
38
  try:
36
39
  # Process request before calling the main handler
37
- logger.debug(f"🔍 {middleware_name}.before_request START")
40
+ logger.info(f"🔍 STEP 2: {middleware_name}.before_request START")
38
41
  await self.before_request(request)
39
- logger.debug(f"🔍 {middleware_name}.before_request COMPLETED")
42
+ logger.info(f"🔍 STEP 3: {middleware_name}.before_request COMPLETED")
40
43
 
41
44
  # Call the next middleware or main handler
42
- logger.debug(f"🔍 {middleware_name}.call_next START")
45
+ logger.info(f"🔍 STEP 4: {middleware_name}.call_next START - About to call next middleware/endpoint")
43
46
  response = await call_next(request)
44
- logger.debug(f"🔍 {middleware_name}.call_next COMPLETED - Status: {response.status_code}")
47
+ logger.info(f"🔍 STEP 5: {middleware_name}.call_next COMPLETED - Status: {response.status_code}")
48
+ logger.info(f"🔍 STEP 5.1: {middleware_name} - Response headers: {dict(response.headers)}")
45
49
 
46
50
  # Process response after calling the main handler
47
- logger.debug(f"🔍 {middleware_name}.after_response START")
51
+ logger.info(f"🔍 STEP 6: {middleware_name}.after_response START")
48
52
  response = await self.after_response(request, response)
49
- logger.debug(f"🔍 {middleware_name}.after_response COMPLETED")
53
+ logger.info(f"🔍 STEP 7: {middleware_name}.after_response COMPLETED")
50
54
 
51
- logger.debug(f"🔍 {middleware_name}.dispatch COMPLETED SUCCESSFULLY")
55
+ logger.info(f"🔍 STEP 8: {middleware_name}.dispatch COMPLETED SUCCESSFULLY")
52
56
  return response
53
57
  except Exception as e:
54
- logger.error(f"❌ {middleware_name}.dispatch ERROR: {str(e)}", exc_info=True)
58
+ logger.error(f"❌ STEP ERROR: {middleware_name}.dispatch ERROR: {str(e)}", exc_info=True)
55
59
  # If an error occurred, call the error handler
56
60
  return await self.handle_error(request, e)
57
61
 
@@ -97,27 +97,26 @@ class ProtocolMiddleware(BaseHTTPMiddleware):
97
97
  Returns:
98
98
  Response object
99
99
  """
100
- logger.debug(
101
- f"🔍 ProtocolMiddleware.dispatch START for {request.method} {request.url.path}"
102
- )
103
- logger.debug(f"🔍 ProtocolMiddleware - protocols.enabled: {self.protocol_manager.enabled}")
104
- logger.debug(f"🔍 ProtocolMiddleware - allowed_protocols: {self.protocol_manager.allowed_protocols}")
100
+ logger.info(f"🔍 PROTOCOL STEP 1: ProtocolMiddleware.dispatch START - {request.method} {request.url.path}")
101
+ logger.info(f"🔍 PROTOCOL STEP 1.1: Request scheme: {request.url.scheme}")
102
+ logger.info(f"🔍 PROTOCOL STEP 1.2: Request headers: {dict(request.headers)}")
103
+ logger.info(f"🔍 PROTOCOL STEP 1.3: Request scope: {request.scope}")
104
+ logger.info(f"🔍 PROTOCOL STEP 1.4: Protocol manager enabled: {self.protocol_manager.enabled}")
105
+ logger.info(f"🔍 PROTOCOL STEP 1.5: Protocol manager allowed_protocols: {self.protocol_manager.allowed_protocols}")
105
106
 
106
107
  try:
107
108
  # Get protocol from request
109
+ logger.info(f"🔍 PROTOCOL STEP 2: Getting request protocol...")
108
110
  protocol = self._get_request_protocol(request)
109
- logger.debug(f"🔍 ProtocolMiddleware - Detected protocol: {protocol} for {request.method} {request.url.path}")
110
- logger.debug(f"🔍 ProtocolMiddleware - Request scheme: {request.url.scheme}")
111
- logger.debug(f"🔍 ProtocolMiddleware - Request headers: {dict(request.headers)}")
111
+ logger.info(f"🔍 PROTOCOL STEP 3: Detected protocol: {protocol} for {request.method} {request.url.path}")
112
112
 
113
113
  # Check if protocol is allowed
114
+ logger.info(f"🔍 PROTOCOL STEP 4: Checking if protocol '{protocol}' is allowed...")
114
115
  is_allowed = self.protocol_manager.is_protocol_allowed(protocol)
115
- logger.debug(f"🔍 ProtocolMiddleware - Protocol '{protocol}' allowed: {is_allowed}")
116
+ logger.info(f"🔍 PROTOCOL STEP 5: Protocol '{protocol}' allowed: {is_allowed}")
116
117
 
117
118
  if not is_allowed:
118
- logger.warning(
119
- f"❌ ProtocolMiddleware - Protocol '{protocol}' not allowed for request to {request.url.path}"
120
- )
119
+ logger.warning(f"❌ PROTOCOL STEP ERROR: Protocol '{protocol}' not allowed for request to {request.url.path}")
121
120
  return JSONResponse(
122
121
  status_code=403,
123
122
  content={
@@ -128,15 +127,21 @@ class ProtocolMiddleware(BaseHTTPMiddleware):
128
127
  )
129
128
 
130
129
  # Continue processing
131
- logger.debug(f"✅ ProtocolMiddleware - Protocol '{protocol}' allowed, continuing to next middleware/handler")
132
- logger.debug(f"🔍 ProtocolMiddleware - About to call next handler")
130
+ logger.info(f"✅ PROTOCOL STEP 6: Protocol '{protocol}' allowed, proceeding...")
131
+ logger.info(f"🔍 PROTOCOL STEP 7: Adding protocol '{protocol}' to request state...")
132
+ request.state.protocol = protocol
133
+ logger.info(f"🔍 PROTOCOL STEP 8: Protocol '{protocol}' added to request state")
134
+
135
+ logger.info(f"🔍 PROTOCOL STEP 9: Calling next middleware/endpoint...")
133
136
  response = await call_next(request)
134
- logger.debug(f" ProtocolMiddleware - Next handler completed with status: {response.status_code}")
135
- logger.debug(f" ProtocolMiddleware - Protocol middleware completed successfully for {request.method} {request.url.path}")
137
+ logger.info(f"🔍 PROTOCOL STEP 10: Next middleware/endpoint completed with status: {response.status_code}")
138
+ logger.info(f"🔍 PROTOCOL STEP 10.1: Response headers: {dict(response.headers)}")
139
+
140
+ logger.info(f"✅ PROTOCOL STEP 11: ProtocolMiddleware completed successfully")
136
141
  return response
137
142
 
138
143
  except Exception as e:
139
- logger.error(f"❌ ProtocolMiddleware - Protocol middleware error: {e}", exc_info=True)
144
+ logger.error(f"❌ PROTOCOL STEP ERROR: ProtocolMiddleware ERROR: {str(e)}", exc_info=True)
140
145
  return JSONResponse(
141
146
  status_code=500,
142
147
  content={"error": "Protocol validation error", "message": str(e)},
@@ -256,50 +261,43 @@ def setup_protocol_middleware(app, app_config: Optional[Dict[str, Any]] = None):
256
261
  app: FastAPI application
257
262
  app_config: Application configuration dictionary (optional)
258
263
  """
259
- logger.debug(f"setup_protocol_middleware - app_config type: {type(app_config)}")
264
+ logger.info(f"🔍 SETUP STEP 1: setup_protocol_middleware - app_config type: {type(app_config)}")
260
265
 
261
266
  # Check if protocol management is enabled
262
267
  if app_config is None:
268
+ logger.info(f"🔍 SETUP STEP 2: app_config is None, loading from global config...")
263
269
  from mcp_proxy_adapter.config import config
264
270
 
265
271
  app_config = config.get_all()
266
- logger.debug(
267
- f"setup_protocol_middleware - loaded from global config, type: {type(app_config)}"
268
- )
272
+ logger.info(f"🔍 SETUP STEP 3: loaded from global config, type: {type(app_config)}")
269
273
 
270
- logger.debug(
271
- f"setup_protocol_middleware - final app_config type: {type(app_config)}"
272
- )
274
+ logger.info(f"🔍 SETUP STEP 4: final app_config type: {type(app_config)}")
273
275
 
274
276
  if hasattr(app_config, "get"):
275
- logger.debug(
276
- f"setup_protocol_middleware - app_config keys: {list(app_config.keys()) if hasattr(app_config, 'keys') else 'no keys'}"
277
- )
277
+ logger.info(f"🔍 SETUP STEP 5: app_config has 'get' method")
278
+ logger.info(f"🔍 SETUP STEP 5.1: app_config keys: {list(app_config.keys()) if hasattr(app_config, 'keys') else 'no keys'}")
278
279
  protocols_config = app_config.get("protocols", {})
279
- logger.debug(
280
- f"setup_protocol_middleware - protocols_config type: {type(protocols_config)}"
281
- )
280
+ logger.info(f"🔍 SETUP STEP 6: protocols_config: {protocols_config}")
281
+ logger.info(f"🔍 SETUP STEP 6.1: protocols_config type: {type(protocols_config)}")
282
282
  enabled = (
283
283
  protocols_config.get("enabled", True)
284
284
  if hasattr(protocols_config, "get")
285
285
  else True
286
286
  )
287
+ logger.info(f"🔍 SETUP STEP 7: protocols_config.get('enabled', True) = {enabled}")
287
288
  else:
288
- logger.debug(
289
- f"setup_protocol_middleware - app_config is not dict-like: {repr(app_config)}"
290
- )
289
+ logger.info(f"🔍 SETUP STEP 5: app_config is not dict-like: {repr(app_config)}")
291
290
  enabled = True
292
291
 
293
- logger.debug(f"setup_protocol_middleware - protocol management enabled: {enabled}")
292
+ logger.info(f"🔍 SETUP STEP 8: protocol management enabled: {enabled}")
294
293
 
295
294
  if enabled:
296
295
  # Create protocol middleware with current configuration
297
- logger.debug(
298
- f"setup_protocol_middleware - creating ProtocolMiddleware with config type: {type(app_config)}"
299
- )
296
+ logger.info(f"🔍 SETUP STEP 9: Creating ProtocolMiddleware with config type: {type(app_config)}")
300
297
  middleware = ProtocolMiddleware(app, app_config)
301
- logger.debug(f"setup_protocol_middleware - adding middleware to app")
298
+ logger.info(f"🔍 SETUP STEP 10: ProtocolMiddleware created successfully")
299
+ logger.info(f"🔍 SETUP STEP 11: Adding ProtocolMiddleware to app...")
302
300
  app.add_middleware(ProtocolMiddleware, app_config=app_config)
303
- logger.info("Protocol middleware added to application")
301
+ logger.info(f"✅ SETUP STEP 12: Protocol middleware added to application")
304
302
  else:
305
- logger.info("Protocol management is disabled, skipping protocol middleware")
303
+ logger.info(f"✅ SETUP STEP 9: Protocol management is disabled, skipping protocol middleware")
@@ -2,4 +2,4 @@
2
2
  Version information for MCP Proxy Adapter.
3
3
  """
4
4
 
5
- __version__ = "6.3.23"
5
+ __version__ = "6.3.25"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-proxy-adapter
3
- Version: 6.3.23
3
+ Version: 6.3.25
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=-7iVS0mUWWKNeao7nqTAFlUD6FcMwRlDkchN7OwYsr0,2
4
4
  mcp_proxy_adapter/custom_openapi.py,sha256=yLle4CntYK9wpivgn9NflZyJhy-YNrmWjJzt0ai5nP0,14672
5
5
  mcp_proxy_adapter/main.py,sha256=LoepnC3yoCK-S-sNntpi33Js6H0zhCp1nuQ-NcSXoNw,3656
6
6
  mcp_proxy_adapter/openapi.py,sha256=2UZOI09ZDRJuBYBjKbMyb2U4uASszoCMD5o_4ktRpvg,13480
7
- mcp_proxy_adapter/version.py,sha256=AXsJFeJCfu8pwHEkazFV-fjEHQwdgjswIDoJv45-fak,75
7
+ mcp_proxy_adapter/version.py,sha256=H77S9nNS1hHwkx-J6VUBbQdFTCg5V_yXGQLRFHkzDM8,75
8
8
  mcp_proxy_adapter/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  mcp_proxy_adapter/api/app.py,sha256=Ayvk_WsWuDkjYkKCzUB1ImCVINYnxzkGIgKE50UkqRY,29215
10
10
  mcp_proxy_adapter/api/handlers.py,sha256=iyFGoEuUS1wxbV1ELA0zmaxIyQR7j4zw-4MrD-uIO6E,8294
@@ -12,13 +12,13 @@ mcp_proxy_adapter/api/schemas.py,sha256=mevUvQnYgWQfkJAs3-vq3HalBzh6-Saa-Au1VVf0
12
12
  mcp_proxy_adapter/api/tool_integration.py,sha256=AeUyvJVN-c3FrX5fHdagHL51saRH5d1ZKqc2YEx0rTE,10147
13
13
  mcp_proxy_adapter/api/tools.py,sha256=nDQkxwgn11e1tR7kNfdYWsLAUogKmkEv8cVOYUtOq9U,8025
14
14
  mcp_proxy_adapter/api/middleware/__init__.py,sha256=0E3gJ8kRWdlSIbtkuG68pInE-FsOnLj67hTcvN9jJqE,2168
15
- mcp_proxy_adapter/api/middleware/base.py,sha256=x5vaekh0grLkgSOCQWSytS47Nyagl-Powvb0uk_bKqg,2922
15
+ mcp_proxy_adapter/api/middleware/base.py,sha256=tmvcYbTA7aK4y-5wo7jlSAuhhddRWduRzyQUOiBkAAU,3413
16
16
  mcp_proxy_adapter/api/middleware/command_permission_middleware.py,sha256=dIzcvUDaO3etAM8xXVKza4tiakplppe8fTKuV36NaXU,4936
17
17
  mcp_proxy_adapter/api/middleware/error_handling.py,sha256=bXui9rUn4Gem3PoXuxldSBUpaCoXtCH6gUPD6Th94BY,6867
18
18
  mcp_proxy_adapter/api/middleware/factory.py,sha256=r0BXntUOxF6DiCVqqmAUb3JjargdR28aj2d9X5z-zX4,7987
19
19
  mcp_proxy_adapter/api/middleware/logging.py,sha256=iME87hrbvyTjI-RJro5Cwao7VlHUIuWubpVUabv-s1M,5229
20
20
  mcp_proxy_adapter/api/middleware/performance.py,sha256=-EvA7YIcTlxn8RuxlWlScJvX2EIoeEp3P5dKVWZHYRY,2357
21
- mcp_proxy_adapter/api/middleware/protocol_middleware.py,sha256=pM-VvsYzE8jiyn0kcehvZzg1UfJW38UemNMcp7xoT-w,14651
21
+ mcp_proxy_adapter/api/middleware/protocol_middleware.py,sha256=YiwgeWXaFjj-TvTpAyqOMu1Rql4UENmX6pAJ8vEb9T8,15449
22
22
  mcp_proxy_adapter/api/middleware/transport_middleware.py,sha256=VG1rWyuh-O2pdc0kQ3SADFvyh286o5Wrnkt8OFQ0WQw,4274
23
23
  mcp_proxy_adapter/api/middleware/unified_security.py,sha256=PMbJxVzGNlb-IPAqvIeEo1st-jykYX9Mns6lXIfdtAE,7764
24
24
  mcp_proxy_adapter/api/middleware/user_info_middleware.py,sha256=94oItW3uyNhLvp6p1Sl7EhY_gC4MqrbR9KyAJWreTwk,10326
@@ -137,8 +137,8 @@ mcp_proxy_adapter/schemas/base_schema.json,sha256=v9G9cGMd4dRhCZsOQ_FMqOi5VFyVbI
137
137
  mcp_proxy_adapter/schemas/openapi_schema.json,sha256=C3yLkwmDsvnLW9B5gnKKdBGl4zxkeU-rEmjTrNVsQU0,8405
138
138
  mcp_proxy_adapter/utils/config_generator.py,sha256=UXxuxxAyKTesAS3DOofQ26e20v771inA7EfBV8PZD1c,47543
139
139
  mcp_proxy_adapter_issue_package/demonstrate_issue.py,sha256=O54fwWQvUAjEGiHhQGm1JLnARkhVCwAqjBk_89HyRbY,7894
140
- mcp_proxy_adapter-6.3.23.dist-info/METADATA,sha256=ANw-yWKRXnyrro6xp_eYtwxIvqlCasWLQ1KLj-IIibI,22266
141
- mcp_proxy_adapter-6.3.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
142
- mcp_proxy_adapter-6.3.23.dist-info/entry_points.txt,sha256=J3eV6ID0lt_VSp4lIdIgBFTqLCThgObNNxRCbyfiMHw,70
143
- mcp_proxy_adapter-6.3.23.dist-info/top_level.txt,sha256=CHk-Mc-AxjO-tRheegA2qLiQnU4vZRnxuTF81So6SAc,50
144
- mcp_proxy_adapter-6.3.23.dist-info/RECORD,,
140
+ mcp_proxy_adapter-6.3.25.dist-info/METADATA,sha256=zXHgrlMFdhZK4po4Gq3CsAh_dCMrE7WgL8YgHzODD8U,22266
141
+ mcp_proxy_adapter-6.3.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
142
+ mcp_proxy_adapter-6.3.25.dist-info/entry_points.txt,sha256=J3eV6ID0lt_VSp4lIdIgBFTqLCThgObNNxRCbyfiMHw,70
143
+ mcp_proxy_adapter-6.3.25.dist-info/top_level.txt,sha256=CHk-Mc-AxjO-tRheegA2qLiQnU4vZRnxuTF81So6SAc,50
144
+ mcp_proxy_adapter-6.3.25.dist-info/RECORD,,