fast-agent-mcp 0.1.10__tar.gz → 0.1.11__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 (160) hide show
  1. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/PKG-INFO +36 -38
  2. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/README.md +34 -36
  3. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/pyproject.toml +2 -2
  4. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/config.py +9 -0
  5. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/agent_app.py +29 -0
  6. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/proxies.py +3 -0
  7. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/gen_client.py +4 -4
  8. fast_agent_mcp-0.1.11/src/mcp_agent/mcp/interfaces.py +152 -0
  9. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mcp_agent_client_session.py +11 -3
  10. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mcp_aggregator.py +13 -3
  11. fast_agent_mcp-0.1.11/src/mcp_agent/mcp/sampling.py +133 -0
  12. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/stdio.py +1 -2
  13. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/agent.py +1 -1
  14. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/fastagent.config.yaml +3 -0
  15. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/augmented_llm_passthrough.py +86 -33
  16. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/.gitignore +0 -0
  17. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/LICENSE +0 -0
  18. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/__init__.py +0 -0
  19. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/agents/__init__.py +0 -0
  20. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/agents/agent.py +0 -0
  21. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/app.py +0 -0
  22. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/__init__.py +0 -0
  23. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/__main__.py +0 -0
  24. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/commands/bootstrap.py +0 -0
  25. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/commands/config.py +0 -0
  26. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/commands/setup.py +0 -0
  27. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/main.py +0 -0
  28. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/terminal.py +0 -0
  29. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/console.py +0 -0
  30. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/context.py +0 -0
  31. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/context_dependent.py +0 -0
  32. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/__init__.py +0 -0
  33. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/agent_types.py +0 -0
  34. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/agent_utils.py +0 -0
  35. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/decorators.py +0 -0
  36. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/enhanced_prompt.py +0 -0
  37. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/error_handling.py +0 -0
  38. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/exceptions.py +0 -0
  39. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/factory.py +0 -0
  40. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/fastagent.py +0 -0
  41. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/mcp_content.py +0 -0
  42. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/prompt.py +0 -0
  43. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/types.py +0 -0
  44. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/validation.py +0 -0
  45. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/eval/__init__.py +0 -0
  46. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/event_progress.py +0 -0
  47. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/__init__.py +0 -0
  48. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/decorator_registry.py +0 -0
  49. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/executor.py +0 -0
  50. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/task_registry.py +0 -0
  51. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/temporal.py +0 -0
  52. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/workflow.py +0 -0
  53. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/workflow_signal.py +0 -0
  54. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/human_input/__init__.py +0 -0
  55. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/human_input/handler.py +0 -0
  56. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/human_input/types.py +0 -0
  57. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/__init__.py +0 -0
  58. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/events.py +0 -0
  59. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/json_serializer.py +0 -0
  60. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/listeners.py +0 -0
  61. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/logger.py +0 -0
  62. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/rich_progress.py +0 -0
  63. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/tracing.py +0 -0
  64. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/transport.py +0 -0
  65. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/__init__.py +0 -0
  66. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mcp_activity.py +0 -0
  67. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mcp_agent_server.py +0 -0
  68. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mcp_connection_manager.py +0 -0
  69. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mime_utils.py +0 -0
  70. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompt_message_multipart.py +0 -0
  71. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompt_serialization.py +0 -0
  72. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompts/__init__.py +0 -0
  73. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompts/__main__.py +0 -0
  74. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompts/prompt_server.py +0 -0
  75. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompts/prompt_template.py +0 -0
  76. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/resource_utils.py +0 -0
  77. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp_server/__init__.py +0 -0
  78. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp_server/agent_server.py +0 -0
  79. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp_server_registry.py +0 -0
  80. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/progress_display.py +0 -0
  81. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/data-analysis/analysis-campaign.py +0 -0
  82. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/data-analysis/analysis.py +0 -0
  83. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/data-analysis/fastagent.config.yaml +0 -0
  84. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +0 -0
  85. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/job.py +0 -0
  86. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/prompt_category.py +0 -0
  87. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/prompt_sizing.py +0 -0
  88. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/sizer.py +0 -0
  89. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/social.py +0 -0
  90. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/mcp_researcher/researcher-eval.py +0 -0
  91. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/prompting/__init__.py +0 -0
  92. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/prompting/agent.py +0 -0
  93. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/prompting/fastagent.config.yaml +0 -0
  94. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/prompting/image_server.py +0 -0
  95. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/researcher/fastagent.config.yaml +0 -0
  96. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/researcher/researcher-eval.py +0 -0
  97. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/researcher/researcher-imp.py +0 -0
  98. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/researcher/researcher.py +0 -0
  99. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/agent_build.py +0 -0
  100. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/chaining.py +0 -0
  101. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/evaluator.py +0 -0
  102. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/fastagent.config.yaml +0 -0
  103. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/human_input.py +0 -0
  104. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/orchestrator.py +0 -0
  105. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/parallel.py +0 -0
  106. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/router.py +0 -0
  107. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/sse.py +0 -0
  108. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/telemetry/__init__.py +0 -0
  109. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/telemetry/usage_tracking.py +0 -0
  110. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/ui/console_display.py +0 -0
  111. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/__init__.py +0 -0
  112. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/embedding/__init__.py +0 -0
  113. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/embedding/embedding_base.py +0 -0
  114. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/embedding/embedding_cohere.py +0 -0
  115. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/embedding/embedding_openai.py +0 -0
  116. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/evaluator_optimizer/__init__.py +0 -0
  117. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py +0 -0
  118. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/__init__.py +0 -0
  119. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py +0 -0
  120. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py +0 -0
  121. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding_cohere.py +0 -0
  122. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding_openai.py +0 -0
  123. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py +0 -0
  124. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm_anthropic.py +0 -0
  125. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm_openai.py +0 -0
  126. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/__init__.py +0 -0
  127. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/anthropic_utils.py +0 -0
  128. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/augmented_llm.py +0 -0
  129. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py +0 -0
  130. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/augmented_llm_openai.py +0 -0
  131. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/augmented_llm_playback.py +0 -0
  132. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/llm_selector.py +0 -0
  133. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/model_factory.py +0 -0
  134. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/openai_utils.py +0 -0
  135. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/prompt_utils.py +0 -0
  136. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/__init__.py +0 -0
  137. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/multipart_converter_anthropic.py +0 -0
  138. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/multipart_converter_openai.py +0 -0
  139. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/openai_multipart.py +0 -0
  140. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/sampling_converter_anthropic.py +0 -0
  141. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/sampling_converter_openai.py +0 -0
  142. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/sampling_format_converter.py +0 -0
  143. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/orchestrator/__init__.py +0 -0
  144. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/orchestrator/orchestrator.py +0 -0
  145. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/orchestrator/orchestrator_models.py +0 -0
  146. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/orchestrator/orchestrator_prompts.py +0 -0
  147. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/parallel/__init__.py +0 -0
  148. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/parallel/fan_in.py +0 -0
  149. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/parallel/fan_out.py +0 -0
  150. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/parallel/parallel_llm.py +0 -0
  151. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/__init__.py +0 -0
  152. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/router_base.py +0 -0
  153. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/router_embedding.py +0 -0
  154. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/router_embedding_cohere.py +0 -0
  155. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/router_embedding_openai.py +0 -0
  156. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/router_llm.py +0 -0
  157. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/swarm/__init__.py +0 -0
  158. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/swarm/swarm.py +0 -0
  159. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/swarm/swarm_anthropic.py +0 -0
  160. {fast_agent_mcp-0.1.10 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/swarm/swarm_openai.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fast-agent-mcp
3
- Version: 0.1.10
3
+ Version: 0.1.11
4
4
  Summary: Define, Prompt and Test MCP enabled Agents and Workflows
5
5
  Author-email: Shaun Smith <fastagent@llmindset.co.uk>, Sarmad Qadri <sarmad@lastmileai.dev>
6
6
  License: Apache License
@@ -212,7 +212,7 @@ Requires-Python: >=3.10
212
212
  Requires-Dist: aiohttp>=3.11.13
213
213
  Requires-Dist: anthropic>=0.49.0
214
214
  Requires-Dist: fastapi>=0.115.6
215
- Requires-Dist: mcp>=1.4.1
215
+ Requires-Dist: mcp>=1.5.0
216
216
  Requires-Dist: numpy>=2.2.1
217
217
  Requires-Dist: openai>=1.63.2
218
218
  Requires-Dist: opentelemetry-distro>=0.50b0
@@ -241,10 +241,9 @@ Provides-Extra: temporal
241
241
  Requires-Dist: temporalio>=1.8.0; extra == 'temporal'
242
242
  Description-Content-Type: text/markdown
243
243
 
244
- ## fast-agent
245
-
246
244
  <p align="center">
247
245
  <a href="https://pypi.org/project/fast-agent-mcp/"><img src="https://img.shields.io/pypi/v/fast-agent-mcp?color=%2334D058&label=pypi" /></a>
246
+ <a href="#"><img src="https://github.com/evalstate/fast-agent/actions/workflows/main-checks.yml/badge.svg" /></a>
248
247
  <a href="https://github.com/evalstate/fast-agent/issues"><img src="https://img.shields.io/github/issues-raw/evalstate/fast-agent" /></a>
249
248
  <a href="https://lmai.link/discord/mcp-agent"><img src="https://shields.io/discord/1089284610329952357" alt="discord" /></a>
250
249
  <img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/fast-agent-mcp?label=pypi%20%7C%20downloads"/>
@@ -253,16 +252,14 @@ Description-Content-Type: text/markdown
253
252
 
254
253
  ## Overview
255
254
 
256
- **`fast-agent`** enables you to create and interact with sophisticated Agents and Workflows in minutes.
255
+ **`fast-agent`** enables you to create and interact with sophisticated Agents and Workflows in minutes. It is the first framework with complete, end-to-end tested MCP Feature support including Sampling. Both Anthropic (Haiku, Sonnet, Opus) and OpenAI models (gpt-4o family, o1/o3 family) are supported.
257
256
 
258
257
  The simple declarative syntax lets you concentrate on composing your Prompts and MCP Servers to [build effective agents](https://www.anthropic.com/research/building-effective-agents).
259
258
 
260
- Evaluate how different models handle Agent and MCP Server calling tasks, then build multi-model workflows using the best provider for each task.
261
-
262
- `fast-agent` is now multi-modal, supporting Images and PDFs for both Anthropic and OpenAI endpoints (for supported models), via Prompts, Resources and MCP Tool Call results.
259
+ `fast-agent` is multi-modal, supporting Images and PDFs for both Anthropic and OpenAI endpoints via Prompts, Resources and MCP Tool Call results. The inclusion of passthrough and playback LLMs enable rapid development and test of Python glue-code for your applications.
263
260
 
264
261
  > [!TIP]
265
- > `fast-agent` is now MCP Native! Coming Soon - Full Documentation Site.
262
+ > `fast-agent` is now MCP Native! Coming Soon - Full Documentation Site and Further MCP Examples.
266
263
 
267
264
  ### Agent Application Development
268
265
 
@@ -272,7 +269,7 @@ Chat with individual Agents and Components before, during and after workflow exe
272
269
 
273
270
  Simple model selection makes testing Model <-> MCP Server interaction painless. You can read more about the motivation behind this project [here](https://llmindset.co.uk/resources/fast-agent/)
274
271
 
275
- ![fast-agent](https://github.com/user-attachments/assets/3e692103-bf97-489a-b519-2d0fee036369)
272
+ ![2025-03-23-fast-agent](https://github.com/user-attachments/assets/8f6dbb69-43e3-4633-8e12-5572e9614728)
276
273
 
277
274
  ## Get started:
278
275
 
@@ -597,6 +594,14 @@ agent["greeter"].send("Good Evening!") # Dictionary access is supported
597
594
 
598
595
  Add Resources to prompts using either the inbuilt `prompt-server` or MCP Types directly. Convenience class are made available to do so simply, for example:
599
596
 
597
+ ```python
598
+ summary: str = await agent.with_resource(
599
+ "Summarise this PDF please",
600
+ "mcp_server",
601
+ "resource://fast-agent/sample.pdf",
602
+ )
603
+ ```
604
+
600
605
  #### MCP Tool Result Conversion
601
606
 
602
607
  LLM APIs have restrictions on the content types that can be returned as Tool Calls/Function results via their Chat Completions API's:
@@ -612,40 +617,33 @@ MCP Prompts are supported with `apply_prompt(name,arguments)`, which always retu
612
617
 
613
618
  Prompts can also be applied interactively through the interactive interface by using the `/prompt` command.
614
619
 
620
+ ### Sampling
621
+
622
+ Sampling LLMs are configured per Client/Server pair. Specify the model name in fastagent.config.yaml as follows:
623
+
624
+ ```yaml
625
+ mcp:
626
+ servers:
627
+ sampling_resource:
628
+ command: "uv"
629
+ args: ["run", "sampling_resource_server.py"]
630
+ sampling:
631
+ model: "haiku"
632
+ ```
633
+
615
634
  ### Secrets File
616
635
 
617
636
  > [!TIP]
618
637
  > fast-agent will look recursively for a fastagent.secrets.yaml file, so you only need to manage this at the root folder of your agent definitions.
619
638
 
639
+ ### Interactive Shell
640
+
641
+ ![fast-agent](https://github.com/user-attachments/assets/3e692103-bf97-489a-b519-2d0fee036369)
642
+
620
643
  ## Project Notes
621
644
 
622
645
  `fast-agent` builds on the [`mcp-agent`](https://github.com/lastmile-ai/mcp-agent) project by Sarmad Qadri.
623
646
 
624
- ### llmindset.co.uk fork:
625
-
626
- - Addition of MCP Prompts including Prompt Server and agent save/replay ability.
627
- - Overhaul of Eval/Opt for Conversation Management
628
- - Removed instructor/double-llm calling - native structured outputs for OAI.
629
- - Improved handling of Parallel/Fan-In and respose option
630
- - XML based generated prompts
631
- - "FastAgent" style prototyping, with per-agent models
632
- - API keys through Environment Variables
633
- - Warm-up / Post-Workflow Agent Interactions
634
- - Quick Setup
635
- - Interactive Prompt Mode
636
- - Simple Model Selection with aliases
637
- - User/Assistant and Tool Call message display
638
- - MCP Sever Environment Variable support
639
- - MCP Roots support
640
- - Comprehensive Progress display
641
- - JSONL file logging with secret revokation
642
- - OpenAI o1/o3-mini support with reasoning level
643
- - Enhanced Human Input Messaging and Handling
644
- - Declarative workflows
645
- - Numerous defect fixes
646
-
647
- ### Features to add (Commmitted)
648
-
649
- - Run Agent as MCP Server, with interop
650
- - Multi-part content types supporing Vision, PDF and multi-part Text.
651
- - Improved test automation (supported by prompt_server.py and augmented_llm_playback.py)
647
+ ### Contributing
648
+
649
+ Contributions and PRs are welcome - feel free to raise issues to discuss. Full guidelines for contributing and roadmap coming very soon. Get in touch!
@@ -1,7 +1,6 @@
1
- ## fast-agent
2
-
3
1
  <p align="center">
4
2
  <a href="https://pypi.org/project/fast-agent-mcp/"><img src="https://img.shields.io/pypi/v/fast-agent-mcp?color=%2334D058&label=pypi" /></a>
3
+ <a href="#"><img src="https://github.com/evalstate/fast-agent/actions/workflows/main-checks.yml/badge.svg" /></a>
5
4
  <a href="https://github.com/evalstate/fast-agent/issues"><img src="https://img.shields.io/github/issues-raw/evalstate/fast-agent" /></a>
6
5
  <a href="https://lmai.link/discord/mcp-agent"><img src="https://shields.io/discord/1089284610329952357" alt="discord" /></a>
7
6
  <img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/fast-agent-mcp?label=pypi%20%7C%20downloads"/>
@@ -10,16 +9,14 @@
10
9
 
11
10
  ## Overview
12
11
 
13
- **`fast-agent`** enables you to create and interact with sophisticated Agents and Workflows in minutes.
12
+ **`fast-agent`** enables you to create and interact with sophisticated Agents and Workflows in minutes. It is the first framework with complete, end-to-end tested MCP Feature support including Sampling. Both Anthropic (Haiku, Sonnet, Opus) and OpenAI models (gpt-4o family, o1/o3 family) are supported.
14
13
 
15
14
  The simple declarative syntax lets you concentrate on composing your Prompts and MCP Servers to [build effective agents](https://www.anthropic.com/research/building-effective-agents).
16
15
 
17
- Evaluate how different models handle Agent and MCP Server calling tasks, then build multi-model workflows using the best provider for each task.
18
-
19
- `fast-agent` is now multi-modal, supporting Images and PDFs for both Anthropic and OpenAI endpoints (for supported models), via Prompts, Resources and MCP Tool Call results.
16
+ `fast-agent` is multi-modal, supporting Images and PDFs for both Anthropic and OpenAI endpoints via Prompts, Resources and MCP Tool Call results. The inclusion of passthrough and playback LLMs enable rapid development and test of Python glue-code for your applications.
20
17
 
21
18
  > [!TIP]
22
- > `fast-agent` is now MCP Native! Coming Soon - Full Documentation Site.
19
+ > `fast-agent` is now MCP Native! Coming Soon - Full Documentation Site and Further MCP Examples.
23
20
 
24
21
  ### Agent Application Development
25
22
 
@@ -29,7 +26,7 @@ Chat with individual Agents and Components before, during and after workflow exe
29
26
 
30
27
  Simple model selection makes testing Model <-> MCP Server interaction painless. You can read more about the motivation behind this project [here](https://llmindset.co.uk/resources/fast-agent/)
31
28
 
32
- ![fast-agent](https://github.com/user-attachments/assets/3e692103-bf97-489a-b519-2d0fee036369)
29
+ ![2025-03-23-fast-agent](https://github.com/user-attachments/assets/8f6dbb69-43e3-4633-8e12-5572e9614728)
33
30
 
34
31
  ## Get started:
35
32
 
@@ -354,6 +351,14 @@ agent["greeter"].send("Good Evening!") # Dictionary access is supported
354
351
 
355
352
  Add Resources to prompts using either the inbuilt `prompt-server` or MCP Types directly. Convenience class are made available to do so simply, for example:
356
353
 
354
+ ```python
355
+ summary: str = await agent.with_resource(
356
+ "Summarise this PDF please",
357
+ "mcp_server",
358
+ "resource://fast-agent/sample.pdf",
359
+ )
360
+ ```
361
+
357
362
  #### MCP Tool Result Conversion
358
363
 
359
364
  LLM APIs have restrictions on the content types that can be returned as Tool Calls/Function results via their Chat Completions API's:
@@ -369,40 +374,33 @@ MCP Prompts are supported with `apply_prompt(name,arguments)`, which always retu
369
374
 
370
375
  Prompts can also be applied interactively through the interactive interface by using the `/prompt` command.
371
376
 
377
+ ### Sampling
378
+
379
+ Sampling LLMs are configured per Client/Server pair. Specify the model name in fastagent.config.yaml as follows:
380
+
381
+ ```yaml
382
+ mcp:
383
+ servers:
384
+ sampling_resource:
385
+ command: "uv"
386
+ args: ["run", "sampling_resource_server.py"]
387
+ sampling:
388
+ model: "haiku"
389
+ ```
390
+
372
391
  ### Secrets File
373
392
 
374
393
  > [!TIP]
375
394
  > fast-agent will look recursively for a fastagent.secrets.yaml file, so you only need to manage this at the root folder of your agent definitions.
376
395
 
396
+ ### Interactive Shell
397
+
398
+ ![fast-agent](https://github.com/user-attachments/assets/3e692103-bf97-489a-b519-2d0fee036369)
399
+
377
400
  ## Project Notes
378
401
 
379
402
  `fast-agent` builds on the [`mcp-agent`](https://github.com/lastmile-ai/mcp-agent) project by Sarmad Qadri.
380
403
 
381
- ### llmindset.co.uk fork:
382
-
383
- - Addition of MCP Prompts including Prompt Server and agent save/replay ability.
384
- - Overhaul of Eval/Opt for Conversation Management
385
- - Removed instructor/double-llm calling - native structured outputs for OAI.
386
- - Improved handling of Parallel/Fan-In and respose option
387
- - XML based generated prompts
388
- - "FastAgent" style prototyping, with per-agent models
389
- - API keys through Environment Variables
390
- - Warm-up / Post-Workflow Agent Interactions
391
- - Quick Setup
392
- - Interactive Prompt Mode
393
- - Simple Model Selection with aliases
394
- - User/Assistant and Tool Call message display
395
- - MCP Sever Environment Variable support
396
- - MCP Roots support
397
- - Comprehensive Progress display
398
- - JSONL file logging with secret revokation
399
- - OpenAI o1/o3-mini support with reasoning level
400
- - Enhanced Human Input Messaging and Handling
401
- - Declarative workflows
402
- - Numerous defect fixes
403
-
404
- ### Features to add (Commmitted)
405
-
406
- - Run Agent as MCP Server, with interop
407
- - Multi-part content types supporing Vision, PDF and multi-part Text.
408
- - Improved test automation (supported by prompt_server.py and augmented_llm_playback.py)
404
+ ### Contributing
405
+
406
+ Contributions and PRs are welcome - feel free to raise issues to discuss. Full guidelines for contributing and roadmap coming very soon. Get in touch!
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fast-agent-mcp"
3
- version = "0.1.10"
3
+ version = "0.1.11"
4
4
  description = "Define, Prompt and Test MCP enabled Agents and Workflows"
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -16,7 +16,7 @@ classifiers = [
16
16
  requires-python = ">=3.10"
17
17
  dependencies = [
18
18
  "fastapi>=0.115.6",
19
- "mcp>=1.4.1",
19
+ "mcp>=1.5.0",
20
20
  "opentelemetry-distro>=0.50b0",
21
21
  "opentelemetry-exporter-otlp-proto-http>=1.29.0",
22
22
  "pydantic-settings>=2.7.0",
@@ -18,6 +18,12 @@ class MCPServerAuthSettings(BaseModel):
18
18
  model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
19
19
 
20
20
 
21
+ class MCPSamplingSettings(BaseModel):
22
+ model: str = "haiku"
23
+
24
+ model_config = ConfigDict(extra="allow", arbitrary_types_allowed=True)
25
+
26
+
21
27
  class MCPRootSettings(BaseModel):
22
28
  """Represents a root directory configuration for an MCP server."""
23
29
 
@@ -81,6 +87,9 @@ class MCPServerSettings(BaseModel):
81
87
  env: Dict[str, str] | None = None
82
88
  """Environment variables to pass to the server process."""
83
89
 
90
+ sampling: MCPSamplingSettings | None = None
91
+ """Sampling settings for this Client/Server pair"""
92
+
84
93
 
85
94
  class MCPSettings(BaseModel):
86
95
  """Configuration for all MCP servers."""
@@ -112,6 +112,35 @@ class AgentApp:
112
112
 
113
113
  proxy = self._agents[target]
114
114
  return await proxy.apply_prompt(prompt_name, arguments)
115
+
116
+ async def with_resource(
117
+ self,
118
+ prompt_content: Union[str, PromptMessageMultipart],
119
+ server_name: str,
120
+ resource_name: str,
121
+ agent_name: Optional[str] = None,
122
+ ) -> str:
123
+ """
124
+ Create a prompt with the given content and resource, then send it to the agent.
125
+
126
+ Args:
127
+ prompt_content: Either a string message or an existing PromptMessageMultipart
128
+ server_name: Name of the MCP server to retrieve the resource from
129
+ resource_name: Name or URI of the resource to retrieve
130
+ agent_name: The name of the agent to use (uses default if None)
131
+
132
+ Returns:
133
+ The agent's response as a string
134
+ """
135
+ target = agent_name or self._default
136
+ if not target:
137
+ raise ValueError("No default agent available")
138
+
139
+ if target not in self._agents:
140
+ raise ValueError(f"No agent named '{target}'")
141
+
142
+ proxy = self._agents[target]
143
+ return await proxy.with_resource(prompt_content, server_name, resource_name)
115
144
 
116
145
  async def prompt(self, agent_name: Optional[str] = None, default: str = "") -> str:
117
146
  """
@@ -1,6 +1,9 @@
1
1
  """
2
2
  Proxy classes for agent interactions.
3
3
  These proxies provide a consistent interface for interacting with different types of agents.
4
+
5
+ FOR COMPATIBILITY WITH LEGACY MCP-AGENT CODE
6
+
4
7
  """
5
8
 
6
9
  from typing import List, Optional, Dict, Union, TYPE_CHECKING
@@ -6,7 +6,7 @@ from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStre
6
6
  from mcp import ClientSession
7
7
 
8
8
  from mcp_agent.logging.logger import get_logger
9
- from mcp_agent.mcp_server_registry import ServerRegistry
9
+ from mcp_agent.mcp.interfaces import ServerRegistryProtocol
10
10
  from mcp_agent.mcp.mcp_agent_client_session import MCPAgentClientSession
11
11
 
12
12
  logger = get_logger(__name__)
@@ -15,7 +15,7 @@ logger = get_logger(__name__)
15
15
  @asynccontextmanager
16
16
  async def gen_client(
17
17
  server_name: str,
18
- server_registry: ServerRegistry,
18
+ server_registry: ServerRegistryProtocol,
19
19
  client_session_factory: Callable[
20
20
  [MemoryObjectReceiveStream, MemoryObjectSendStream, timedelta | None],
21
21
  ClientSession,
@@ -41,7 +41,7 @@ async def gen_client(
41
41
 
42
42
  async def connect(
43
43
  server_name: str,
44
- server_registry: ServerRegistry,
44
+ server_registry: ServerRegistryProtocol,
45
45
  client_session_factory: Callable[
46
46
  [MemoryObjectReceiveStream, MemoryObjectSendStream, timedelta | None],
47
47
  ClientSession,
@@ -67,7 +67,7 @@ async def connect(
67
67
 
68
68
  async def disconnect(
69
69
  server_name: str | None,
70
- server_registry: ServerRegistry,
70
+ server_registry: ServerRegistryProtocol,
71
71
  ) -> None:
72
72
  """
73
73
  Disconnect from the specified server. If server_name is None, disconnect from all servers.
@@ -0,0 +1,152 @@
1
+ """
2
+ Interface definitions to prevent circular imports.
3
+ This module defines protocols (interfaces) that can be used to break circular dependencies.
4
+ """
5
+
6
+ from contextlib import asynccontextmanager
7
+ from typing import Any, AsyncGenerator, Callable, Generic, List, Optional, Protocol, Type, TypeVar
8
+
9
+ from mcp import ClientSession
10
+ from mcp.types import CreateMessageRequestParams
11
+ from pydantic import Field
12
+
13
+
14
+ class ServerRegistryProtocol(Protocol):
15
+ """
16
+ Protocol defining the minimal interface of ServerRegistry needed by gen_client.
17
+ This allows gen_client to depend on this protocol rather than the full ServerRegistry class.
18
+ """
19
+
20
+ @asynccontextmanager
21
+ async def initialize_server(
22
+ self,
23
+ server_name: str,
24
+ client_session_factory=None,
25
+ init_hook=None,
26
+ ) -> AsyncGenerator[ClientSession, None]:
27
+ """Initialize a server and yield a client session."""
28
+ ...
29
+
30
+ @property
31
+ def connection_manager(self) -> "ConnectionManagerProtocol":
32
+ """Get the connection manager."""
33
+ ...
34
+
35
+
36
+ class ConnectionManagerProtocol(Protocol):
37
+ """
38
+ Protocol defining the minimal interface of ConnectionManager needed.
39
+ """
40
+
41
+ async def get_server(
42
+ self,
43
+ server_name: str,
44
+ client_session_factory=None,
45
+ ):
46
+ """Get a server connection."""
47
+ ...
48
+
49
+ async def disconnect_server(self, server_name: str) -> None:
50
+ """Disconnect from a server."""
51
+ ...
52
+
53
+ async def disconnect_all_servers(self) -> None:
54
+ """Disconnect from all servers."""
55
+ ...
56
+
57
+
58
+ # Type variables for generic protocols
59
+ MessageParamT = TypeVar("MessageParamT")
60
+ """A type representing an input message to an LLM."""
61
+
62
+ MessageT = TypeVar("MessageT")
63
+ """A type representing an output message from an LLM."""
64
+
65
+ ModelT = TypeVar("ModelT")
66
+ """A type representing a structured output message from an LLM."""
67
+
68
+
69
+ class RequestParams(CreateMessageRequestParams):
70
+ """
71
+ Parameters to configure the AugmentedLLM 'generate' requests.
72
+ """
73
+
74
+ messages: None = Field(exclude=True, default=None)
75
+ """
76
+ Ignored. 'messages' are removed from CreateMessageRequestParams
77
+ to avoid confusion with the 'message' parameter on 'generate' method.
78
+ """
79
+
80
+ maxTokens: int = 2048
81
+ """The maximum number of tokens to sample, as requested by the server."""
82
+
83
+ model: str | None = None
84
+ """
85
+ The model to use for the LLM generation.
86
+ If specified, this overrides the 'modelPreferences' selection criteria.
87
+ """
88
+
89
+ use_history: bool = True
90
+ """
91
+ Include the message history in the generate request.
92
+ """
93
+
94
+ max_iterations: int = 10
95
+ """
96
+ The maximum number of iterations to run the LLM for.
97
+ """
98
+
99
+ parallel_tool_calls: bool = True
100
+ """
101
+ Whether to allow multiple tool calls per iteration.
102
+ Also known as multi-step tool use.
103
+ """
104
+
105
+
106
+ class AugmentedLLMProtocol(Protocol, Generic[MessageParamT, MessageT]):
107
+ """Protocol defining the interface for augmented LLMs"""
108
+
109
+ async def generate(
110
+ self,
111
+ message: str | MessageParamT | List[MessageParamT],
112
+ request_params: RequestParams | None = None,
113
+ ) -> List[MessageT]:
114
+ """Request an LLM generation, which may run multiple iterations, and return the result"""
115
+
116
+ async def generate_str(
117
+ self,
118
+ message: str | MessageParamT | List[MessageParamT],
119
+ request_params: RequestParams | None = None,
120
+ ) -> str:
121
+ """Request an LLM generation and return the string representation of the result"""
122
+
123
+ async def generate_structured(
124
+ self,
125
+ message: str | MessageParamT | List[MessageParamT],
126
+ response_model: Type[ModelT],
127
+ request_params: RequestParams | None = None,
128
+ ) -> ModelT:
129
+ """Request a structured LLM generation and return the result as a Pydantic model."""
130
+
131
+
132
+ class ModelFactoryClassProtocol(Protocol):
133
+ """
134
+ Protocol defining the minimal interface of the ModelFactory class needed by sampling.
135
+ This allows sampling.py to depend on this protocol rather than the concrete ModelFactory class.
136
+ """
137
+
138
+ @classmethod
139
+ def create_factory(
140
+ cls, model_string: str, request_params: Optional[RequestParams] = None
141
+ ) -> Callable[..., AugmentedLLMProtocol[Any, Any]]:
142
+ """
143
+ Creates a factory function that can be used to construct an LLM instance.
144
+
145
+ Args:
146
+ model_string: The model specification string
147
+ request_params: Optional parameters to configure LLM behavior
148
+
149
+ Returns:
150
+ A factory function that can create an LLM instance
151
+ """
152
+ ...
@@ -24,6 +24,7 @@ from pydantic import AnyUrl
24
24
  from mcp_agent.config import MCPServerSettings
25
25
  from mcp_agent.context_dependent import ContextDependent
26
26
  from mcp_agent.logging.logger import get_logger
27
+ from mcp_agent.mcp.sampling import sample
27
28
 
28
29
  logger = get_logger(__name__)
29
30
 
@@ -40,7 +41,12 @@ async def list_roots(ctx: ClientSession) -> ListRootsResult:
40
41
  and ctx.session.server_config.roots
41
42
  ):
42
43
  roots = [
43
- Root(uri=AnyUrl(root.uri), name=root.name)
44
+ Root(
45
+ uri=AnyUrl(
46
+ root.server_uri_alias or root.uri,
47
+ ),
48
+ name=root.name,
49
+ )
44
50
  for root in ctx.session.server_config.roots
45
51
  ]
46
52
  return ListRootsResult(roots=roots or [])
@@ -58,7 +64,9 @@ class MCPAgentClientSession(ClientSession, ContextDependent):
58
64
  """
59
65
 
60
66
  def __init__(self, *args, **kwargs):
61
- super().__init__(*args, **kwargs, list_roots_callback=list_roots)
67
+ super().__init__(
68
+ *args, **kwargs, list_roots_callback=list_roots, sampling_callback=sample
69
+ )
62
70
  self.server_config: Optional[MCPServerSettings] = None
63
71
 
64
72
  async def send_request(
@@ -115,4 +123,4 @@ class MCPAgentClientSession(ClientSession, ContextDependent):
115
123
  )
116
124
  return await super().send_progress_notification(
117
125
  progress_token=progress_token, progress=progress, total=total
118
- )
126
+ )
@@ -16,6 +16,7 @@ from mcp.server.stdio import stdio_server
16
16
  from mcp.types import (
17
17
  CallToolResult,
18
18
  ListToolsResult,
19
+ TextContent,
19
20
  Tool,
20
21
  Prompt,
21
22
  )
@@ -459,7 +460,10 @@ class MCPAggregator(ContextDependent):
459
460
 
460
461
  if server_name is None or local_tool_name is None:
461
462
  logger.error(f"Error: Tool '{name}' not found")
462
- return CallToolResult(isError=True, message=f"Tool '{name}' not found")
463
+ return CallToolResult(
464
+ isError=True,
465
+ content=[TextContent(type="text", text=f"Tool '{name}' not found")]
466
+ )
463
467
 
464
468
  logger.info(
465
469
  "Requesting tool call",
@@ -477,7 +481,10 @@ class MCPAggregator(ContextDependent):
477
481
  operation_name=local_tool_name,
478
482
  method_name="call_tool",
479
483
  method_args={"name": local_tool_name, "arguments": arguments},
480
- error_factory=lambda msg: CallToolResult(isError=True, message=msg),
484
+ error_factory=lambda msg: CallToolResult(
485
+ isError=True,
486
+ content=[TextContent(type="text", text=msg)]
487
+ ),
481
488
  )
482
489
 
483
490
  async def get_prompt(
@@ -898,7 +905,10 @@ class MCPCompoundServer(Server):
898
905
  result = await self.aggregator.call_tool(name=name, arguments=arguments)
899
906
  return result.content
900
907
  except Exception as e:
901
- return CallToolResult(isError=True, message=f"Error calling tool: {e}")
908
+ return CallToolResult(
909
+ isError=True,
910
+ content=[TextContent(type="text", text=f"Error calling tool: {e}")]
911
+ )
902
912
 
903
913
  async def _get_prompt(
904
914
  self, name: str = None, arguments: dict[str, str] = None