mcp-mesh 0.5.1__py3-none-any.whl → 0.5.3__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.
- _mcp_mesh/__init__.py +1 -1
- _mcp_mesh/engine/dependency_injector.py +53 -99
- _mcp_mesh/engine/http_wrapper.py +21 -9
- _mcp_mesh/engine/unified_mcp_proxy.py +135 -83
- _mcp_mesh/pipeline/api_startup/api_pipeline.py +8 -5
- _mcp_mesh/pipeline/api_startup/middleware_integration.py +153 -0
- _mcp_mesh/shared/fastapi_middleware_manager.py +371 -0
- _mcp_mesh/tracing/agent_context_helper.py +13 -8
- _mcp_mesh/tracing/context.py +10 -4
- _mcp_mesh/tracing/execution_tracer.py +26 -43
- _mcp_mesh/tracing/fastapi_tracing_middleware.py +204 -0
- _mcp_mesh/tracing/redis_metadata_publisher.py +14 -34
- _mcp_mesh/tracing/trace_context_helper.py +14 -19
- _mcp_mesh/tracing/utils.py +137 -0
- {mcp_mesh-0.5.1.dist-info → mcp_mesh-0.5.3.dist-info}/METADATA +1 -1
- {mcp_mesh-0.5.1.dist-info → mcp_mesh-0.5.3.dist-info}/RECORD +19 -15
- mesh/decorators.py +35 -0
- {mcp_mesh-0.5.1.dist-info → mcp_mesh-0.5.3.dist-info}/WHEEL +0 -0
- {mcp_mesh-0.5.1.dist-info → mcp_mesh-0.5.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
_mcp_mesh/__init__.py,sha256=
|
|
1
|
+
_mcp_mesh/__init__.py,sha256=95AOpJJh3TwzlVQ7Z-TTvxBbHf1iUg0329gSW5RQePo,2646
|
|
2
2
|
_mcp_mesh/engine/__init__.py,sha256=2ennzbo7yJcpkXO9BqN69TruLjJfmJY4Y5VEsG644K4,3630
|
|
3
3
|
_mcp_mesh/engine/async_mcp_client.py,sha256=UcbQjxtgVfeRw6DHTZhAzN1gkcKlTg-lUPEePRPQWAU,6306
|
|
4
4
|
_mcp_mesh/engine/decorator_registry.py,sha256=Dy3de-CQa3T4-BRV5Xx6Ks3s6gvgL-lcxCYLsfrTdX0,19085
|
|
5
|
-
_mcp_mesh/engine/dependency_injector.py,sha256=
|
|
5
|
+
_mcp_mesh/engine/dependency_injector.py,sha256=B1iRxtIXq_z4LnJ6NTs0ZPdEIlijrMJv5KbDpQbq9iw,23752
|
|
6
6
|
_mcp_mesh/engine/full_mcp_proxy.py,sha256=PlRv7GSKqn5riOCqeCVulVdtq3z1Ug76mOkwMsOFHXw,25297
|
|
7
|
-
_mcp_mesh/engine/http_wrapper.py,sha256=
|
|
7
|
+
_mcp_mesh/engine/http_wrapper.py,sha256=PeYR7HkJVX7Hb0W-uYSMO-Y14VqCyrPlWzA6vnwf1Tw,21640
|
|
8
8
|
_mcp_mesh/engine/mcp_client_proxy.py,sha256=eJStwy_VQJexYYD8bOh_m4Ld3Bb8Ae_dt8N1CC41qBc,17625
|
|
9
9
|
_mcp_mesh/engine/self_dependency_proxy.py,sha256=OkKt0-B_ADnJlWtHiHItoZCBZ7Su0iz2unEPFfXvrs4,3302
|
|
10
10
|
_mcp_mesh/engine/session_aware_client.py,sha256=mc9eh-aCvUvfllORiXTf_X8_jPqV-32QdWKlr8tHLkU,10600
|
|
11
11
|
_mcp_mesh/engine/session_manager.py,sha256=MCr0_fXBaUjXM51WU5EhDkiGvBdfzYQFVNb9DCXXL0A,10418
|
|
12
12
|
_mcp_mesh/engine/signature_analyzer.py,sha256=AxBuFq8_TCT2afw_XDF4AjWPqdG6ST5jfbw2BDdp9Mo,7482
|
|
13
|
-
_mcp_mesh/engine/unified_mcp_proxy.py,sha256=
|
|
13
|
+
_mcp_mesh/engine/unified_mcp_proxy.py,sha256=lBopm2hG-E2clcAx3lDGy1L-xm9BOUsgg0X6ZpxXGt0,35293
|
|
14
14
|
_mcp_mesh/generated/.openapi-generator-ignore,sha256=-d-Y-RVAZRrHw36jO0b79oDXpfA8rZdBGPCG4Vs_rUs,227
|
|
15
15
|
_mcp_mesh/generated/.openapi-generator/FILES,sha256=BXFXHe4FTV5GFUTNjMhmvOrVcYVlHJc5O-3UXyp8OCY,2169
|
|
16
16
|
_mcp_mesh/generated/.openapi-generator/VERSION,sha256=nMm490YXJUW3_vAdeAsg7E3yRgUqVwk5-50PuaFonM8,7
|
|
@@ -66,9 +66,10 @@ _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_send.py,sha256=0Qy6zau_3a2qtQdd2w
|
|
|
66
66
|
_mcp_mesh/pipeline/api_heartbeat/api_lifespan_integration.py,sha256=WBo2crcaGfxi8Q46TU-i5OMhAv0sQKz7Z9jps-GLkvM,5183
|
|
67
67
|
_mcp_mesh/pipeline/api_heartbeat/api_registry_connection.py,sha256=6N0JdXdnLkaXau4t8syt9DLgv9Y51SPfTXYK3DefBk8,3846
|
|
68
68
|
_mcp_mesh/pipeline/api_startup/__init__.py,sha256=eivolkSKot2bJTWP2BV8-RKRT1Zm7SGQYuEUiTxusOQ,577
|
|
69
|
-
_mcp_mesh/pipeline/api_startup/api_pipeline.py,sha256=
|
|
69
|
+
_mcp_mesh/pipeline/api_startup/api_pipeline.py,sha256=w4m7LP7qnpLxYYWy4moa_8inAWFT0jWy9i7G9WGWOCM,2546
|
|
70
70
|
_mcp_mesh/pipeline/api_startup/api_server_setup.py,sha256=Qy0wbXyIWIQYA7CjiGVZwn0nWCKK85ZzFTRI2JDA9Aw,15099
|
|
71
71
|
_mcp_mesh/pipeline/api_startup/fastapi_discovery.py,sha256=BOo7_cBwABNpk_3Y-Lh_3ygwAOQ_254dwblPyO_vLIw,11991
|
|
72
|
+
_mcp_mesh/pipeline/api_startup/middleware_integration.py,sha256=ybImXZlmIR6yA-wYg5Zy_ZMFF9YgToLkk4jnBeZJ7WY,6267
|
|
72
73
|
_mcp_mesh/pipeline/api_startup/route_collection.py,sha256=UjA-F5_RbGVU5TfDT19Np5_x2PtYkNn2mGFyivDsk24,2031
|
|
73
74
|
_mcp_mesh/pipeline/api_startup/route_integration.py,sha256=aMT7p7cwK8N3tZBRqeGQF8upc7tU-Exj6Dz0a4cSBhU,13441
|
|
74
75
|
_mcp_mesh/pipeline/mcp_heartbeat/__init__.py,sha256=nRNjZ3VD_9bPLQuJ6Nc02gE7KSLcMP7TMquB0hP6hHs,844
|
|
@@ -98,20 +99,23 @@ _mcp_mesh/shared/config_resolver.py,sha256=r8WcO8lrd4XBHhH9IkAM7iy-QeCmTiVLmKhnJ
|
|
|
98
99
|
_mcp_mesh/shared/content_extractor.py,sha256=culjhieFl_J6EMDv1VFKvS38O3IMhWMs8fHhNuR2rVk,3656
|
|
99
100
|
_mcp_mesh/shared/defaults.py,sha256=5qazybkn7QHi418dXCS0b6QlNQl3DMg97ItzNGkc8d4,1851
|
|
100
101
|
_mcp_mesh/shared/fast_heartbeat_status.py,sha256=OquEsX9ZTbxY1lIsll0Mbb2KDzSJD76sLMOlr3Z73Sc,5188
|
|
102
|
+
_mcp_mesh/shared/fastapi_middleware_manager.py,sha256=_h10dSL9mgQstpJW_ZM2cpkU6yTKaYKlZaKXMk2i6IA,14638
|
|
101
103
|
_mcp_mesh/shared/host_resolver.py,sha256=ycs6gXnI1zJX5KiqiLJPX5GkHX8r4j8NMHQOlG2J2X8,2964
|
|
102
104
|
_mcp_mesh/shared/logging_config.py,sha256=n9AqShZ5BZgyrkoTlvux6ECRVpM9dUYvmGB0NPMl-Ak,2477
|
|
103
105
|
_mcp_mesh/shared/registry_client_wrapper.py,sha256=d8yL-MiCrQr_WYdRFStOd531qaLv9kZjh0zJAmCJ-Cc,16976
|
|
104
106
|
_mcp_mesh/shared/sse_parser.py,sha256=OEPnfL9xL3rsjQrbyvfUO82WljPSDeO6Z61uUwN1NAo,8035
|
|
105
107
|
_mcp_mesh/shared/support_types.py,sha256=k-ICF_UwDkHxQ1D5LwFZrp-UrNb4E5dzw02CRuLW9iI,7264
|
|
106
|
-
_mcp_mesh/tracing/agent_context_helper.py,sha256=
|
|
107
|
-
_mcp_mesh/tracing/context.py,sha256=
|
|
108
|
-
_mcp_mesh/tracing/execution_tracer.py,sha256=
|
|
109
|
-
_mcp_mesh/tracing/
|
|
110
|
-
_mcp_mesh/tracing/
|
|
108
|
+
_mcp_mesh/tracing/agent_context_helper.py,sha256=BIJ3Kc4Znd6emMAu97aUhSoxSIza3qYUmObLgc9ONiA,4765
|
|
109
|
+
_mcp_mesh/tracing/context.py,sha256=2ozqKEYfx4Qxj64DnbwoVIbMkhNLbaV8BNWtkzAPA7I,2516
|
|
110
|
+
_mcp_mesh/tracing/execution_tracer.py,sha256=lJu7Uk2F4hT8W7ChJbmZUl_6DGvrndGEFes3cnYPZho,7785
|
|
111
|
+
_mcp_mesh/tracing/fastapi_tracing_middleware.py,sha256=o-xyAb1hB_GIFXv0hqUeTwhDDEoFj3_brygmhSComkE,6848
|
|
112
|
+
_mcp_mesh/tracing/redis_metadata_publisher.py,sha256=F78E34qnI3D0tOmbHUTBsLbDst2G7Su2-0F37Rq0rcM,4652
|
|
113
|
+
_mcp_mesh/tracing/trace_context_helper.py,sha256=6tEkwjWFqMBe45zBlhacktmIpzJWTF950ph3bwL3cNc,5994
|
|
114
|
+
_mcp_mesh/tracing/utils.py,sha256=t9lJuTH7CeuzAiiAaD0WxsJMFJPdzZFR0w6-vyR9f2E,3849
|
|
111
115
|
mesh/__init__.py,sha256=l5RSMV8Kx0h7cvku8YkZPbTHjEPWciGT0bcEB2O_eNU,3242
|
|
112
|
-
mesh/decorators.py,sha256=
|
|
116
|
+
mesh/decorators.py,sha256=Ncpov2Up8EW_3n6_uMvKN613BqVWkdfWesd3SoufGDs,25673
|
|
113
117
|
mesh/types.py,sha256=g37DXAzya-xGPa1_WKlW3T3_VqyTn8ZVepIDSrhBTkc,10815
|
|
114
|
-
mcp_mesh-0.5.
|
|
115
|
-
mcp_mesh-0.5.
|
|
116
|
-
mcp_mesh-0.5.
|
|
117
|
-
mcp_mesh-0.5.
|
|
118
|
+
mcp_mesh-0.5.3.dist-info/METADATA,sha256=K0VXGmFhjPWSubquhtkNb7wY5SHMgh3zbyHL_R76nS8,4879
|
|
119
|
+
mcp_mesh-0.5.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
120
|
+
mcp_mesh-0.5.3.dist-info/licenses/LICENSE,sha256=_EBQHRQThv9FPOLc5eFOUdeeRO0mYwChC7cx60dM1tM,1078
|
|
121
|
+
mcp_mesh-0.5.3.dist-info/RECORD,,
|
mesh/decorators.py
CHANGED
|
@@ -577,6 +577,14 @@ def route(
|
|
|
577
577
|
# Register with DecoratorRegistry using custom decorator type
|
|
578
578
|
DecoratorRegistry.register_custom_decorator("mesh_route", target, metadata)
|
|
579
579
|
|
|
580
|
+
# Try to add tracing middleware to any FastAPI apps we can find immediately
|
|
581
|
+
# This ensures middleware is added before the app starts
|
|
582
|
+
try:
|
|
583
|
+
_add_tracing_middleware_immediately()
|
|
584
|
+
except Exception as e:
|
|
585
|
+
# Don't fail decorator application due to middleware issues
|
|
586
|
+
logger.debug(f"Failed to add immediate tracing middleware: {e}")
|
|
587
|
+
|
|
580
588
|
logger.debug(
|
|
581
589
|
f"🔍 Route '{target.__name__}' registered with {len(validated_dependencies)} dependencies"
|
|
582
590
|
)
|
|
@@ -627,3 +635,30 @@ def route(
|
|
|
627
635
|
return target
|
|
628
636
|
|
|
629
637
|
return decorator
|
|
638
|
+
|
|
639
|
+
|
|
640
|
+
def _add_tracing_middleware_immediately():
|
|
641
|
+
"""
|
|
642
|
+
Request tracing middleware injection using monkey-patch approach.
|
|
643
|
+
|
|
644
|
+
This sets up automatic middleware injection for both existing and future
|
|
645
|
+
FastAPI apps, eliminating timing issues with app startup/lifespan.
|
|
646
|
+
"""
|
|
647
|
+
try:
|
|
648
|
+
from _mcp_mesh.shared.fastapi_middleware_manager import get_fastapi_middleware_manager
|
|
649
|
+
|
|
650
|
+
manager = get_fastapi_middleware_manager()
|
|
651
|
+
success = manager.request_middleware_injection()
|
|
652
|
+
|
|
653
|
+
if success:
|
|
654
|
+
logger.debug("🔍 TRACING: Middleware injection setup completed (monkey-patch + discovery)")
|
|
655
|
+
else:
|
|
656
|
+
logger.debug("🔍 TRACING: Middleware injection setup failed")
|
|
657
|
+
|
|
658
|
+
except Exception as e:
|
|
659
|
+
# Never fail decorator application
|
|
660
|
+
logger.debug(f"🔍 TRACING: Middleware injection setup failed: {e}")
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
# Middleware injection is now handled by FastAPIMiddlewareManager
|
|
664
|
+
# in _mcp_mesh.shared.fastapi_middleware_manager
|
|
File without changes
|
|
File without changes
|