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.
Files changed (124) hide show
  1. _mcp_mesh/__init__.py +1 -1
  2. _mcp_mesh/engine/dependency_injector.py +13 -15
  3. _mcp_mesh/engine/http_wrapper.py +69 -10
  4. _mcp_mesh/engine/mesh_llm_agent.py +29 -10
  5. _mcp_mesh/engine/mesh_llm_agent_injector.py +77 -41
  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/signature_analyzer.py +58 -68
  14. _mcp_mesh/engine/unified_mcp_proxy.py +19 -35
  15. _mcp_mesh/pipeline/__init__.py +9 -20
  16. _mcp_mesh/pipeline/api_heartbeat/__init__.py +12 -7
  17. _mcp_mesh/pipeline/api_heartbeat/api_lifespan_integration.py +23 -49
  18. _mcp_mesh/pipeline/api_heartbeat/rust_api_heartbeat.py +429 -0
  19. _mcp_mesh/pipeline/api_startup/api_pipeline.py +7 -9
  20. _mcp_mesh/pipeline/api_startup/api_server_setup.py +91 -70
  21. _mcp_mesh/pipeline/api_startup/fastapi_discovery.py +22 -23
  22. _mcp_mesh/pipeline/api_startup/middleware_integration.py +32 -24
  23. _mcp_mesh/pipeline/api_startup/route_collection.py +2 -4
  24. _mcp_mesh/pipeline/mcp_heartbeat/__init__.py +5 -17
  25. _mcp_mesh/pipeline/mcp_heartbeat/rust_heartbeat.py +710 -0
  26. _mcp_mesh/pipeline/mcp_startup/__init__.py +2 -5
  27. _mcp_mesh/pipeline/mcp_startup/configuration.py +1 -1
  28. _mcp_mesh/pipeline/mcp_startup/fastapiserver_setup.py +31 -8
  29. _mcp_mesh/pipeline/mcp_startup/heartbeat_loop.py +6 -7
  30. _mcp_mesh/pipeline/mcp_startup/startup_orchestrator.py +23 -11
  31. _mcp_mesh/pipeline/mcp_startup/startup_pipeline.py +3 -8
  32. _mcp_mesh/pipeline/shared/mesh_pipeline.py +0 -2
  33. _mcp_mesh/reload.py +1 -3
  34. _mcp_mesh/shared/__init__.py +2 -8
  35. _mcp_mesh/shared/config_resolver.py +124 -80
  36. _mcp_mesh/shared/defaults.py +89 -14
  37. _mcp_mesh/shared/fastapi_middleware_manager.py +149 -91
  38. _mcp_mesh/shared/host_resolver.py +8 -46
  39. _mcp_mesh/shared/server_discovery.py +115 -86
  40. _mcp_mesh/shared/simple_shutdown.py +44 -86
  41. _mcp_mesh/tracing/execution_tracer.py +2 -6
  42. _mcp_mesh/tracing/redis_metadata_publisher.py +24 -79
  43. _mcp_mesh/tracing/trace_context_helper.py +3 -13
  44. _mcp_mesh/tracing/utils.py +29 -15
  45. _mcp_mesh/utils/fastmcp_schema_extractor.py +5 -4
  46. {mcp_mesh-0.7.20.dist-info → mcp_mesh-0.8.0.dist-info}/METADATA +7 -5
  47. mcp_mesh-0.8.0.dist-info/RECORD +85 -0
  48. mesh/__init__.py +12 -1
  49. mesh/decorators.py +248 -33
  50. mesh/helpers.py +52 -0
  51. mesh/types.py +40 -13
  52. _mcp_mesh/generated/.openapi-generator/FILES +0 -50
  53. _mcp_mesh/generated/.openapi-generator/VERSION +0 -1
  54. _mcp_mesh/generated/.openapi-generator-ignore +0 -15
  55. _mcp_mesh/generated/mcp_mesh_registry_client/__init__.py +0 -90
  56. _mcp_mesh/generated/mcp_mesh_registry_client/api/__init__.py +0 -6
  57. _mcp_mesh/generated/mcp_mesh_registry_client/api/agents_api.py +0 -1088
  58. _mcp_mesh/generated/mcp_mesh_registry_client/api/health_api.py +0 -764
  59. _mcp_mesh/generated/mcp_mesh_registry_client/api/tracing_api.py +0 -303
  60. _mcp_mesh/generated/mcp_mesh_registry_client/api_client.py +0 -798
  61. _mcp_mesh/generated/mcp_mesh_registry_client/api_response.py +0 -21
  62. _mcp_mesh/generated/mcp_mesh_registry_client/configuration.py +0 -577
  63. _mcp_mesh/generated/mcp_mesh_registry_client/exceptions.py +0 -217
  64. _mcp_mesh/generated/mcp_mesh_registry_client/models/__init__.py +0 -55
  65. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_info.py +0 -158
  66. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata.py +0 -126
  67. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata_dependencies_inner.py +0 -139
  68. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_metadata_dependencies_inner_one_of.py +0 -92
  69. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_registration.py +0 -103
  70. _mcp_mesh/generated/mcp_mesh_registry_client/models/agent_registration_metadata.py +0 -136
  71. _mcp_mesh/generated/mcp_mesh_registry_client/models/agents_list_response.py +0 -100
  72. _mcp_mesh/generated/mcp_mesh_registry_client/models/capability_info.py +0 -107
  73. _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_agent_metadata.py +0 -112
  74. _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_agent_request.py +0 -103
  75. _mcp_mesh/generated/mcp_mesh_registry_client/models/decorator_info.py +0 -105
  76. _mcp_mesh/generated/mcp_mesh_registry_client/models/dependency_info.py +0 -103
  77. _mcp_mesh/generated/mcp_mesh_registry_client/models/dependency_resolution_info.py +0 -106
  78. _mcp_mesh/generated/mcp_mesh_registry_client/models/error_response.py +0 -91
  79. _mcp_mesh/generated/mcp_mesh_registry_client/models/health_response.py +0 -103
  80. _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_request.py +0 -101
  81. _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_request_metadata.py +0 -111
  82. _mcp_mesh/generated/mcp_mesh_registry_client/models/heartbeat_response.py +0 -117
  83. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_provider.py +0 -93
  84. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_provider_resolution_info.py +0 -106
  85. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter.py +0 -109
  86. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter_filter_inner.py +0 -139
  87. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_filter_filter_inner_one_of.py +0 -91
  88. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_info.py +0 -101
  89. _mcp_mesh/generated/mcp_mesh_registry_client/models/llm_tool_resolution_info.py +0 -120
  90. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_agent_register_metadata.py +0 -112
  91. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_agent_registration.py +0 -129
  92. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_registration_response.py +0 -153
  93. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_registration_response_dependencies_resolved_value_inner.py +0 -101
  94. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_dependency_registration.py +0 -93
  95. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_register_metadata.py +0 -107
  96. _mcp_mesh/generated/mcp_mesh_registry_client/models/mesh_tool_registration.py +0 -117
  97. _mcp_mesh/generated/mcp_mesh_registry_client/models/registration_response.py +0 -119
  98. _mcp_mesh/generated/mcp_mesh_registry_client/models/resolved_llm_provider.py +0 -110
  99. _mcp_mesh/generated/mcp_mesh_registry_client/models/rich_dependency.py +0 -93
  100. _mcp_mesh/generated/mcp_mesh_registry_client/models/root_response.py +0 -92
  101. _mcp_mesh/generated/mcp_mesh_registry_client/models/standardized_dependency.py +0 -93
  102. _mcp_mesh/generated/mcp_mesh_registry_client/models/trace_event.py +0 -106
  103. _mcp_mesh/generated/mcp_mesh_registry_client/py.typed +0 -0
  104. _mcp_mesh/generated/mcp_mesh_registry_client/rest.py +0 -259
  105. _mcp_mesh/pipeline/api_heartbeat/api_dependency_resolution.py +0 -418
  106. _mcp_mesh/pipeline/api_heartbeat/api_fast_heartbeat_check.py +0 -117
  107. _mcp_mesh/pipeline/api_heartbeat/api_health_check.py +0 -140
  108. _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_orchestrator.py +0 -247
  109. _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_pipeline.py +0 -311
  110. _mcp_mesh/pipeline/api_heartbeat/api_heartbeat_send.py +0 -386
  111. _mcp_mesh/pipeline/api_heartbeat/api_registry_connection.py +0 -104
  112. _mcp_mesh/pipeline/mcp_heartbeat/dependency_resolution.py +0 -396
  113. _mcp_mesh/pipeline/mcp_heartbeat/fast_heartbeat_check.py +0 -116
  114. _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_orchestrator.py +0 -311
  115. _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_pipeline.py +0 -282
  116. _mcp_mesh/pipeline/mcp_heartbeat/heartbeat_send.py +0 -98
  117. _mcp_mesh/pipeline/mcp_heartbeat/lifespan_integration.py +0 -84
  118. _mcp_mesh/pipeline/mcp_heartbeat/llm_tools_resolution.py +0 -264
  119. _mcp_mesh/pipeline/mcp_heartbeat/registry_connection.py +0 -79
  120. _mcp_mesh/pipeline/shared/registry_connection.py +0 -80
  121. _mcp_mesh/shared/registry_client_wrapper.py +0 -515
  122. mcp_mesh-0.7.20.dist-info/RECORD +0 -152
  123. {mcp_mesh-0.7.20.dist-info → mcp_mesh-0.8.0.dist-info}/WHEEL +0 -0
  124. {mcp_mesh-0.7.20.dist-info → mcp_mesh-0.8.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,117 +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
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.llm_provider import LLMProvider
25
- from _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_tool_dependency_registration import MeshToolDependencyRegistration
26
- from typing import Optional, Set
27
- from typing_extensions import Self
28
-
29
- class MeshToolRegistration(BaseModel):
30
- """
31
- Metadata for a single @mesh.tool decorated function
32
- """ # noqa: E501
33
- function_name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Name of the decorated function")
34
- capability: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Capability provided by this function")
35
- version: Optional[StrictStr] = Field(default='1.0.0', description="Function/capability version")
36
- tags: Optional[List[StrictStr]] = Field(default=None, description="Tags for this capability")
37
- dependencies: Optional[List[MeshToolDependencyRegistration]] = Field(default=None, description="Dependencies required by this function")
38
- description: Optional[StrictStr] = Field(default=None, description="Function description")
39
- input_schema: Optional[Dict[str, Any]] = Field(default=None, description="JSON Schema for function parameters (MCP tool format). Auto-generated from function signature by FastMCP. Used by LLM agents to understand how to call this tool. ", alias="inputSchema")
40
- llm_filter: Optional[Dict[str, Any]] = Field(default=None, description="Optional LLM tool filter specification when function is decorated with @mesh.llm. Defines which tools this LLM agent needs access to. Stored as JSON, follows LLMToolFilter schema structure. ")
41
- llm_provider: Optional[LLMProvider] = None
42
- kwargs: Optional[Dict[str, Any]] = Field(default=None, description="Additional kwargs from @mesh.tool decorator for enhanced client proxy configuration. Supports timeout, retry_count, custom_headers, streaming, auth_required, etc. ")
43
- __properties: ClassVar[List[str]] = ["function_name", "capability", "version", "tags", "dependencies", "description", "inputSchema", "llm_filter", "llm_provider", "kwargs"]
44
-
45
- model_config = ConfigDict(
46
- populate_by_name=True,
47
- validate_assignment=True,
48
- protected_namespaces=(),
49
- )
50
-
51
-
52
- def to_str(self) -> str:
53
- """Returns the string representation of the model using alias"""
54
- return pprint.pformat(self.model_dump(by_alias=True))
55
-
56
- def to_json(self) -> str:
57
- """Returns the JSON representation of the model using alias"""
58
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
- return json.dumps(self.to_dict())
60
-
61
- @classmethod
62
- def from_json(cls, json_str: str) -> Optional[Self]:
63
- """Create an instance of MeshToolRegistration from a JSON string"""
64
- return cls.from_dict(json.loads(json_str))
65
-
66
- def to_dict(self) -> Dict[str, Any]:
67
- """Return the dictionary representation of the model using alias.
68
-
69
- This has the following differences from calling pydantic's
70
- `self.model_dump(by_alias=True)`:
71
-
72
- * `None` is only added to the output dict for nullable fields that
73
- were set at model initialization. Other fields with value `None`
74
- are ignored.
75
- """
76
- excluded_fields: Set[str] = set([
77
- ])
78
-
79
- _dict = self.model_dump(
80
- by_alias=True,
81
- exclude=excluded_fields,
82
- exclude_none=True,
83
- )
84
- # override the default output from pydantic by calling `to_dict()` of each item in dependencies (list)
85
- _items = []
86
- if self.dependencies:
87
- for _item_dependencies in self.dependencies:
88
- if _item_dependencies:
89
- _items.append(_item_dependencies.to_dict())
90
- _dict['dependencies'] = _items
91
- # override the default output from pydantic by calling `to_dict()` of llm_provider
92
- if self.llm_provider:
93
- _dict['llm_provider'] = self.llm_provider.to_dict()
94
- return _dict
95
-
96
- @classmethod
97
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
- """Create an instance of MeshToolRegistration from a dict"""
99
- if obj is None:
100
- return None
101
-
102
- if not isinstance(obj, dict):
103
- return cls.model_validate(obj)
104
-
105
- _obj = cls.model_validate({
106
- "function_name": obj.get("function_name"),
107
- "capability": obj.get("capability"),
108
- "version": obj.get("version") if obj.get("version") is not None else '1.0.0',
109
- "tags": obj.get("tags"),
110
- "dependencies": [MeshToolDependencyRegistration.from_dict(_item) for _item in obj["dependencies"]] if obj.get("dependencies") is not None else None,
111
- "description": obj.get("description"),
112
- "inputSchema": obj.get("inputSchema"),
113
- "llm_filter": obj.get("llm_filter"),
114
- "llm_provider": LLMProvider.from_dict(obj["llm_provider"]) if obj.get("llm_provider") is not None else None,
115
- "kwargs": obj.get("kwargs")
116
- })
117
- return _obj
@@ -1,119 +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 _mcp_mesh.generated.mcp_mesh_registry_client.models.mesh_registration_response_dependencies_resolved_value_inner import MeshRegistrationResponseDependenciesResolvedValueInner
25
- from typing import Optional, Set
26
- from typing_extensions import Self
27
-
28
- class RegistrationResponse(BaseModel):
29
- """
30
- RegistrationResponse
31
- """ # noqa: E501
32
- status: StrictStr
33
- timestamp: datetime
34
- message: StrictStr
35
- agent_id: StrictStr = Field(description="Confirmed agent ID")
36
- dependencies_resolved: Optional[Dict[str, List[MeshRegistrationResponseDependenciesResolvedValueInner]]] = Field(default=None, description="Function name to array of resolved dependencies mapping. 🤖 AI NOTE: This enables immediate dependency injection setup. ")
37
- __properties: ClassVar[List[str]] = ["status", "timestamp", "message", "agent_id", "dependencies_resolved"]
38
-
39
- @field_validator('status')
40
- def status_validate_enum(cls, value):
41
- """Validates the enum"""
42
- if value not in set(['success', 'error']):
43
- raise ValueError("must be one of enum values ('success', 'error')")
44
- return value
45
-
46
- model_config = ConfigDict(
47
- populate_by_name=True,
48
- validate_assignment=True,
49
- protected_namespaces=(),
50
- )
51
-
52
-
53
- def to_str(self) -> str:
54
- """Returns the string representation of the model using alias"""
55
- return pprint.pformat(self.model_dump(by_alias=True))
56
-
57
- def to_json(self) -> str:
58
- """Returns the JSON representation of the model using alias"""
59
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
- return json.dumps(self.to_dict())
61
-
62
- @classmethod
63
- def from_json(cls, json_str: str) -> Optional[Self]:
64
- """Create an instance of RegistrationResponse from a JSON string"""
65
- return cls.from_dict(json.loads(json_str))
66
-
67
- def to_dict(self) -> Dict[str, Any]:
68
- """Return the dictionary representation of the model using alias.
69
-
70
- This has the following differences from calling pydantic's
71
- `self.model_dump(by_alias=True)`:
72
-
73
- * `None` is only added to the output dict for nullable fields that
74
- were set at model initialization. Other fields with value `None`
75
- are ignored.
76
- """
77
- excluded_fields: Set[str] = set([
78
- ])
79
-
80
- _dict = self.model_dump(
81
- by_alias=True,
82
- exclude=excluded_fields,
83
- exclude_none=True,
84
- )
85
- # override the default output from pydantic by calling `to_dict()` of each value in dependencies_resolved (dict of array)
86
- _field_dict_of_array = {}
87
- if self.dependencies_resolved:
88
- for _key_dependencies_resolved in self.dependencies_resolved:
89
- if self.dependencies_resolved[_key_dependencies_resolved] is not None:
90
- _field_dict_of_array[_key_dependencies_resolved] = [
91
- _item.to_dict() for _item in self.dependencies_resolved[_key_dependencies_resolved]
92
- ]
93
- _dict['dependencies_resolved'] = _field_dict_of_array
94
- return _dict
95
-
96
- @classmethod
97
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
- """Create an instance of RegistrationResponse from a dict"""
99
- if obj is None:
100
- return None
101
-
102
- if not isinstance(obj, dict):
103
- return cls.model_validate(obj)
104
-
105
- _obj = cls.model_validate({
106
- "status": obj.get("status"),
107
- "timestamp": obj.get("timestamp"),
108
- "message": obj.get("message"),
109
- "agent_id": obj.get("agent_id"),
110
- "dependencies_resolved": dict(
111
- (_k,
112
- [MeshRegistrationResponseDependenciesResolvedValueInner.from_dict(_item) for _item in _v]
113
- if _v is not None
114
- else None
115
- )
116
- for _k, _v in obj.get("dependencies_resolved", {}).items()
117
- )
118
- })
119
- return _obj
@@ -1,110 +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 typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class ResolvedLLMProvider(BaseModel):
28
- """
29
- Resolved LLM provider information for mesh delegation. Contains all necessary data to create a proxy and delegate LLM calls to this provider. 🤖 AI NOTE: This enables LLM mesh delegation (v0.6.1 feature).
30
- """ # noqa: E501
31
- name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Function name of the LLM provider tool")
32
- endpoint: StrictStr = Field(description="Provider agent endpoint for MCP protocol calls")
33
- agent_id: StrictStr = Field(description="ID of the provider agent")
34
- capability: StrictStr = Field(description="Capability name (typically \"llm\")")
35
- tags: Optional[List[StrictStr]] = Field(default=None, description="Provider capability tags")
36
- version: Optional[StrictStr] = Field(default='1.0.0', description="Provider version")
37
- vendor: Annotated[str, Field(min_length=1, strict=True)] = Field(description="LLM vendor/provider name extracted from model string. Used by consumer to select appropriate ProviderHandler for optimal LLM interaction. Automatically extracted using LiteLLM's get_llm_provider() function during provider registration. Common values: \"anthropic\", \"openai\", \"google\", \"cohere\", \"ollama\", \"together\", etc. ")
38
- status: StrictStr = Field(description="Current status of the provider")
39
- kwargs: Optional[Dict[str, Any]] = Field(default=None, description="Optional proxy configuration (timeout, retry, etc.). Passed to UnifiedMCPProxy for enhanced client behavior. ")
40
- __properties: ClassVar[List[str]] = ["name", "endpoint", "agent_id", "capability", "tags", "version", "vendor", "status", "kwargs"]
41
-
42
- @field_validator('status')
43
- def status_validate_enum(cls, value):
44
- """Validates the enum"""
45
- if value not in set(['available', 'unavailable', 'degraded']):
46
- raise ValueError("must be one of enum values ('available', 'unavailable', 'degraded')")
47
- return value
48
-
49
- model_config = ConfigDict(
50
- populate_by_name=True,
51
- validate_assignment=True,
52
- protected_namespaces=(),
53
- )
54
-
55
-
56
- def to_str(self) -> str:
57
- """Returns the string representation of the model using alias"""
58
- return pprint.pformat(self.model_dump(by_alias=True))
59
-
60
- def to_json(self) -> str:
61
- """Returns the JSON representation of the model using alias"""
62
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
63
- return json.dumps(self.to_dict())
64
-
65
- @classmethod
66
- def from_json(cls, json_str: str) -> Optional[Self]:
67
- """Create an instance of ResolvedLLMProvider from a JSON string"""
68
- return cls.from_dict(json.loads(json_str))
69
-
70
- def to_dict(self) -> Dict[str, Any]:
71
- """Return the dictionary representation of the model using alias.
72
-
73
- This has the following differences from calling pydantic's
74
- `self.model_dump(by_alias=True)`:
75
-
76
- * `None` is only added to the output dict for nullable fields that
77
- were set at model initialization. Other fields with value `None`
78
- are ignored.
79
- """
80
- excluded_fields: Set[str] = set([
81
- ])
82
-
83
- _dict = self.model_dump(
84
- by_alias=True,
85
- exclude=excluded_fields,
86
- exclude_none=True,
87
- )
88
- return _dict
89
-
90
- @classmethod
91
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92
- """Create an instance of ResolvedLLMProvider from a dict"""
93
- if obj is None:
94
- return None
95
-
96
- if not isinstance(obj, dict):
97
- return cls.model_validate(obj)
98
-
99
- _obj = cls.model_validate({
100
- "name": obj.get("name"),
101
- "endpoint": obj.get("endpoint"),
102
- "agent_id": obj.get("agent_id"),
103
- "capability": obj.get("capability"),
104
- "tags": obj.get("tags"),
105
- "version": obj.get("version") if obj.get("version") is not None else '1.0.0',
106
- "vendor": obj.get("vendor"),
107
- "status": obj.get("status"),
108
- "kwargs": obj.get("kwargs")
109
- })
110
- return _obj
@@ -1,93 +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
22
- from typing import Any, ClassVar, Dict, List
23
- from typing_extensions import Annotated
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class RichDependency(BaseModel):
28
- """
29
- Rich dependency format with full metadata for internal processing
30
- """ # noqa: E501
31
- capability: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Required capability name")
32
- tags: List[StrictStr] = Field(description="Tags for smart matching")
33
- version: StrictStr = Field(description="Version constraint")
34
- namespace: StrictStr = Field(description="Namespace filter")
35
- __properties: ClassVar[List[str]] = ["capability", "tags", "version", "namespace"]
36
-
37
- model_config = ConfigDict(
38
- populate_by_name=True,
39
- validate_assignment=True,
40
- protected_namespaces=(),
41
- )
42
-
43
-
44
- def to_str(self) -> str:
45
- """Returns the string representation of the model using alias"""
46
- return pprint.pformat(self.model_dump(by_alias=True))
47
-
48
- def to_json(self) -> str:
49
- """Returns the JSON representation of the model using alias"""
50
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
- return json.dumps(self.to_dict())
52
-
53
- @classmethod
54
- def from_json(cls, json_str: str) -> Optional[Self]:
55
- """Create an instance of RichDependency from a JSON string"""
56
- return cls.from_dict(json.loads(json_str))
57
-
58
- def to_dict(self) -> Dict[str, Any]:
59
- """Return the dictionary representation of the model using alias.
60
-
61
- This has the following differences from calling pydantic's
62
- `self.model_dump(by_alias=True)`:
63
-
64
- * `None` is only added to the output dict for nullable fields that
65
- were set at model initialization. Other fields with value `None`
66
- are ignored.
67
- """
68
- excluded_fields: Set[str] = set([
69
- ])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- return _dict
77
-
78
- @classmethod
79
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
- """Create an instance of RichDependency from a dict"""
81
- if obj is None:
82
- return None
83
-
84
- if not isinstance(obj, dict):
85
- return cls.model_validate(obj)
86
-
87
- _obj = cls.model_validate({
88
- "capability": obj.get("capability"),
89
- "tags": obj.get("tags"),
90
- "version": obj.get("version") if obj.get("version") is not None else '1.0.0',
91
- "namespace": obj.get("namespace") if obj.get("namespace") is not None else 'default'
92
- })
93
- return _obj
@@ -1,92 +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
22
- from typing import Any, ClassVar, Dict, List
23
- from typing import Optional, Set
24
- from typing_extensions import Self
25
-
26
- class RootResponse(BaseModel):
27
- """
28
- RootResponse
29
- """ # noqa: E501
30
- service: StrictStr
31
- version: StrictStr
32
- status: StrictStr
33
- endpoints: List[StrictStr] = Field(description="Available API endpoints")
34
- __properties: ClassVar[List[str]] = ["service", "version", "status", "endpoints"]
35
-
36
- model_config = ConfigDict(
37
- populate_by_name=True,
38
- validate_assignment=True,
39
- protected_namespaces=(),
40
- )
41
-
42
-
43
- def to_str(self) -> str:
44
- """Returns the string representation of the model using alias"""
45
- return pprint.pformat(self.model_dump(by_alias=True))
46
-
47
- def to_json(self) -> str:
48
- """Returns the JSON representation of the model using alias"""
49
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
- return json.dumps(self.to_dict())
51
-
52
- @classmethod
53
- def from_json(cls, json_str: str) -> Optional[Self]:
54
- """Create an instance of RootResponse from a JSON string"""
55
- return cls.from_dict(json.loads(json_str))
56
-
57
- def to_dict(self) -> Dict[str, Any]:
58
- """Return the dictionary representation of the model using alias.
59
-
60
- This has the following differences from calling pydantic's
61
- `self.model_dump(by_alias=True)`:
62
-
63
- * `None` is only added to the output dict for nullable fields that
64
- were set at model initialization. Other fields with value `None`
65
- are ignored.
66
- """
67
- excluded_fields: Set[str] = set([
68
- ])
69
-
70
- _dict = self.model_dump(
71
- by_alias=True,
72
- exclude=excluded_fields,
73
- exclude_none=True,
74
- )
75
- return _dict
76
-
77
- @classmethod
78
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
- """Create an instance of RootResponse from a dict"""
80
- if obj is None:
81
- return None
82
-
83
- if not isinstance(obj, dict):
84
- return cls.model_validate(obj)
85
-
86
- _obj = cls.model_validate({
87
- "service": obj.get("service"),
88
- "version": obj.get("version"),
89
- "status": obj.get("status"),
90
- "endpoints": obj.get("endpoints")
91
- })
92
- return _obj
@@ -1,93 +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
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from typing_extensions import Annotated
24
- from typing import Optional, Set
25
- from typing_extensions import Self
26
-
27
- class StandardizedDependency(BaseModel):
28
- """
29
- Standardized dependency format (always object, never string)
30
- """ # noqa: E501
31
- capability: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Required capability name")
32
- tags: Optional[List[StrictStr]] = Field(default=None, description="Tags for smart matching")
33
- version: Optional[StrictStr] = Field(default=None, description="Version constraint")
34
- namespace: Optional[StrictStr] = Field(default='default', description="Namespace filter")
35
- __properties: ClassVar[List[str]] = ["capability", "tags", "version", "namespace"]
36
-
37
- model_config = ConfigDict(
38
- populate_by_name=True,
39
- validate_assignment=True,
40
- protected_namespaces=(),
41
- )
42
-
43
-
44
- def to_str(self) -> str:
45
- """Returns the string representation of the model using alias"""
46
- return pprint.pformat(self.model_dump(by_alias=True))
47
-
48
- def to_json(self) -> str:
49
- """Returns the JSON representation of the model using alias"""
50
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
- return json.dumps(self.to_dict())
52
-
53
- @classmethod
54
- def from_json(cls, json_str: str) -> Optional[Self]:
55
- """Create an instance of StandardizedDependency from a JSON string"""
56
- return cls.from_dict(json.loads(json_str))
57
-
58
- def to_dict(self) -> Dict[str, Any]:
59
- """Return the dictionary representation of the model using alias.
60
-
61
- This has the following differences from calling pydantic's
62
- `self.model_dump(by_alias=True)`:
63
-
64
- * `None` is only added to the output dict for nullable fields that
65
- were set at model initialization. Other fields with value `None`
66
- are ignored.
67
- """
68
- excluded_fields: Set[str] = set([
69
- ])
70
-
71
- _dict = self.model_dump(
72
- by_alias=True,
73
- exclude=excluded_fields,
74
- exclude_none=True,
75
- )
76
- return _dict
77
-
78
- @classmethod
79
- def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
- """Create an instance of StandardizedDependency from a dict"""
81
- if obj is None:
82
- return None
83
-
84
- if not isinstance(obj, dict):
85
- return cls.model_validate(obj)
86
-
87
- _obj = cls.model_validate({
88
- "capability": obj.get("capability"),
89
- "tags": obj.get("tags"),
90
- "version": obj.get("version"),
91
- "namespace": obj.get("namespace") if obj.get("namespace") is not None else 'default'
92
- })
93
- return _obj