mcp-mesh 0.7.20__py3-none-any.whl → 0.8.0__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 +13 -15
- _mcp_mesh/engine/http_wrapper.py +69 -10
- _mcp_mesh/engine/mesh_llm_agent.py +29 -10
- _mcp_mesh/engine/mesh_llm_agent_injector.py +77 -41
- _mcp_mesh/engine/provider_handlers/__init__.py +14 -1
- _mcp_mesh/engine/provider_handlers/base_provider_handler.py +114 -8
- _mcp_mesh/engine/provider_handlers/claude_handler.py +15 -57
- _mcp_mesh/engine/provider_handlers/gemini_handler.py +181 -0
- _mcp_mesh/engine/provider_handlers/openai_handler.py +8 -63
- _mcp_mesh/engine/provider_handlers/provider_handler_registry.py +16 -10
- _mcp_mesh/engine/response_parser.py +61 -15
- _mcp_mesh/engine/signature_analyzer.py +58 -68
- _mcp_mesh/engine/unified_mcp_proxy.py +19 -35
- _mcp_mesh/pipeline/__init__.py +9 -20
- _mcp_mesh/pipeline/api_heartbeat/__init__.py +12 -7
- _mcp_mesh/pipeline/api_heartbeat/api_lifespan_integration.py +23 -49
- _mcp_mesh/pipeline/api_heartbeat/rust_api_heartbeat.py +429 -0
- _mcp_mesh/pipeline/api_startup/api_pipeline.py +7 -9
- _mcp_mesh/pipeline/api_startup/api_server_setup.py +91 -70
- _mcp_mesh/pipeline/api_startup/fastapi_discovery.py +22 -23
- _mcp_mesh/pipeline/api_startup/middleware_integration.py +32 -24
- _mcp_mesh/pipeline/api_startup/route_collection.py +2 -4
- _mcp_mesh/pipeline/mcp_heartbeat/__init__.py +5 -17
- _mcp_mesh/pipeline/mcp_heartbeat/rust_heartbeat.py +710 -0
- _mcp_mesh/pipeline/mcp_startup/__init__.py +2 -5
- _mcp_mesh/pipeline/mcp_startup/configuration.py +1 -1
- _mcp_mesh/pipeline/mcp_startup/fastapiserver_setup.py +31 -8
- _mcp_mesh/pipeline/mcp_startup/heartbeat_loop.py +6 -7
- _mcp_mesh/pipeline/mcp_startup/startup_orchestrator.py +23 -11
- _mcp_mesh/pipeline/mcp_startup/startup_pipeline.py +3 -8
- _mcp_mesh/pipeline/shared/mesh_pipeline.py +0 -2
- _mcp_mesh/reload.py +1 -3
- _mcp_mesh/shared/__init__.py +2 -8
- _mcp_mesh/shared/config_resolver.py +124 -80
- _mcp_mesh/shared/defaults.py +89 -14
- _mcp_mesh/shared/fastapi_middleware_manager.py +149 -91
- _mcp_mesh/shared/host_resolver.py +8 -46
- _mcp_mesh/shared/server_discovery.py +115 -86
- _mcp_mesh/shared/simple_shutdown.py +44 -86
- _mcp_mesh/tracing/execution_tracer.py +2 -6
- _mcp_mesh/tracing/redis_metadata_publisher.py +24 -79
- _mcp_mesh/tracing/trace_context_helper.py +3 -13
- _mcp_mesh/tracing/utils.py +29 -15
- _mcp_mesh/utils/fastmcp_schema_extractor.py +5 -4
- {mcp_mesh-0.7.20.dist-info → mcp_mesh-0.8.0.dist-info}/METADATA +7 -5
- mcp_mesh-0.8.0.dist-info/RECORD +85 -0
- mesh/__init__.py +12 -1
- mesh/decorators.py +248 -33
- mesh/helpers.py +52 -0
- mesh/types.py +40 -13
- _mcp_mesh/generated/.openapi-generator/FILES +0 -50
- _mcp_mesh/generated/.openapi-generator/VERSION +0 -1
- _mcp_mesh/generated/.openapi-generator-ignore +0 -15
- _mcp_mesh/generated/mcp_mesh_registry_client/__init__.py +0 -90
- _mcp_mesh/generated/mcp_mesh_registry_client/api/__init__.py +0 -6
- _mcp_mesh/generated/mcp_mesh_registry_client/api/agents_api.py +0 -1088
- _mcp_mesh/generated/mcp_mesh_registry_client/api/health_api.py +0 -764
- _mcp_mesh/generated/mcp_mesh_registry_client/api/tracing_api.py +0 -303
- _mcp_mesh/generated/mcp_mesh_registry_client/api_client.py +0 -798
- _mcp_mesh/generated/mcp_mesh_registry_client/api_response.py +0 -21
- _mcp_mesh/generated/mcp_mesh_registry_client/configuration.py +0 -577
- _mcp_mesh/generated/mcp_mesh_registry_client/exceptions.py +0 -217
- _mcp_mesh/generated/mcp_mesh_registry_client/models/__init__.py +0 -55
- _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_info.py +0 -158
- _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata.py +0 -126
- _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata_dependencies_inner.py +0 -139
- _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata_dependencies_inner_one_of.py +0 -92
- _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_registration.py +0 -103
- _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_registration_metadata.py +0 -136
- _mcp_mesh/generated/mcp_mesh_registry_client/models/agents_list_response.py +0 -100
- _mcp_mesh/generated/mcp_mesh_registry_client/models/capability_info.py +0 -107
- _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_agent_metadata.py +0 -112
- _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_agent_request.py +0 -103
- _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_info.py +0 -105
- _mcp_mesh/generated/mcp_mesh_registry_client/models/dependency_info.py +0 -103
- _mcp_mesh/generated/mcp_mesh_registry_client/models/dependency_resolution_info.py +0 -106
- _mcp_mesh/generated/mcp_mesh_registry_client/models/error_response.py +0 -91
- _mcp_mesh/generated/mcp_mesh_registry_client/models/health_response.py +0 -103
- _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_request.py +0 -101
- _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_request_metadata.py +0 -111
- _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_response.py +0 -117
- _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_provider.py +0 -93
- _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_provider_resolution_info.py +0 -106
- _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter.py +0 -109
- _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter_filter_inner.py +0 -139
- _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter_filter_inner_one_of.py +0 -91
- _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_info.py +0 -101
- _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_resolution_info.py +0 -120
- _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_agent_register_metadata.py +0 -112
- _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_agent_registration.py +0 -129
- _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_registration_response.py +0 -153
- _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_registration_response_dependencies_resolved_value_inner.py +0 -101
- _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_dependency_registration.py +0 -93
- _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_register_metadata.py +0 -107
- _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_registration.py +0 -117
- _mcp_mesh/generated/mcp_mesh_registry_client/models/registration_response.py +0 -119
- _mcp_mesh/generated/mcp_mesh_registry_client/models/resolved_llm_provider.py +0 -110
- _mcp_mesh/generated/mcp_mesh_registry_client/models/rich_dependency.py +0 -93
- _mcp_mesh/generated/mcp_mesh_registry_client/models/root_response.py +0 -92
- _mcp_mesh/generated/mcp_mesh_registry_client/models/standardized_dependency.py +0 -93
- _mcp_mesh/generated/mcp_mesh_registry_client/models/trace_event.py +0 -106
- _mcp_mesh/generated/mcp_mesh_registry_client/py.typed +0 -0
- _mcp_mesh/generated/mcp_mesh_registry_client/rest.py +0 -259
- _mcp_mesh/pipeline/api_heartbeat/api_dependency_resolution.py +0 -418
- _mcp_mesh/pipeline/api_heartbeat/api_fast_heartbeat_check.py +0 -117
- _mcp_mesh/pipeline/api_heartbeat/api_health_check.py +0 -140
- _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_orchestrator.py +0 -247
- _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_pipeline.py +0 -311
- _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_send.py +0 -386
- _mcp_mesh/pipeline/api_heartbeat/api_registry_connection.py +0 -104
- _mcp_mesh/pipeline/mcp_heartbeat/dependency_resolution.py +0 -396
- _mcp_mesh/pipeline/mcp_heartbeat/fast_heartbeat_check.py +0 -116
- _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_orchestrator.py +0 -311
- _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_pipeline.py +0 -282
- _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_send.py +0 -98
- _mcp_mesh/pipeline/mcp_heartbeat/lifespan_integration.py +0 -84
- _mcp_mesh/pipeline/mcp_heartbeat/llm_tools_resolution.py +0 -264
- _mcp_mesh/pipeline/mcp_heartbeat/registry_connection.py +0 -79
- _mcp_mesh/pipeline/shared/registry_connection.py +0 -80
- _mcp_mesh/shared/registry_client_wrapper.py +0 -515
- mcp_mesh-0.7.20.dist-info/RECORD +0 -152
- {mcp_mesh-0.7.20.dist-info → mcp_mesh-0.8.0.dist-info}/WHEEL +0 -0
- {mcp_mesh-0.7.20.dist-info → mcp_mesh-0.8.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,217 +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
|
-
from typing import Any, Optional
|
|
16
|
-
from typing_extensions import Self
|
|
17
|
-
|
|
18
|
-
class OpenApiException(Exception):
|
|
19
|
-
"""The base exception class for all OpenAPIExceptions"""
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class ApiTypeError(OpenApiException, TypeError):
|
|
23
|
-
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
24
|
-
key_type=None) -> None:
|
|
25
|
-
""" Raises an exception for TypeErrors
|
|
26
|
-
|
|
27
|
-
Args:
|
|
28
|
-
msg (str): the exception message
|
|
29
|
-
|
|
30
|
-
Keyword Args:
|
|
31
|
-
path_to_item (list): a list of keys an indices to get to the
|
|
32
|
-
current_item
|
|
33
|
-
None if unset
|
|
34
|
-
valid_classes (tuple): the primitive classes that current item
|
|
35
|
-
should be an instance of
|
|
36
|
-
None if unset
|
|
37
|
-
key_type (bool): False if our value is a value in a dict
|
|
38
|
-
True if it is a key in a dict
|
|
39
|
-
False if our item is an item in a list
|
|
40
|
-
None if unset
|
|
41
|
-
"""
|
|
42
|
-
self.path_to_item = path_to_item
|
|
43
|
-
self.valid_classes = valid_classes
|
|
44
|
-
self.key_type = key_type
|
|
45
|
-
full_msg = msg
|
|
46
|
-
if path_to_item:
|
|
47
|
-
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
48
|
-
super(ApiTypeError, self).__init__(full_msg)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class ApiValueError(OpenApiException, ValueError):
|
|
52
|
-
def __init__(self, msg, path_to_item=None) -> None:
|
|
53
|
-
"""
|
|
54
|
-
Args:
|
|
55
|
-
msg (str): the exception message
|
|
56
|
-
|
|
57
|
-
Keyword Args:
|
|
58
|
-
path_to_item (list) the path to the exception in the
|
|
59
|
-
received_data dict. None if unset
|
|
60
|
-
"""
|
|
61
|
-
|
|
62
|
-
self.path_to_item = path_to_item
|
|
63
|
-
full_msg = msg
|
|
64
|
-
if path_to_item:
|
|
65
|
-
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
66
|
-
super(ApiValueError, self).__init__(full_msg)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class ApiAttributeError(OpenApiException, AttributeError):
|
|
70
|
-
def __init__(self, msg, path_to_item=None) -> None:
|
|
71
|
-
"""
|
|
72
|
-
Raised when an attribute reference or assignment fails.
|
|
73
|
-
|
|
74
|
-
Args:
|
|
75
|
-
msg (str): the exception message
|
|
76
|
-
|
|
77
|
-
Keyword Args:
|
|
78
|
-
path_to_item (None/list) the path to the exception in the
|
|
79
|
-
received_data dict
|
|
80
|
-
"""
|
|
81
|
-
self.path_to_item = path_to_item
|
|
82
|
-
full_msg = msg
|
|
83
|
-
if path_to_item:
|
|
84
|
-
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
85
|
-
super(ApiAttributeError, self).__init__(full_msg)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class ApiKeyError(OpenApiException, KeyError):
|
|
89
|
-
def __init__(self, msg, path_to_item=None) -> None:
|
|
90
|
-
"""
|
|
91
|
-
Args:
|
|
92
|
-
msg (str): the exception message
|
|
93
|
-
|
|
94
|
-
Keyword Args:
|
|
95
|
-
path_to_item (None/list) the path to the exception in the
|
|
96
|
-
received_data dict
|
|
97
|
-
"""
|
|
98
|
-
self.path_to_item = path_to_item
|
|
99
|
-
full_msg = msg
|
|
100
|
-
if path_to_item:
|
|
101
|
-
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
102
|
-
super(ApiKeyError, self).__init__(full_msg)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
class ApiException(OpenApiException):
|
|
106
|
-
|
|
107
|
-
def __init__(
|
|
108
|
-
self,
|
|
109
|
-
status=None,
|
|
110
|
-
reason=None,
|
|
111
|
-
http_resp=None,
|
|
112
|
-
*,
|
|
113
|
-
body: Optional[str] = None,
|
|
114
|
-
data: Optional[Any] = None,
|
|
115
|
-
) -> None:
|
|
116
|
-
self.status = status
|
|
117
|
-
self.reason = reason
|
|
118
|
-
self.body = body
|
|
119
|
-
self.data = data
|
|
120
|
-
self.headers = None
|
|
121
|
-
|
|
122
|
-
if http_resp:
|
|
123
|
-
if self.status is None:
|
|
124
|
-
self.status = http_resp.status
|
|
125
|
-
if self.reason is None:
|
|
126
|
-
self.reason = http_resp.reason
|
|
127
|
-
if self.body is None:
|
|
128
|
-
try:
|
|
129
|
-
self.body = http_resp.data.decode('utf-8')
|
|
130
|
-
except Exception:
|
|
131
|
-
pass
|
|
132
|
-
self.headers = http_resp.getheaders()
|
|
133
|
-
|
|
134
|
-
@classmethod
|
|
135
|
-
def from_response(
|
|
136
|
-
cls,
|
|
137
|
-
*,
|
|
138
|
-
http_resp,
|
|
139
|
-
body: Optional[str],
|
|
140
|
-
data: Optional[Any],
|
|
141
|
-
) -> Self:
|
|
142
|
-
if http_resp.status == 400:
|
|
143
|
-
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
144
|
-
|
|
145
|
-
if http_resp.status == 401:
|
|
146
|
-
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
147
|
-
|
|
148
|
-
if http_resp.status == 403:
|
|
149
|
-
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
150
|
-
|
|
151
|
-
if http_resp.status == 404:
|
|
152
|
-
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
153
|
-
|
|
154
|
-
# Added new conditions for 409 and 422
|
|
155
|
-
if http_resp.status == 409:
|
|
156
|
-
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
157
|
-
|
|
158
|
-
if http_resp.status == 422:
|
|
159
|
-
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
160
|
-
|
|
161
|
-
if 500 <= http_resp.status <= 599:
|
|
162
|
-
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
163
|
-
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
164
|
-
|
|
165
|
-
def __str__(self):
|
|
166
|
-
"""Custom error messages for exception"""
|
|
167
|
-
error_message = "({0})\n"\
|
|
168
|
-
"Reason: {1}\n".format(self.status, self.reason)
|
|
169
|
-
if self.headers:
|
|
170
|
-
error_message += "HTTP response headers: {0}\n".format(
|
|
171
|
-
self.headers)
|
|
172
|
-
|
|
173
|
-
if self.data or self.body:
|
|
174
|
-
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
|
175
|
-
|
|
176
|
-
return error_message
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
class BadRequestException(ApiException):
|
|
180
|
-
pass
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
class NotFoundException(ApiException):
|
|
184
|
-
pass
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
class UnauthorizedException(ApiException):
|
|
188
|
-
pass
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
class ForbiddenException(ApiException):
|
|
192
|
-
pass
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
class ServiceException(ApiException):
|
|
196
|
-
pass
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
class ConflictException(ApiException):
|
|
200
|
-
"""Exception for HTTP 409 Conflict."""
|
|
201
|
-
pass
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
class UnprocessableEntityException(ApiException):
|
|
205
|
-
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
206
|
-
pass
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
def render_path(path_to_item):
|
|
210
|
-
"""Returns a string representation of a path"""
|
|
211
|
-
result = ""
|
|
212
|
-
for pth in path_to_item:
|
|
213
|
-
if isinstance(pth, int):
|
|
214
|
-
result += "[{0}]".format(pth)
|
|
215
|
-
else:
|
|
216
|
-
result += "['{0}']".format(pth)
|
|
217
|
-
return result
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
|
|
3
|
-
# flake8: noqa
|
|
4
|
-
"""
|
|
5
|
-
MCP Mesh Registry API
|
|
6
|
-
|
|
7
|
-
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
|
|
8
|
-
|
|
9
|
-
The version of the OpenAPI document: 1.0.0
|
|
10
|
-
Contact: dhyanraj@gmail.com
|
|
11
|
-
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
12
|
-
|
|
13
|
-
Do not edit the class manually.
|
|
14
|
-
""" # noqa: E501
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# import models into model package
|
|
18
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.agent_info import AgentInfo
|
|
19
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.agent_metadata import AgentMetadata
|
|
20
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.agent_metadata_dependencies_inner import AgentMetadataDependenciesInner
|
|
21
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.agent_metadata_dependencies_inner_one_of import AgentMetadataDependenciesInnerOneOf
|
|
22
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.agent_registration import AgentRegistration
|
|
23
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.agent_registration_metadata import AgentRegistrationMetadata
|
|
24
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.agents_list_response import AgentsListResponse
|
|
25
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.capability_info import CapabilityInfo
|
|
26
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.decorator_agent_metadata import DecoratorAgentMetadata
|
|
27
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.decorator_agent_request import DecoratorAgentRequest
|
|
28
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.decorator_info import DecoratorInfo
|
|
29
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.dependency_info import DependencyInfo
|
|
30
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.dependency_resolution_info import DependencyResolutionInfo
|
|
31
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.error_response import ErrorResponse
|
|
32
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.health_response import HealthResponse
|
|
33
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.heartbeat_request import HeartbeatRequest
|
|
34
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.heartbeat_request_metadata import HeartbeatRequestMetadata
|
|
35
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.heartbeat_response import HeartbeatResponse
|
|
36
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.llm_provider import LLMProvider
|
|
37
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.llm_provider_resolution_info import LLMProviderResolutionInfo
|
|
38
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.llm_tool_filter import LLMToolFilter
|
|
39
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.llm_tool_filter_filter_inner import LLMToolFilterFilterInner
|
|
40
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.llm_tool_filter_filter_inner_one_of import LLMToolFilterFilterInnerOneOf
|
|
41
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.llm_tool_info import LLMToolInfo
|
|
42
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.llm_tool_resolution_info import LLMToolResolutionInfo
|
|
43
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_agent_register_metadata import MeshAgentRegisterMetadata
|
|
44
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_agent_registration import MeshAgentRegistration
|
|
45
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_registration_response import MeshRegistrationResponse
|
|
46
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_registration_response_dependencies_resolved_value_inner import MeshRegistrationResponseDependenciesResolvedValueInner
|
|
47
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_tool_dependency_registration import MeshToolDependencyRegistration
|
|
48
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_tool_register_metadata import MeshToolRegisterMetadata
|
|
49
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_tool_registration import MeshToolRegistration
|
|
50
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.registration_response import RegistrationResponse
|
|
51
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.resolved_llm_provider import ResolvedLLMProvider
|
|
52
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.rich_dependency import RichDependency
|
|
53
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.root_response import RootResponse
|
|
54
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.standardized_dependency import StandardizedDependency
|
|
55
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.trace_event import TraceEvent
|
|
@@ -1,158 +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
|
-
|
|
16
|
-
from __future__ import annotations
|
|
17
|
-
import pprint
|
|
18
|
-
import re # noqa: F401
|
|
19
|
-
import json
|
|
20
|
-
|
|
21
|
-
from datetime import datetime
|
|
22
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
23
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
|
-
from typing_extensions import Annotated
|
|
25
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.capability_info import CapabilityInfo
|
|
26
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.dependency_resolution_info import DependencyResolutionInfo
|
|
27
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.llm_provider_resolution_info import LLMProviderResolutionInfo
|
|
28
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.llm_tool_resolution_info import LLMToolResolutionInfo
|
|
29
|
-
from typing import Optional, Set
|
|
30
|
-
from typing_extensions import Self
|
|
31
|
-
|
|
32
|
-
class AgentInfo(BaseModel):
|
|
33
|
-
"""
|
|
34
|
-
AgentInfo
|
|
35
|
-
""" # noqa: E501
|
|
36
|
-
id: StrictStr
|
|
37
|
-
name: StrictStr
|
|
38
|
-
agent_type: StrictStr = Field(description="Type of service - mcp_agent provides capabilities, api consumes them")
|
|
39
|
-
status: StrictStr
|
|
40
|
-
endpoint: StrictStr
|
|
41
|
-
capabilities: List[CapabilityInfo]
|
|
42
|
-
total_dependencies: Annotated[int, Field(strict=True, ge=0)] = Field(description="Total number of dependencies required by this agent")
|
|
43
|
-
dependencies_resolved: Annotated[int, Field(strict=True, ge=0)] = Field(description="Number of dependencies that have been resolved")
|
|
44
|
-
dependency_resolutions: Optional[List[DependencyResolutionInfo]] = Field(default=None, description="List of all dependency resolutions (both resolved and unresolved)")
|
|
45
|
-
llm_tool_resolutions: Optional[List[LLMToolResolutionInfo]] = Field(default=None, description="List of all LLM tool resolutions for @mesh.llm filter")
|
|
46
|
-
llm_provider_resolutions: Optional[List[LLMProviderResolutionInfo]] = Field(default=None, description="List of all LLM provider resolutions for @mesh.llm provider")
|
|
47
|
-
last_seen: Optional[datetime] = None
|
|
48
|
-
version: Optional[StrictStr] = None
|
|
49
|
-
__properties: ClassVar[List[str]] = ["id", "name", "agent_type", "status", "endpoint", "capabilities", "total_dependencies", "dependencies_resolved", "dependency_resolutions", "llm_tool_resolutions", "llm_provider_resolutions", "last_seen", "version"]
|
|
50
|
-
|
|
51
|
-
@field_validator('agent_type')
|
|
52
|
-
def agent_type_validate_enum(cls, value):
|
|
53
|
-
"""Validates the enum"""
|
|
54
|
-
if value not in set(['mcp_agent', 'api']):
|
|
55
|
-
raise ValueError("must be one of enum values ('mcp_agent', 'api')")
|
|
56
|
-
return value
|
|
57
|
-
|
|
58
|
-
@field_validator('status')
|
|
59
|
-
def status_validate_enum(cls, value):
|
|
60
|
-
"""Validates the enum"""
|
|
61
|
-
if value not in set(['healthy', 'degraded', 'unhealthy', 'offline']):
|
|
62
|
-
raise ValueError("must be one of enum values ('healthy', 'degraded', 'unhealthy', 'offline')")
|
|
63
|
-
return value
|
|
64
|
-
|
|
65
|
-
model_config = ConfigDict(
|
|
66
|
-
populate_by_name=True,
|
|
67
|
-
validate_assignment=True,
|
|
68
|
-
protected_namespaces=(),
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def to_str(self) -> str:
|
|
73
|
-
"""Returns the string representation of the model using alias"""
|
|
74
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
75
|
-
|
|
76
|
-
def to_json(self) -> str:
|
|
77
|
-
"""Returns the JSON representation of the model using alias"""
|
|
78
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
79
|
-
return json.dumps(self.to_dict())
|
|
80
|
-
|
|
81
|
-
@classmethod
|
|
82
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
83
|
-
"""Create an instance of AgentInfo from a JSON string"""
|
|
84
|
-
return cls.from_dict(json.loads(json_str))
|
|
85
|
-
|
|
86
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
87
|
-
"""Return the dictionary representation of the model using alias.
|
|
88
|
-
|
|
89
|
-
This has the following differences from calling pydantic's
|
|
90
|
-
`self.model_dump(by_alias=True)`:
|
|
91
|
-
|
|
92
|
-
* `None` is only added to the output dict for nullable fields that
|
|
93
|
-
were set at model initialization. Other fields with value `None`
|
|
94
|
-
are ignored.
|
|
95
|
-
"""
|
|
96
|
-
excluded_fields: Set[str] = set([
|
|
97
|
-
])
|
|
98
|
-
|
|
99
|
-
_dict = self.model_dump(
|
|
100
|
-
by_alias=True,
|
|
101
|
-
exclude=excluded_fields,
|
|
102
|
-
exclude_none=True,
|
|
103
|
-
)
|
|
104
|
-
# override the default output from pydantic by calling `to_dict()` of each item in capabilities (list)
|
|
105
|
-
_items = []
|
|
106
|
-
if self.capabilities:
|
|
107
|
-
for _item_capabilities in self.capabilities:
|
|
108
|
-
if _item_capabilities:
|
|
109
|
-
_items.append(_item_capabilities.to_dict())
|
|
110
|
-
_dict['capabilities'] = _items
|
|
111
|
-
# override the default output from pydantic by calling `to_dict()` of each item in dependency_resolutions (list)
|
|
112
|
-
_items = []
|
|
113
|
-
if self.dependency_resolutions:
|
|
114
|
-
for _item_dependency_resolutions in self.dependency_resolutions:
|
|
115
|
-
if _item_dependency_resolutions:
|
|
116
|
-
_items.append(_item_dependency_resolutions.to_dict())
|
|
117
|
-
_dict['dependency_resolutions'] = _items
|
|
118
|
-
# override the default output from pydantic by calling `to_dict()` of each item in llm_tool_resolutions (list)
|
|
119
|
-
_items = []
|
|
120
|
-
if self.llm_tool_resolutions:
|
|
121
|
-
for _item_llm_tool_resolutions in self.llm_tool_resolutions:
|
|
122
|
-
if _item_llm_tool_resolutions:
|
|
123
|
-
_items.append(_item_llm_tool_resolutions.to_dict())
|
|
124
|
-
_dict['llm_tool_resolutions'] = _items
|
|
125
|
-
# override the default output from pydantic by calling `to_dict()` of each item in llm_provider_resolutions (list)
|
|
126
|
-
_items = []
|
|
127
|
-
if self.llm_provider_resolutions:
|
|
128
|
-
for _item_llm_provider_resolutions in self.llm_provider_resolutions:
|
|
129
|
-
if _item_llm_provider_resolutions:
|
|
130
|
-
_items.append(_item_llm_provider_resolutions.to_dict())
|
|
131
|
-
_dict['llm_provider_resolutions'] = _items
|
|
132
|
-
return _dict
|
|
133
|
-
|
|
134
|
-
@classmethod
|
|
135
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
136
|
-
"""Create an instance of AgentInfo from a dict"""
|
|
137
|
-
if obj is None:
|
|
138
|
-
return None
|
|
139
|
-
|
|
140
|
-
if not isinstance(obj, dict):
|
|
141
|
-
return cls.model_validate(obj)
|
|
142
|
-
|
|
143
|
-
_obj = cls.model_validate({
|
|
144
|
-
"id": obj.get("id"),
|
|
145
|
-
"name": obj.get("name"),
|
|
146
|
-
"agent_type": obj.get("agent_type"),
|
|
147
|
-
"status": obj.get("status"),
|
|
148
|
-
"endpoint": obj.get("endpoint"),
|
|
149
|
-
"capabilities": [CapabilityInfo.from_dict(_item) for _item in obj["capabilities"]] if obj.get("capabilities") is not None else None,
|
|
150
|
-
"total_dependencies": obj.get("total_dependencies"),
|
|
151
|
-
"dependencies_resolved": obj.get("dependencies_resolved"),
|
|
152
|
-
"dependency_resolutions": [DependencyResolutionInfo.from_dict(_item) for _item in obj["dependency_resolutions"]] if obj.get("dependency_resolutions") is not None else None,
|
|
153
|
-
"llm_tool_resolutions": [LLMToolResolutionInfo.from_dict(_item) for _item in obj["llm_tool_resolutions"]] if obj.get("llm_tool_resolutions") is not None else None,
|
|
154
|
-
"llm_provider_resolutions": [LLMProviderResolutionInfo.from_dict(_item) for _item in obj["llm_provider_resolutions"]] if obj.get("llm_provider_resolutions") is not None else None,
|
|
155
|
-
"last_seen": obj.get("last_seen"),
|
|
156
|
-
"version": obj.get("version")
|
|
157
|
-
})
|
|
158
|
-
return _obj
|
|
@@ -1,126 +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
|
-
|
|
16
|
-
from __future__ import annotations
|
|
17
|
-
import pprint
|
|
18
|
-
import re # noqa: F401
|
|
19
|
-
import json
|
|
20
|
-
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
-
from typing_extensions import Annotated
|
|
24
|
-
from _mcp_mesh.generated.mcp_mesh_registry_client.models.agent_metadata_dependencies_inner import AgentMetadataDependenciesInner
|
|
25
|
-
from typing import Optional, Set
|
|
26
|
-
from typing_extensions import Self
|
|
27
|
-
|
|
28
|
-
class AgentMetadata(BaseModel):
|
|
29
|
-
"""
|
|
30
|
-
AgentMetadata
|
|
31
|
-
""" # noqa: E501
|
|
32
|
-
name: Annotated[str, Field(min_length=1, strict=True, max_length=64)] = Field(description="Human-readable agent name")
|
|
33
|
-
agent_type: StrictStr = Field(description="Type of agent")
|
|
34
|
-
namespace: StrictStr = Field(description="Agent namespace for organization")
|
|
35
|
-
endpoint: StrictStr = Field(description="Agent endpoint URL (http://, https://, or stdio://)")
|
|
36
|
-
capabilities: Optional[Annotated[List[StrictStr], Field(min_length=0)]] = Field(default=None, description="List of capabilities provided by agent (0 or more)")
|
|
37
|
-
dependencies: Optional[Annotated[List[AgentMetadataDependenciesInner], Field(min_length=0)]] = Field(default=None, description="List of agent dependencies (0 or more) - supports both simple strings and rich objects")
|
|
38
|
-
health_interval: Optional[Annotated[int, Field(le=3600, strict=True, ge=1)]] = Field(default=30, description="Health check interval in seconds")
|
|
39
|
-
timeout_threshold: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=60, description="Timeout threshold in seconds")
|
|
40
|
-
eviction_threshold: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=120, description="Eviction threshold in seconds")
|
|
41
|
-
version: Optional[StrictStr] = Field(default='1.0.0', description="Agent version")
|
|
42
|
-
description: Optional[StrictStr] = Field(default=None, description="Agent description")
|
|
43
|
-
tags: Optional[List[StrictStr]] = Field(default=None, description="Agent tags for categorization")
|
|
44
|
-
security_context: Optional[StrictStr] = Field(default=None, description="Security context for agent")
|
|
45
|
-
__properties: ClassVar[List[str]] = ["name", "agent_type", "namespace", "endpoint", "capabilities", "dependencies", "health_interval", "timeout_threshold", "eviction_threshold", "version", "description", "tags", "security_context"]
|
|
46
|
-
|
|
47
|
-
@field_validator('agent_type')
|
|
48
|
-
def agent_type_validate_enum(cls, value):
|
|
49
|
-
"""Validates the enum"""
|
|
50
|
-
if value not in set(['mesh_agent', 'mcp_agent', 'system_agent']):
|
|
51
|
-
raise ValueError("must be one of enum values ('mesh_agent', 'mcp_agent', 'system_agent')")
|
|
52
|
-
return value
|
|
53
|
-
|
|
54
|
-
model_config = ConfigDict(
|
|
55
|
-
populate_by_name=True,
|
|
56
|
-
validate_assignment=True,
|
|
57
|
-
protected_namespaces=(),
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
def to_str(self) -> str:
|
|
62
|
-
"""Returns the string representation of the model using alias"""
|
|
63
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
64
|
-
|
|
65
|
-
def to_json(self) -> str:
|
|
66
|
-
"""Returns the JSON representation of the model using alias"""
|
|
67
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
68
|
-
return json.dumps(self.to_dict())
|
|
69
|
-
|
|
70
|
-
@classmethod
|
|
71
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
72
|
-
"""Create an instance of AgentMetadata from a JSON string"""
|
|
73
|
-
return cls.from_dict(json.loads(json_str))
|
|
74
|
-
|
|
75
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
76
|
-
"""Return the dictionary representation of the model using alias.
|
|
77
|
-
|
|
78
|
-
This has the following differences from calling pydantic's
|
|
79
|
-
`self.model_dump(by_alias=True)`:
|
|
80
|
-
|
|
81
|
-
* `None` is only added to the output dict for nullable fields that
|
|
82
|
-
were set at model initialization. Other fields with value `None`
|
|
83
|
-
are ignored.
|
|
84
|
-
"""
|
|
85
|
-
excluded_fields: Set[str] = set([
|
|
86
|
-
])
|
|
87
|
-
|
|
88
|
-
_dict = self.model_dump(
|
|
89
|
-
by_alias=True,
|
|
90
|
-
exclude=excluded_fields,
|
|
91
|
-
exclude_none=True,
|
|
92
|
-
)
|
|
93
|
-
# override the default output from pydantic by calling `to_dict()` of each item in dependencies (list)
|
|
94
|
-
_items = []
|
|
95
|
-
if self.dependencies:
|
|
96
|
-
for _item_dependencies in self.dependencies:
|
|
97
|
-
if _item_dependencies:
|
|
98
|
-
_items.append(_item_dependencies.to_dict())
|
|
99
|
-
_dict['dependencies'] = _items
|
|
100
|
-
return _dict
|
|
101
|
-
|
|
102
|
-
@classmethod
|
|
103
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
104
|
-
"""Create an instance of AgentMetadata from a dict"""
|
|
105
|
-
if obj is None:
|
|
106
|
-
return None
|
|
107
|
-
|
|
108
|
-
if not isinstance(obj, dict):
|
|
109
|
-
return cls.model_validate(obj)
|
|
110
|
-
|
|
111
|
-
_obj = cls.model_validate({
|
|
112
|
-
"name": obj.get("name"),
|
|
113
|
-
"agent_type": obj.get("agent_type"),
|
|
114
|
-
"namespace": obj.get("namespace") if obj.get("namespace") is not None else 'default',
|
|
115
|
-
"endpoint": obj.get("endpoint"),
|
|
116
|
-
"capabilities": obj.get("capabilities"),
|
|
117
|
-
"dependencies": [AgentMetadataDependenciesInner.from_dict(_item) for _item in obj["dependencies"]] if obj.get("dependencies") is not None else None,
|
|
118
|
-
"health_interval": obj.get("health_interval") if obj.get("health_interval") is not None else 30,
|
|
119
|
-
"timeout_threshold": obj.get("timeout_threshold") if obj.get("timeout_threshold") is not None else 60,
|
|
120
|
-
"eviction_threshold": obj.get("eviction_threshold") if obj.get("eviction_threshold") is not None else 120,
|
|
121
|
-
"version": obj.get("version") if obj.get("version") is not None else '1.0.0',
|
|
122
|
-
"description": obj.get("description"),
|
|
123
|
-
"tags": obj.get("tags"),
|
|
124
|
-
"security_context": obj.get("security_context")
|
|
125
|
-
})
|
|
126
|
-
return _obj
|