mcp-mesh 0.7.10__py3-none-any.whl → 0.7.12__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/unified_mcp_proxy.py +25 -2
- _mcp_mesh/shared/logging_config.py +23 -15
- {mcp_mesh-0.7.10.dist-info → mcp_mesh-0.7.12.dist-info}/METADATA +1 -1
- {mcp_mesh-0.7.10.dist-info → mcp_mesh-0.7.12.dist-info}/RECORD +7 -7
- {mcp_mesh-0.7.10.dist-info → mcp_mesh-0.7.12.dist-info}/WHEEL +0 -0
- {mcp_mesh-0.7.10.dist-info → mcp_mesh-0.7.12.dist-info}/licenses/LICENSE +0 -0
_mcp_mesh/__init__.py
CHANGED
|
@@ -100,13 +100,36 @@ class UnifiedMCPProxy:
|
|
|
100
100
|
# Try to get current trace context for header injection
|
|
101
101
|
trace_headers = self._get_trace_headers()
|
|
102
102
|
|
|
103
|
+
# Use stream_timeout for read timeout (default 300s for LLM calls)
|
|
104
|
+
# Note: sse_read_timeout is deprecated, use httpx_client_factory instead
|
|
105
|
+
import httpx
|
|
106
|
+
|
|
107
|
+
def create_httpx_client(**kwargs):
|
|
108
|
+
# Override timeout to use stream_timeout for long-running LLM calls
|
|
109
|
+
kwargs["timeout"] = httpx.Timeout(
|
|
110
|
+
timeout=self.stream_timeout,
|
|
111
|
+
connect=30.0, # 30s for connection
|
|
112
|
+
read=self.stream_timeout, # Long read timeout for SSE streams
|
|
113
|
+
write=30.0, # 30s for writes
|
|
114
|
+
pool=30.0, # 30s for pool
|
|
115
|
+
)
|
|
116
|
+
return httpx.AsyncClient(**kwargs)
|
|
117
|
+
|
|
103
118
|
if trace_headers:
|
|
104
119
|
# Create client with trace headers for distributed tracing
|
|
105
|
-
transport = StreamableHttpTransport(
|
|
120
|
+
transport = StreamableHttpTransport(
|
|
121
|
+
url=endpoint,
|
|
122
|
+
headers=trace_headers,
|
|
123
|
+
httpx_client_factory=create_httpx_client,
|
|
124
|
+
)
|
|
106
125
|
return Client(transport)
|
|
107
126
|
else:
|
|
108
127
|
# Create standard client when no trace context available
|
|
109
|
-
|
|
128
|
+
transport = StreamableHttpTransport(
|
|
129
|
+
url=endpoint,
|
|
130
|
+
httpx_client_factory=create_httpx_client,
|
|
131
|
+
)
|
|
132
|
+
return Client(transport)
|
|
110
133
|
|
|
111
134
|
except ImportError as e:
|
|
112
135
|
# DNS names or FastMCP not available - this will trigger HTTP fallback
|
|
@@ -31,7 +31,11 @@ class SafeStreamHandler(logging.StreamHandler):
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
def configure_logging():
|
|
34
|
-
"""Configure logging based on MCP_MESH_LOG_LEVEL environment variable.
|
|
34
|
+
"""Configure logging based on MCP_MESH_LOG_LEVEL environment variable.
|
|
35
|
+
|
|
36
|
+
Uses allowlist approach: root logger stays at INFO to keep third-party libs quiet,
|
|
37
|
+
only mcp-mesh loggers are elevated to DEBUG when debug mode is enabled.
|
|
38
|
+
"""
|
|
35
39
|
# Get log level from environment, default to INFO
|
|
36
40
|
log_level_str = os.environ.get("MCP_MESH_LOG_LEVEL", "INFO").upper()
|
|
37
41
|
|
|
@@ -53,8 +57,6 @@ def configure_logging():
|
|
|
53
57
|
"1",
|
|
54
58
|
"yes",
|
|
55
59
|
)
|
|
56
|
-
if debug_mode:
|
|
57
|
-
log_level = logging.DEBUG
|
|
58
60
|
|
|
59
61
|
# Clear any existing handlers to avoid conflicts
|
|
60
62
|
root_logger = logging.getLogger()
|
|
@@ -63,23 +65,29 @@ def configure_logging():
|
|
|
63
65
|
|
|
64
66
|
# Configure with safe stream handler for background threads
|
|
65
67
|
handler = SafeStreamHandler(sys.stdout)
|
|
66
|
-
handler.setLevel(
|
|
68
|
+
handler.setLevel(logging.DEBUG) # Handler allows all, loggers filter
|
|
67
69
|
handler.setFormatter(logging.Formatter("%(levelname)-8s %(message)s"))
|
|
68
70
|
|
|
69
71
|
root_logger.addHandler(handler)
|
|
70
|
-
root_logger.setLevel(log_level)
|
|
71
72
|
|
|
72
|
-
#
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
# Root logger always INFO - all third-party libs stay quiet
|
|
74
|
+
# This is the allowlist approach: instead of blocklisting noisy loggers one by one,
|
|
75
|
+
# we keep root at INFO and only elevate mcp-mesh loggers to DEBUG
|
|
76
|
+
root_logger.setLevel(logging.INFO)
|
|
75
77
|
|
|
76
|
-
#
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
# Only MCP Mesh loggers get DEBUG when debug mode is on
|
|
79
|
+
if debug_mode:
|
|
80
|
+
logging.getLogger("mesh").setLevel(logging.DEBUG)
|
|
81
|
+
logging.getLogger("mcp_mesh").setLevel(logging.DEBUG)
|
|
82
|
+
logging.getLogger("_mcp_mesh").setLevel(logging.DEBUG)
|
|
83
|
+
else:
|
|
84
|
+
# Use the configured log level for mcp-mesh loggers
|
|
85
|
+
logging.getLogger("mesh").setLevel(log_level)
|
|
86
|
+
logging.getLogger("mcp_mesh").setLevel(log_level)
|
|
87
|
+
logging.getLogger("_mcp_mesh").setLevel(log_level)
|
|
88
|
+
|
|
89
|
+
# Return the configured level for reference (DEBUG if debug mode, else configured level)
|
|
90
|
+
return logging.DEBUG if debug_mode else log_level
|
|
83
91
|
|
|
84
92
|
|
|
85
93
|
# Configure logging on module import
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mcp-mesh
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.12
|
|
4
4
|
Summary: Kubernetes-native platform for distributed MCP applications
|
|
5
5
|
Project-URL: Homepage, https://github.com/dhyansraj/mcp-mesh
|
|
6
6
|
Project-URL: Documentation, https://github.com/dhyansraj/mcp-mesh/tree/main/docs
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
_mcp_mesh/__init__.py,sha256=
|
|
1
|
+
_mcp_mesh/__init__.py,sha256=w3soaBGglnkpWEdjLZK0RkEEj_6Gt1rvNQnT5rHSH5k,2720
|
|
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/base_injector.py,sha256=qzRLZqFP2VvEFagVovkpdldvDmm3VwPHm6tHwV58a2k,5648
|
|
@@ -18,7 +18,7 @@ _mcp_mesh/engine/session_manager.py,sha256=MCr0_fXBaUjXM51WU5EhDkiGvBdfzYQFVNb9D
|
|
|
18
18
|
_mcp_mesh/engine/signature_analyzer.py,sha256=ftn9XsX0ZHWIaACdjgBVtCuIdqVU_4ST8cvcpzu4HTk,12339
|
|
19
19
|
_mcp_mesh/engine/tool_executor.py,sha256=Bf_9d02EEY9_yHm1p1-5YZ4rY6MPxn4SVpI6-3sm1uo,5456
|
|
20
20
|
_mcp_mesh/engine/tool_schema_builder.py,sha256=SQCxQIrSfdLu9-dLqiFurQLK7dhl0dc0xa0ibaxU-iE,3644
|
|
21
|
-
_mcp_mesh/engine/unified_mcp_proxy.py,sha256=
|
|
21
|
+
_mcp_mesh/engine/unified_mcp_proxy.py,sha256=FG3zwE5Li3Fdx8Rabzogpd4FsYIt13xjXcpU48Zth6c,37778
|
|
22
22
|
_mcp_mesh/engine/provider_handlers/__init__.py,sha256=LLTCOgnuM3dlogbLmrpiMK3oB5L22eAmDC4BfxJ-L2I,593
|
|
23
23
|
_mcp_mesh/engine/provider_handlers/base_provider_handler.py,sha256=J-SPFFFG1eFSUVvfsv7y4EuNM4REjSxaYWC5E_lC6Pc,4195
|
|
24
24
|
_mcp_mesh/engine/provider_handlers/claude_handler.py,sha256=CCmlsWiCfIcgrLbAZzeSnl0g2pq0uDffT8zOj4F-sPQ,15727
|
|
@@ -127,7 +127,7 @@ _mcp_mesh/shared/fast_heartbeat_status.py,sha256=OquEsX9ZTbxY1lIsll0Mbb2KDzSJD76
|
|
|
127
127
|
_mcp_mesh/shared/fastapi_middleware_manager.py,sha256=_h10dSL9mgQstpJW_ZM2cpkU6yTKaYKlZaKXMk2i6IA,14638
|
|
128
128
|
_mcp_mesh/shared/health_check_cache.py,sha256=bEdWMBwubK7W01gRCDcZo9NjVQELY4p42fIreeGahZ4,9399
|
|
129
129
|
_mcp_mesh/shared/host_resolver.py,sha256=ycs6gXnI1zJX5KiqiLJPX5GkHX8r4j8NMHQOlG2J2X8,2964
|
|
130
|
-
_mcp_mesh/shared/logging_config.py,sha256=
|
|
130
|
+
_mcp_mesh/shared/logging_config.py,sha256=UvU9IWESaogUiF1PEzjY8kHw2vTIVZnSubRTeL_Hzfc,3251
|
|
131
131
|
_mcp_mesh/shared/registry_client_wrapper.py,sha256=8x40IzeigI0SFPz44OWgbXCkVrEDgV7N9a8wZ58Lh4Y,21181
|
|
132
132
|
_mcp_mesh/shared/server_discovery.py,sha256=W5nsN-GvEVFD-7XkbMTxh-9FUIEiyWOxP3GYr8GNi3E,13142
|
|
133
133
|
_mcp_mesh/shared/simple_shutdown.py,sha256=jnF1rTR2yR619LZnEjNlu-ZdKlB3PovxKqG0VZ3HDgE,8319
|
|
@@ -145,7 +145,7 @@ mesh/__init__.py,sha256=0zequaBtd_9NLOLsr9sNONuwWa_fT_-G4LnJ1CHTEY0,3808
|
|
|
145
145
|
mesh/decorators.py,sha256=_3yVrEvGHZ5MKX_pf7Zn-vLdOH68iE7o6EIvxKcGOds,57636
|
|
146
146
|
mesh/helpers.py,sha256=2Iquvco5mDl0Qs_FD4rMiI88Q-sjXEkKitsXw2HS4Jc,9878
|
|
147
147
|
mesh/types.py,sha256=9TqbJSxlybLQaPVjugcKwPiIrVnJEzqAOvPRhlX1zmo,15559
|
|
148
|
-
mcp_mesh-0.7.
|
|
149
|
-
mcp_mesh-0.7.
|
|
150
|
-
mcp_mesh-0.7.
|
|
151
|
-
mcp_mesh-0.7.
|
|
148
|
+
mcp_mesh-0.7.12.dist-info/METADATA,sha256=No-OjrsVVHpUkJYbPZdGYHW21Z8FrCZCZ2FipLrr4Xg,4973
|
|
149
|
+
mcp_mesh-0.7.12.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
150
|
+
mcp_mesh-0.7.12.dist-info/licenses/LICENSE,sha256=_EBQHRQThv9FPOLc5eFOUdeeRO0mYwChC7cx60dM1tM,1078
|
|
151
|
+
mcp_mesh-0.7.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|