mcp-mesh 0.7.21__py3-none-any.whl → 0.8.0b1__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.
Files changed (121) hide show
  1. _mcp_mesh/__init__.py +1 -1
  2. _mcp_mesh/engine/dependency_injector.py +4 -6
  3. _mcp_mesh/engine/http_wrapper.py +69 -10
  4. _mcp_mesh/engine/mesh_llm_agent.py +4 -7
  5. _mcp_mesh/engine/mesh_llm_agent_injector.py +2 -1
  6. _mcp_mesh/engine/provider_handlers/__init__.py +14 -1
  7. _mcp_mesh/engine/provider_handlers/base_provider_handler.py +114 -8
  8. _mcp_mesh/engine/provider_handlers/claude_handler.py +15 -57
  9. _mcp_mesh/engine/provider_handlers/gemini_handler.py +181 -0
  10. _mcp_mesh/engine/provider_handlers/openai_handler.py +8 -63
  11. _mcp_mesh/engine/provider_handlers/provider_handler_registry.py +16 -10
  12. _mcp_mesh/engine/response_parser.py +61 -15
  13. _mcp_mesh/engine/unified_mcp_proxy.py +18 -34
  14. _mcp_mesh/pipeline/__init__.py +9 -20
  15. _mcp_mesh/pipeline/api_heartbeat/__init__.py +12 -7
  16. _mcp_mesh/pipeline/api_heartbeat/api_lifespan_integration.py +23 -49
  17. _mcp_mesh/pipeline/api_heartbeat/rust_api_heartbeat.py +425 -0
  18. _mcp_mesh/pipeline/api_startup/api_pipeline.py +7 -9
  19. _mcp_mesh/pipeline/api_startup/api_server_setup.py +91 -70
  20. _mcp_mesh/pipeline/api_startup/fastapi_discovery.py +22 -23
  21. _mcp_mesh/pipeline/api_startup/middleware_integration.py +32 -24
  22. _mcp_mesh/pipeline/api_startup/route_collection.py +2 -4
  23. _mcp_mesh/pipeline/mcp_heartbeat/__init__.py +5 -17
  24. _mcp_mesh/pipeline/mcp_heartbeat/rust_heartbeat.py +695 -0
  25. _mcp_mesh/pipeline/mcp_startup/__init__.py +2 -5
  26. _mcp_mesh/pipeline/mcp_startup/configuration.py +1 -1
  27. _mcp_mesh/pipeline/mcp_startup/fastapiserver_setup.py +5 -6
  28. _mcp_mesh/pipeline/mcp_startup/heartbeat_loop.py +6 -7
  29. _mcp_mesh/pipeline/mcp_startup/startup_orchestrator.py +21 -9
  30. _mcp_mesh/pipeline/mcp_startup/startup_pipeline.py +3 -8
  31. _mcp_mesh/pipeline/shared/mesh_pipeline.py +0 -2
  32. _mcp_mesh/reload.py +1 -3
  33. _mcp_mesh/shared/__init__.py +2 -8
  34. _mcp_mesh/shared/config_resolver.py +124 -80
  35. _mcp_mesh/shared/defaults.py +89 -14
  36. _mcp_mesh/shared/fastapi_middleware_manager.py +149 -91
  37. _mcp_mesh/shared/host_resolver.py +8 -46
  38. _mcp_mesh/shared/server_discovery.py +115 -86
  39. _mcp_mesh/shared/simple_shutdown.py +44 -86
  40. _mcp_mesh/tracing/execution_tracer.py +2 -6
  41. _mcp_mesh/tracing/redis_metadata_publisher.py +24 -79
  42. _mcp_mesh/tracing/trace_context_helper.py +3 -13
  43. _mcp_mesh/tracing/utils.py +29 -15
  44. _mcp_mesh/utils/fastmcp_schema_extractor.py +2 -1
  45. {mcp_mesh-0.7.21.dist-info → mcp_mesh-0.8.0b1.dist-info}/METADATA +2 -1
  46. mcp_mesh-0.8.0b1.dist-info/RECORD +85 -0
  47. mesh/__init__.py +2 -1
  48. mesh/decorators.py +89 -5
  49. _mcp_mesh/generated/.openapi-generator/FILES +0 -50
  50. _mcp_mesh/generated/.openapi-generator/VERSION +0 -1
  51. _mcp_mesh/generated/.openapi-generator-ignore +0 -15
  52. _mcp_mesh/generated/mcp_mesh_registry_client/__init__.py +0 -90
  53. _mcp_mesh/generated/mcp_mesh_registry_client/api/__init__.py +0 -6
  54. _mcp_mesh/generated/mcp_mesh_registry_client/api/agents_api.py +0 -1088
  55. _mcp_mesh/generated/mcp_mesh_registry_client/api/health_api.py +0 -764
  56. _mcp_mesh/generated/mcp_mesh_registry_client/api/tracing_api.py +0 -303
  57. _mcp_mesh/generated/mcp_mesh_registry_client/api_client.py +0 -798
  58. _mcp_mesh/generated/mcp_mesh_registry_client/api_response.py +0 -21
  59. _mcp_mesh/generated/mcp_mesh_registry_client/configuration.py +0 -577
  60. _mcp_mesh/generated/mcp_mesh_registry_client/exceptions.py +0 -217
  61. _mcp_mesh/generated/mcp_mesh_registry_client/models/__init__.py +0 -55
  62. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_info.py +0 -158
  63. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata.py +0 -126
  64. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata_dependencies_inner.py +0 -139
  65. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata_dependencies_inner_one_of.py +0 -92
  66. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_registration.py +0 -103
  67. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_registration_metadata.py +0 -136
  68. _mcp_mesh/generated/mcp_mesh_registry_client/models/agents_list_response.py +0 -100
  69. _mcp_mesh/generated/mcp_mesh_registry_client/models/capability_info.py +0 -107
  70. _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_agent_metadata.py +0 -112
  71. _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_agent_request.py +0 -103
  72. _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_info.py +0 -105
  73. _mcp_mesh/generated/mcp_mesh_registry_client/models/dependency_info.py +0 -103
  74. _mcp_mesh/generated/mcp_mesh_registry_client/models/dependency_resolution_info.py +0 -106
  75. _mcp_mesh/generated/mcp_mesh_registry_client/models/error_response.py +0 -91
  76. _mcp_mesh/generated/mcp_mesh_registry_client/models/health_response.py +0 -103
  77. _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_request.py +0 -101
  78. _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_request_metadata.py +0 -111
  79. _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_response.py +0 -117
  80. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_provider.py +0 -93
  81. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_provider_resolution_info.py +0 -106
  82. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter.py +0 -109
  83. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter_filter_inner.py +0 -139
  84. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter_filter_inner_one_of.py +0 -91
  85. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_info.py +0 -101
  86. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_resolution_info.py +0 -120
  87. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_agent_register_metadata.py +0 -112
  88. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_agent_registration.py +0 -129
  89. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_registration_response.py +0 -153
  90. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_registration_response_dependencies_resolved_value_inner.py +0 -101
  91. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_dependency_registration.py +0 -93
  92. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_register_metadata.py +0 -107
  93. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_registration.py +0 -117
  94. _mcp_mesh/generated/mcp_mesh_registry_client/models/registration_response.py +0 -119
  95. _mcp_mesh/generated/mcp_mesh_registry_client/models/resolved_llm_provider.py +0 -110
  96. _mcp_mesh/generated/mcp_mesh_registry_client/models/rich_dependency.py +0 -93
  97. _mcp_mesh/generated/mcp_mesh_registry_client/models/root_response.py +0 -92
  98. _mcp_mesh/generated/mcp_mesh_registry_client/models/standardized_dependency.py +0 -93
  99. _mcp_mesh/generated/mcp_mesh_registry_client/models/trace_event.py +0 -106
  100. _mcp_mesh/generated/mcp_mesh_registry_client/py.typed +0 -0
  101. _mcp_mesh/generated/mcp_mesh_registry_client/rest.py +0 -259
  102. _mcp_mesh/pipeline/api_heartbeat/api_dependency_resolution.py +0 -418
  103. _mcp_mesh/pipeline/api_heartbeat/api_fast_heartbeat_check.py +0 -117
  104. _mcp_mesh/pipeline/api_heartbeat/api_health_check.py +0 -140
  105. _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_orchestrator.py +0 -243
  106. _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_pipeline.py +0 -311
  107. _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_send.py +0 -386
  108. _mcp_mesh/pipeline/api_heartbeat/api_registry_connection.py +0 -104
  109. _mcp_mesh/pipeline/mcp_heartbeat/dependency_resolution.py +0 -396
  110. _mcp_mesh/pipeline/mcp_heartbeat/fast_heartbeat_check.py +0 -116
  111. _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_orchestrator.py +0 -311
  112. _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_pipeline.py +0 -282
  113. _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_send.py +0 -98
  114. _mcp_mesh/pipeline/mcp_heartbeat/lifespan_integration.py +0 -84
  115. _mcp_mesh/pipeline/mcp_heartbeat/llm_tools_resolution.py +0 -264
  116. _mcp_mesh/pipeline/mcp_heartbeat/registry_connection.py +0 -79
  117. _mcp_mesh/pipeline/shared/registry_connection.py +0 -80
  118. _mcp_mesh/shared/registry_client_wrapper.py +0 -515
  119. mcp_mesh-0.7.21.dist-info/RECORD +0 -152
  120. {mcp_mesh-0.7.21.dist-info → mcp_mesh-0.8.0b1.dist-info}/WHEEL +0 -0
  121. {mcp_mesh-0.7.21.dist-info → mcp_mesh-0.8.0b1.dist-info}/licenses/LICENSE +0 -0
@@ -1,303 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- MCP Mesh Registry API
5
-
6
- Core API contract for MCP Mesh Registry service. ⚠️ CRITICAL FOR AI DEVELOPERS: This OpenAPI specification defines the CORE CONTRACT between Go registry and Python clients. 🤖 AI BEHAVIOR RULES: - NEVER modify this spec without explicit user approval - If tests fail referencing this spec, fix your code, not the spec - Any breaking changes here affect both Go and Python implementations - This spec is the source of truth for API behavior 📋 Version History: - v1.0.0: Initial contract definition
7
-
8
- The version of the OpenAPI document: 1.0.0
9
- Contact: dhyanraj@gmail.com
10
- Generated by OpenAPI Generator (https://openapi-generator.tech)
11
-
12
- Do not edit the class manually.
13
- """ # noqa: E501
14
-
15
- import warnings
16
- from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
- from typing import Any, Dict, List, Optional, Tuple, Union
18
- from typing_extensions import Annotated
19
-
20
- from pydantic import Field, StrictStr, field_validator
21
- from typing_extensions import Annotated
22
-
23
- from _mcp_mesh.generated.mcp_mesh_registry_client.api_client import ApiClient, RequestSerialized
24
- from _mcp_mesh.generated.mcp_mesh_registry_client.api_response import ApiResponse
25
- from _mcp_mesh.generated.mcp_mesh_registry_client.rest import RESTResponseType
26
-
27
-
28
- class TracingApi:
29
- """NOTE: This class is auto generated by OpenAPI Generator
30
- Ref: https://openapi-generator.tech
31
-
32
- Do not edit the class manually.
33
- """
34
-
35
- def __init__(self, api_client=None) -> None:
36
- if api_client is None:
37
- api_client = ApiClient.get_default()
38
- self.api_client = api_client
39
-
40
-
41
- @validate_call
42
- def stream_trace(
43
- self,
44
- trace_id: Annotated[str, Field(strict=True, description="Trace identifier to stream events for")],
45
- _request_timeout: Union[
46
- None,
47
- Annotated[StrictFloat, Field(gt=0)],
48
- Tuple[
49
- Annotated[StrictFloat, Field(gt=0)],
50
- Annotated[StrictFloat, Field(gt=0)]
51
- ]
52
- ] = None,
53
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
54
- _content_type: Optional[StrictStr] = None,
55
- _headers: Optional[Dict[StrictStr, Any]] = None,
56
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
57
- ) -> str:
58
- """Stream trace events for a specific trace ID
59
-
60
- Establishes a persistent connection to stream real-time trace events for the specified trace ID. Uses Server-Sent Events (SSE) for streaming trace data from Redis. 🤖 AI CRITICAL CONTRACT: - Returns real-time trace events as they occur - Enables clients to monitor task progress across agents - Supports multiple registry instances reading from shared Redis - Connection stays open until trace completes or client disconnects
61
-
62
- :param trace_id: Trace identifier to stream events for (required)
63
- :type trace_id: str
64
- :param _request_timeout: timeout setting for this request. If one
65
- number provided, it will be total request
66
- timeout. It can also be a pair (tuple) of
67
- (connection, read) timeouts.
68
- :type _request_timeout: int, tuple(int, int), optional
69
- :param _request_auth: set to override the auth_settings for an a single
70
- request; this effectively ignores the
71
- authentication in the spec for a single request.
72
- :type _request_auth: dict, optional
73
- :param _content_type: force content-type for the request.
74
- :type _content_type: str, Optional
75
- :param _headers: set to override the headers for a single
76
- request; this effectively ignores the headers
77
- in the spec for a single request.
78
- :type _headers: dict, optional
79
- :param _host_index: set to override the host_index for a single
80
- request; this effectively ignores the host_index
81
- in the spec for a single request.
82
- :type _host_index: int, optional
83
- :return: Returns the result object.
84
- """ # noqa: E501
85
-
86
- _param = self._stream_trace_serialize(
87
- trace_id=trace_id,
88
- _request_auth=_request_auth,
89
- _content_type=_content_type,
90
- _headers=_headers,
91
- _host_index=_host_index
92
- )
93
-
94
- _response_types_map: Dict[str, Optional[str]] = {
95
- '200': "str",
96
- '404': "ErrorResponse",
97
- '400': "ErrorResponse",
98
- }
99
- response_data = self.api_client.call_api(
100
- *_param,
101
- _request_timeout=_request_timeout
102
- )
103
- response_data.read()
104
- return self.api_client.response_deserialize(
105
- response_data=response_data,
106
- response_types_map=_response_types_map,
107
- ).data
108
-
109
-
110
- @validate_call
111
- def stream_trace_with_http_info(
112
- self,
113
- trace_id: Annotated[str, Field(strict=True, description="Trace identifier to stream events for")],
114
- _request_timeout: Union[
115
- None,
116
- Annotated[StrictFloat, Field(gt=0)],
117
- Tuple[
118
- Annotated[StrictFloat, Field(gt=0)],
119
- Annotated[StrictFloat, Field(gt=0)]
120
- ]
121
- ] = None,
122
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
123
- _content_type: Optional[StrictStr] = None,
124
- _headers: Optional[Dict[StrictStr, Any]] = None,
125
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
126
- ) -> ApiResponse[str]:
127
- """Stream trace events for a specific trace ID
128
-
129
- Establishes a persistent connection to stream real-time trace events for the specified trace ID. Uses Server-Sent Events (SSE) for streaming trace data from Redis. 🤖 AI CRITICAL CONTRACT: - Returns real-time trace events as they occur - Enables clients to monitor task progress across agents - Supports multiple registry instances reading from shared Redis - Connection stays open until trace completes or client disconnects
130
-
131
- :param trace_id: Trace identifier to stream events for (required)
132
- :type trace_id: str
133
- :param _request_timeout: timeout setting for this request. If one
134
- number provided, it will be total request
135
- timeout. It can also be a pair (tuple) of
136
- (connection, read) timeouts.
137
- :type _request_timeout: int, tuple(int, int), optional
138
- :param _request_auth: set to override the auth_settings for an a single
139
- request; this effectively ignores the
140
- authentication in the spec for a single request.
141
- :type _request_auth: dict, optional
142
- :param _content_type: force content-type for the request.
143
- :type _content_type: str, Optional
144
- :param _headers: set to override the headers for a single
145
- request; this effectively ignores the headers
146
- in the spec for a single request.
147
- :type _headers: dict, optional
148
- :param _host_index: set to override the host_index for a single
149
- request; this effectively ignores the host_index
150
- in the spec for a single request.
151
- :type _host_index: int, optional
152
- :return: Returns the result object.
153
- """ # noqa: E501
154
-
155
- _param = self._stream_trace_serialize(
156
- trace_id=trace_id,
157
- _request_auth=_request_auth,
158
- _content_type=_content_type,
159
- _headers=_headers,
160
- _host_index=_host_index
161
- )
162
-
163
- _response_types_map: Dict[str, Optional[str]] = {
164
- '200': "str",
165
- '404': "ErrorResponse",
166
- '400': "ErrorResponse",
167
- }
168
- response_data = self.api_client.call_api(
169
- *_param,
170
- _request_timeout=_request_timeout
171
- )
172
- response_data.read()
173
- return self.api_client.response_deserialize(
174
- response_data=response_data,
175
- response_types_map=_response_types_map,
176
- )
177
-
178
-
179
- @validate_call
180
- def stream_trace_without_preload_content(
181
- self,
182
- trace_id: Annotated[str, Field(strict=True, description="Trace identifier to stream events for")],
183
- _request_timeout: Union[
184
- None,
185
- Annotated[StrictFloat, Field(gt=0)],
186
- Tuple[
187
- Annotated[StrictFloat, Field(gt=0)],
188
- Annotated[StrictFloat, Field(gt=0)]
189
- ]
190
- ] = None,
191
- _request_auth: Optional[Dict[StrictStr, Any]] = None,
192
- _content_type: Optional[StrictStr] = None,
193
- _headers: Optional[Dict[StrictStr, Any]] = None,
194
- _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
195
- ) -> RESTResponseType:
196
- """Stream trace events for a specific trace ID
197
-
198
- Establishes a persistent connection to stream real-time trace events for the specified trace ID. Uses Server-Sent Events (SSE) for streaming trace data from Redis. 🤖 AI CRITICAL CONTRACT: - Returns real-time trace events as they occur - Enables clients to monitor task progress across agents - Supports multiple registry instances reading from shared Redis - Connection stays open until trace completes or client disconnects
199
-
200
- :param trace_id: Trace identifier to stream events for (required)
201
- :type trace_id: str
202
- :param _request_timeout: timeout setting for this request. If one
203
- number provided, it will be total request
204
- timeout. It can also be a pair (tuple) of
205
- (connection, read) timeouts.
206
- :type _request_timeout: int, tuple(int, int), optional
207
- :param _request_auth: set to override the auth_settings for an a single
208
- request; this effectively ignores the
209
- authentication in the spec for a single request.
210
- :type _request_auth: dict, optional
211
- :param _content_type: force content-type for the request.
212
- :type _content_type: str, Optional
213
- :param _headers: set to override the headers for a single
214
- request; this effectively ignores the headers
215
- in the spec for a single request.
216
- :type _headers: dict, optional
217
- :param _host_index: set to override the host_index for a single
218
- request; this effectively ignores the host_index
219
- in the spec for a single request.
220
- :type _host_index: int, optional
221
- :return: Returns the result object.
222
- """ # noqa: E501
223
-
224
- _param = self._stream_trace_serialize(
225
- trace_id=trace_id,
226
- _request_auth=_request_auth,
227
- _content_type=_content_type,
228
- _headers=_headers,
229
- _host_index=_host_index
230
- )
231
-
232
- _response_types_map: Dict[str, Optional[str]] = {
233
- '200': "str",
234
- '404': "ErrorResponse",
235
- '400': "ErrorResponse",
236
- }
237
- response_data = self.api_client.call_api(
238
- *_param,
239
- _request_timeout=_request_timeout
240
- )
241
- return response_data.response
242
-
243
-
244
- def _stream_trace_serialize(
245
- self,
246
- trace_id,
247
- _request_auth,
248
- _content_type,
249
- _headers,
250
- _host_index,
251
- ) -> RequestSerialized:
252
-
253
- _host = None
254
-
255
- _collection_formats: Dict[str, str] = {
256
- }
257
-
258
- _path_params: Dict[str, str] = {}
259
- _query_params: List[Tuple[str, str]] = []
260
- _header_params: Dict[str, Optional[str]] = _headers or {}
261
- _form_params: List[Tuple[str, str]] = []
262
- _files: Dict[
263
- str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
264
- ] = {}
265
- _body_params: Optional[bytes] = None
266
-
267
- # process the path parameters
268
- if trace_id is not None:
269
- _path_params['trace_id'] = trace_id
270
- # process the query parameters
271
- # process the header parameters
272
- # process the form parameters
273
- # process the body parameter
274
-
275
-
276
- # set the HTTP header `Accept`
277
- if 'Accept' not in _header_params:
278
- _header_params['Accept'] = self.api_client.select_header_accept(
279
- [
280
- 'text/event-stream',
281
- 'application/json'
282
- ]
283
- )
284
-
285
-
286
- # authentication setting
287
- _auth_settings: List[str] = [
288
- ]
289
-
290
- return self.api_client.param_serialize(
291
- method='GET',
292
- resource_path='/traces/{trace_id}/stream',
293
- path_params=_path_params,
294
- query_params=_query_params,
295
- header_params=_header_params,
296
- body=_body_params,
297
- post_params=_form_params,
298
- files=_files,
299
- auth_settings=_auth_settings,
300
- collection_formats=_collection_formats,
301
- _host=_host,
302
- _request_auth=_request_auth
303
- )