mcp-mesh 0.8.0b8__tar.gz → 0.8.0b9__tar.gz

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 (86) hide show
  1. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/PKG-INFO +2 -2
  2. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/__init__.py +1 -1
  3. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/mesh_llm_agent_injector.py +52 -43
  4. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/pyproject.toml +5 -5
  5. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/.gitignore +0 -0
  6. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/LICENSE +0 -0
  7. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/README.md +0 -0
  8. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/__init__.py +0 -0
  9. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/async_mcp_client.py +0 -0
  10. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/base_injector.py +0 -0
  11. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/decorator_registry.py +0 -0
  12. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/dependency_injector.py +0 -0
  13. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/http_wrapper.py +0 -0
  14. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/llm_config.py +0 -0
  15. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/llm_errors.py +0 -0
  16. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/mesh_llm_agent.py +0 -0
  17. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/provider_handlers/__init__.py +0 -0
  18. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/provider_handlers/base_provider_handler.py +0 -0
  19. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/provider_handlers/claude_handler.py +0 -0
  20. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/provider_handlers/gemini_handler.py +0 -0
  21. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/provider_handlers/generic_handler.py +0 -0
  22. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/provider_handlers/openai_handler.py +0 -0
  23. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/provider_handlers/provider_handler_registry.py +0 -0
  24. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/response_parser.py +0 -0
  25. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/self_dependency_proxy.py +0 -0
  26. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/session_aware_client.py +0 -0
  27. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/session_manager.py +0 -0
  28. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/signature_analyzer.py +0 -0
  29. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/tool_executor.py +0 -0
  30. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/tool_schema_builder.py +0 -0
  31. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/engine/unified_mcp_proxy.py +0 -0
  32. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/__init__.py +0 -0
  33. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/api_heartbeat/__init__.py +0 -0
  34. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/api_heartbeat/api_lifespan_integration.py +0 -0
  35. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/api_heartbeat/rust_api_heartbeat.py +0 -0
  36. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/api_startup/__init__.py +0 -0
  37. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/api_startup/api_pipeline.py +0 -0
  38. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/api_startup/api_server_setup.py +0 -0
  39. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/api_startup/fastapi_discovery.py +0 -0
  40. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/api_startup/middleware_integration.py +0 -0
  41. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/api_startup/route_collection.py +0 -0
  42. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/api_startup/route_integration.py +0 -0
  43. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_heartbeat/__init__.py +0 -0
  44. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_heartbeat/rust_heartbeat.py +0 -0
  45. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/__init__.py +0 -0
  46. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/configuration.py +0 -0
  47. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/decorator_collection.py +0 -0
  48. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/fastapiserver_setup.py +0 -0
  49. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/fastmcpserver_discovery.py +0 -0
  50. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/heartbeat_loop.py +0 -0
  51. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/heartbeat_preparation.py +0 -0
  52. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/lifespan_factory.py +0 -0
  53. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/server_discovery.py +0 -0
  54. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/startup_orchestrator.py +0 -0
  55. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/mcp_startup/startup_pipeline.py +0 -0
  56. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/shared/__init__.py +0 -0
  57. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/shared/base_step.py +0 -0
  58. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/shared/mesh_pipeline.py +0 -0
  59. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/pipeline/shared/pipeline_types.py +0 -0
  60. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/reload.py +0 -0
  61. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/reload_runner.py +0 -0
  62. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/__init__.py +0 -0
  63. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/config_resolver.py +0 -0
  64. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/content_extractor.py +0 -0
  65. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/defaults.py +0 -0
  66. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/fast_heartbeat_status.py +0 -0
  67. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/fastapi_middleware_manager.py +0 -0
  68. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/health_check_manager.py +0 -0
  69. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/host_resolver.py +0 -0
  70. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/logging_config.py +0 -0
  71. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/server_discovery.py +0 -0
  72. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/simple_shutdown.py +0 -0
  73. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/sse_parser.py +0 -0
  74. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/shared/support_types.py +0 -0
  75. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/tracing/agent_context_helper.py +0 -0
  76. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/tracing/context.py +0 -0
  77. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/tracing/execution_tracer.py +0 -0
  78. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/tracing/fastapi_tracing_middleware.py +0 -0
  79. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/tracing/redis_metadata_publisher.py +0 -0
  80. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/tracing/trace_context_helper.py +0 -0
  81. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/tracing/utils.py +0 -0
  82. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/_mcp_mesh/utils/fastmcp_schema_extractor.py +0 -0
  83. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/mesh/__init__.py +0 -0
  84. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/mesh/decorators.py +0 -0
  85. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/mesh/helpers.py +0 -0
  86. {mcp_mesh-0.8.0b8 → mcp_mesh-0.8.0b9}/mesh/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-mesh
3
- Version: 0.8.0b8
3
+ Version: 0.8.0b9
4
4
  Summary: Kubernetes-native platform for distributed MCP applications
5
5
  Project-URL: Homepage, https://github.com/dhyansraj/mcp-mesh
6
6
  Project-URL: Documentation, https://github.com/dhyansraj/mcp-mesh/tree/main/docs
@@ -30,7 +30,7 @@ Requires-Dist: fastmcp<3.0.0,>=2.8.0
30
30
  Requires-Dist: httpx<1.0.0,>=0.25.0
31
31
  Requires-Dist: jinja2>=3.1.0
32
32
  Requires-Dist: litellm>=1.30.0
33
- Requires-Dist: mcp-mesh-core>=0.8.0b8
33
+ Requires-Dist: mcp-mesh-core>=0.8.0b9
34
34
  Requires-Dist: mcp<2.0.0,>=1.9.0
35
35
  Requires-Dist: prometheus-client<1.0.0,>=0.19.0
36
36
  Requires-Dist: pydantic<3.0.0,>=2.4.0
@@ -31,7 +31,7 @@ from .engine.decorator_registry import (
31
31
  get_decorator_stats,
32
32
  )
33
33
 
34
- __version__ = "0.8.0b8"
34
+ __version__ = "0.8.0b9"
35
35
 
36
36
  # Store reference to runtime processor if initialized
37
37
  _runtime_processor = None
@@ -161,36 +161,44 @@ class MeshLlmAgentInjector(BaseInjector):
161
161
  # Create UnifiedMCPProxy for the provider
162
162
  provider_proxy = self._create_provider_proxy(provider_data)
163
163
 
164
- # Update llm_agents data with provider_proxy and vendor (Phase 2)
165
- if function_id in self._llm_agents:
166
- self._llm_agents[function_id]["provider_proxy"] = provider_proxy
164
+ # Update only provider-related fields, preserving tool data if already set.
165
+ # This avoids race conditions where provider and tools updates can arrive in any order.
166
+ if function_id not in self._llm_agents:
167
+ self._llm_agents[function_id] = {}
167
168
 
168
- # Phase 2: Extract vendor from provider_data for handler selection
169
- vendor = provider_data.get("vendor", "unknown")
170
- self._llm_agents[function_id]["vendor"] = vendor
169
+ # Phase 2: Extract vendor from provider_data for handler selection
170
+ vendor = provider_data.get("vendor", "unknown")
171
171
 
172
+ self._llm_agents[function_id]["provider_proxy"] = provider_proxy
173
+ self._llm_agents[function_id]["vendor"] = vendor
174
+
175
+ logger.info(
176
+ f"✅ Set provider proxy for '{function_id}': {provider_proxy.function_name} at {provider_proxy.endpoint} (vendor={vendor})"
177
+ )
178
+
179
+ # Re-create and update MeshLlmAgent with new provider (only if tools are also available)
180
+ # Get the function wrapper from DecoratorRegistry
181
+ llm_agents = DecoratorRegistry.get_mesh_llm_agents()
182
+ wrapper = None
183
+ for agent_func_id, metadata in llm_agents.items():
184
+ if metadata.function_id == function_id:
185
+ wrapper = metadata.function
186
+ break
187
+
188
+ # Only update wrapper if we have both tools and provider (tools_metadata indicates tools were processed)
189
+ if (
190
+ wrapper
191
+ and hasattr(wrapper, "_mesh_update_llm_agent")
192
+ and "tools_metadata" in self._llm_agents[function_id]
193
+ ):
194
+ llm_agent = self._create_llm_agent(function_id)
195
+ wrapper._mesh_update_llm_agent(llm_agent)
172
196
  logger.info(
173
- f" Set provider proxy for '{function_id}': {provider_proxy.function_name} at {provider_proxy.endpoint} (vendor={vendor})"
197
+ f"🔄 Updated wrapper with new MeshLlmAgent (with provider) for '{function_id}'"
174
198
  )
175
-
176
- # Re-create and update MeshLlmAgent with new provider
177
- # Get the function wrapper from DecoratorRegistry
178
- llm_agents = DecoratorRegistry.get_mesh_llm_agents()
179
- wrapper = None
180
- for agent_func_id, metadata in llm_agents.items():
181
- if metadata.function_id == function_id:
182
- wrapper = metadata.function
183
- break
184
-
185
- if wrapper and hasattr(wrapper, "_mesh_update_llm_agent"):
186
- llm_agent = self._create_llm_agent(function_id)
187
- wrapper._mesh_update_llm_agent(llm_agent)
188
- logger.info(
189
- f"🔄 Updated wrapper with new MeshLlmAgent (with provider) for '{function_id}'"
190
- )
191
- else:
192
- logger.warning(
193
- f"⚠️ Function '{function_id}' not found in _llm_agents, cannot set provider proxy"
199
+ elif wrapper and hasattr(wrapper, "_mesh_update_llm_agent"):
200
+ logger.debug(
201
+ f"⏳ Provider set for '{function_id}', waiting for tools before updating wrapper"
194
202
  )
195
203
 
196
204
  def _create_provider_proxy(self, provider_data: dict[str, Any]) -> UnifiedMCPProxy:
@@ -273,21 +281,23 @@ class MeshLlmAgentInjector(BaseInjector):
273
281
  logger.error(f"❌ Error creating proxy for tool {tool_name}: {e}")
274
282
  # Continue processing other tools
275
283
 
276
- # Provider proxy will be set separately via process_llm_providers()
277
- # (v0.6.1 - providers come from llm_providers field, not dependencies)
278
- provider_proxy = None
279
-
280
- # Store LLM agent data with both metadata and proxies
281
- # Keep original tool metadata for schema building
282
- self._llm_agents[function_id] = {
283
- "config": llm_metadata.config,
284
- "output_type": llm_metadata.output_type,
285
- "param_name": llm_metadata.param_name,
286
- "tools_metadata": tools, # Original metadata for schema building
287
- "tools_proxies": tool_proxies_map, # Proxies for execution
288
- "function": llm_metadata.function,
289
- "provider_proxy": provider_proxy, # Provider proxy for mesh delegation
290
- }
284
+ # Update only tool-related fields, preserving provider_proxy if already set.
285
+ # Provider proxy is managed separately by process_llm_providers().
286
+ # This avoids race conditions where tools update wipes out provider resolution.
287
+ if function_id not in self._llm_agents:
288
+ self._llm_agents[function_id] = {}
289
+
290
+ self._llm_agents[function_id].update(
291
+ {
292
+ "config": llm_metadata.config,
293
+ "output_type": llm_metadata.output_type,
294
+ "param_name": llm_metadata.param_name,
295
+ "tools_metadata": tools, # Original metadata for schema building
296
+ "tools_proxies": tool_proxies_map, # Proxies for execution
297
+ "function": llm_metadata.function,
298
+ # Note: provider_proxy is NOT set here - managed by _process_function_provider
299
+ }
300
+ )
291
301
 
292
302
  logger.info(
293
303
  f"✅ Processed {len(tool_proxies_map)} tools for LLM function '{function_id}'"
@@ -431,8 +441,7 @@ class MeshLlmAgentInjector(BaseInjector):
431
441
  if is_template:
432
442
  # Templates enabled - create per-call agent with context
433
443
  # Import signature analyzer for context detection
434
- from .signature_analyzer import \
435
- get_context_parameter_name
444
+ from .signature_analyzer import get_context_parameter_name
436
445
 
437
446
  # Detect context parameter
438
447
  context_param_name = config_dict.get("context_param")
@@ -6,7 +6,7 @@ build-backend = "hatchling.build"
6
6
 
7
7
  [project]
8
8
  name = "mcp-mesh"
9
- version = "0.8.0b8"
9
+ version = "0.8.0b9"
10
10
  description = "Kubernetes-native platform for distributed MCP applications"
11
11
  readme = "README.md"
12
12
  license = { text = "MIT" }
@@ -37,7 +37,7 @@ classifiers = [
37
37
  requires-python = ">=3.11"
38
38
  dependencies = [
39
39
  # Rust core runtime (required - no Python fallback)
40
- "mcp-mesh-core>=0.8.0b8",
40
+ "mcp-mesh-core>=0.8.0b9",
41
41
  "fastapi>=0.104.0,<1.0.0",
42
42
  "uvicorn>=0.24.0,<1.0.0",
43
43
  "httpx>=0.25.0,<1.0.0",
@@ -123,7 +123,7 @@ extend-exclude = '''
123
123
  '''
124
124
 
125
125
  [tool.ruff]
126
- target-version = "0.8.0b8"
126
+ target-version = "0.8.0b9"
127
127
  line-length = 88
128
128
 
129
129
  [tool.ruff.lint]
@@ -160,7 +160,7 @@ ignore = [
160
160
  "tests/**" = ["E712", "F841", "B007", "C401", "F401"] # Relax style requirements for test files
161
161
 
162
162
  [tool.mypy]
163
- python_version = "0.8.0b8"
163
+ python_version = "0.8.0b9"
164
164
  check_untyped_defs = false # Temporarily relaxed
165
165
  disallow_any_generics = false # Temporarily relaxed
166
166
  disallow_incomplete_defs = false # Temporarily relaxed
@@ -172,7 +172,7 @@ warn_return_any = false # Temporarily relaxed
172
172
  exclude = ["tests/", ".*agent_server_generated.*", ".*registry_client_generated.*"] # Skip type checking for test and generated files
173
173
 
174
174
  [tool.pytest.ini_options]
175
- minversion = "0.8.0b8"
175
+ minversion = "0.8.0b9"
176
176
  addopts = "-ra -q --strict-markers --strict-config"
177
177
  testpaths = [
178
178
  "tests",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes