fast-agent-mcp 0.1.9__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 (162) hide show
  1. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/PKG-INFO +37 -38
  2. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/README.md +35 -36
  3. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/pyproject.toml +2 -2
  4. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/agents/agent.py +112 -0
  5. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/config.py +9 -0
  6. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/context.py +0 -2
  7. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/agent_app.py +29 -0
  8. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/factory.py +14 -13
  9. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/fastagent.py +2 -2
  10. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/proxies.py +41 -0
  11. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/listeners.py +3 -6
  12. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/gen_client.py +4 -4
  13. fast_agent_mcp-0.1.11/src/mcp_agent/mcp/interfaces.py +152 -0
  14. fast_agent_mcp-0.1.11/src/mcp_agent/mcp/mcp_agent_client_session.py +126 -0
  15. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mcp_aggregator.py +63 -5
  16. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mcp_connection_manager.py +0 -1
  17. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompts/prompt_server.py +12 -11
  18. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/resource_utils.py +58 -38
  19. fast_agent_mcp-0.1.11/src/mcp_agent/mcp/sampling.py +133 -0
  20. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/stdio.py +22 -15
  21. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp_server_registry.py +5 -2
  22. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/agent.py +1 -1
  23. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/fastagent.config.yaml +3 -0
  24. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/orchestrator.py +3 -3
  25. fast_agent_mcp-0.1.11/src/mcp_agent/workflows/llm/augmented_llm_passthrough.py +212 -0
  26. fast_agent_mcp-0.1.9/src/mcp_agent/mcp/mcp_agent_client_session.py +0 -242
  27. fast_agent_mcp-0.1.9/src/mcp_agent/workflows/llm/augmented_llm_passthrough.py +0 -104
  28. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/.gitignore +0 -0
  29. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/LICENSE +0 -0
  30. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/__init__.py +0 -0
  31. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/agents/__init__.py +0 -0
  32. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/app.py +0 -0
  33. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/__init__.py +0 -0
  34. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/__main__.py +0 -0
  35. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/commands/bootstrap.py +0 -0
  36. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/commands/config.py +0 -0
  37. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/commands/setup.py +0 -0
  38. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/main.py +0 -0
  39. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/cli/terminal.py +0 -0
  40. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/console.py +0 -0
  41. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/context_dependent.py +0 -0
  42. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/__init__.py +0 -0
  43. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/agent_types.py +0 -0
  44. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/agent_utils.py +0 -0
  45. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/decorators.py +0 -0
  46. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/enhanced_prompt.py +0 -0
  47. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/error_handling.py +0 -0
  48. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/exceptions.py +0 -0
  49. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/mcp_content.py +0 -0
  50. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/prompt.py +0 -0
  51. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/types.py +0 -0
  52. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/core/validation.py +0 -0
  53. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/eval/__init__.py +0 -0
  54. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/event_progress.py +0 -0
  55. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/__init__.py +0 -0
  56. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/decorator_registry.py +0 -0
  57. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/executor.py +0 -0
  58. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/task_registry.py +0 -0
  59. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/temporal.py +0 -0
  60. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/workflow.py +0 -0
  61. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/executor/workflow_signal.py +0 -0
  62. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/human_input/__init__.py +0 -0
  63. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/human_input/handler.py +0 -0
  64. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/human_input/types.py +0 -0
  65. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/__init__.py +0 -0
  66. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/events.py +0 -0
  67. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/json_serializer.py +0 -0
  68. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/logger.py +0 -0
  69. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/rich_progress.py +0 -0
  70. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/tracing.py +0 -0
  71. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/logging/transport.py +0 -0
  72. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/__init__.py +0 -0
  73. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mcp_activity.py +0 -0
  74. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mcp_agent_server.py +0 -0
  75. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/mime_utils.py +0 -0
  76. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompt_message_multipart.py +0 -0
  77. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompt_serialization.py +0 -0
  78. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompts/__init__.py +0 -0
  79. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompts/__main__.py +0 -0
  80. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp/prompts/prompt_template.py +0 -0
  81. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp_server/__init__.py +0 -0
  82. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/mcp_server/agent_server.py +0 -0
  83. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/progress_display.py +0 -0
  84. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/data-analysis/analysis-campaign.py +0 -0
  85. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/data-analysis/analysis.py +0 -0
  86. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/data-analysis/fastagent.config.yaml +0 -0
  87. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +0 -0
  88. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/job.py +0 -0
  89. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/prompt_category.py +0 -0
  90. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/prompt_sizing.py +0 -0
  91. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/sizer.py +0 -0
  92. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/internal/social.py +0 -0
  93. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/mcp_researcher/researcher-eval.py +0 -0
  94. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/prompting/__init__.py +0 -0
  95. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/prompting/agent.py +0 -0
  96. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/prompting/fastagent.config.yaml +0 -0
  97. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/prompting/image_server.py +0 -0
  98. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/researcher/fastagent.config.yaml +0 -0
  99. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/researcher/researcher-eval.py +0 -0
  100. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/researcher/researcher-imp.py +0 -0
  101. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/researcher/researcher.py +0 -0
  102. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/agent_build.py +0 -0
  103. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/chaining.py +0 -0
  104. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/evaluator.py +0 -0
  105. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/fastagent.config.yaml +0 -0
  106. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/human_input.py +0 -0
  107. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/parallel.py +0 -0
  108. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/router.py +0 -0
  109. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/resources/examples/workflows/sse.py +0 -0
  110. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/telemetry/__init__.py +0 -0
  111. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/telemetry/usage_tracking.py +0 -0
  112. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/ui/console_display.py +0 -0
  113. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/__init__.py +0 -0
  114. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/embedding/__init__.py +0 -0
  115. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/embedding/embedding_base.py +0 -0
  116. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/embedding/embedding_cohere.py +0 -0
  117. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/embedding/embedding_openai.py +0 -0
  118. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/evaluator_optimizer/__init__.py +0 -0
  119. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py +0 -0
  120. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/__init__.py +0 -0
  121. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py +0 -0
  122. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py +0 -0
  123. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding_cohere.py +0 -0
  124. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding_openai.py +0 -0
  125. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py +0 -0
  126. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm_anthropic.py +0 -0
  127. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm_openai.py +0 -0
  128. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/__init__.py +0 -0
  129. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/anthropic_utils.py +0 -0
  130. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/augmented_llm.py +0 -0
  131. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py +0 -0
  132. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/augmented_llm_openai.py +0 -0
  133. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/augmented_llm_playback.py +0 -0
  134. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/llm_selector.py +0 -0
  135. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/model_factory.py +0 -0
  136. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/openai_utils.py +0 -0
  137. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/prompt_utils.py +0 -0
  138. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/__init__.py +0 -0
  139. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/multipart_converter_anthropic.py +0 -0
  140. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/multipart_converter_openai.py +0 -0
  141. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/openai_multipart.py +0 -0
  142. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/sampling_converter_anthropic.py +0 -0
  143. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/providers/sampling_converter_openai.py +0 -0
  144. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/llm/sampling_format_converter.py +0 -0
  145. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/orchestrator/__init__.py +0 -0
  146. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/orchestrator/orchestrator.py +0 -0
  147. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/orchestrator/orchestrator_models.py +0 -0
  148. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/orchestrator/orchestrator_prompts.py +0 -0
  149. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/parallel/__init__.py +0 -0
  150. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/parallel/fan_in.py +0 -0
  151. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/parallel/fan_out.py +0 -0
  152. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/parallel/parallel_llm.py +0 -0
  153. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/__init__.py +0 -0
  154. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/router_base.py +0 -0
  155. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/router_embedding.py +0 -0
  156. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/router_embedding_cohere.py +0 -0
  157. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/router_embedding_openai.py +0 -0
  158. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/router/router_llm.py +0 -0
  159. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/swarm/__init__.py +0 -0
  160. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/swarm/swarm.py +0 -0
  161. {fast_agent_mcp-0.1.9 → fast_agent_mcp-0.1.11}/src/mcp_agent/workflows/swarm/swarm_anthropic.py +0 -0
  162. {fast_agent_mcp-0.1.9 → 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.9
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,15 +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 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
- > [!TIP] > `fast-agent` is now MCP Native! Coming Soon - Full Documentation Site.
261
+ > [!TIP]
262
+ > `fast-agent` is now MCP Native! Coming Soon - Full Documentation Site and Further MCP Examples.
265
263
 
266
264
  ### Agent Application Development
267
265
 
@@ -271,7 +269,7 @@ Chat with individual Agents and Components before, during and after workflow exe
271
269
 
272
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/)
273
271
 
274
- ![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)
275
273
 
276
274
  ## Get started:
277
275
 
@@ -596,6 +594,14 @@ agent["greeter"].send("Good Evening!") # Dictionary access is supported
596
594
 
597
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:
598
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
+
599
605
  #### MCP Tool Result Conversion
600
606
 
601
607
  LLM APIs have restrictions on the content types that can be returned as Tool Calls/Function results via their Chat Completions API's:
@@ -611,40 +617,33 @@ MCP Prompts are supported with `apply_prompt(name,arguments)`, which always retu
611
617
 
612
618
  Prompts can also be applied interactively through the interactive interface by using the `/prompt` command.
613
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
+
614
634
  ### Secrets File
615
635
 
616
636
  > [!TIP]
617
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.
618
638
 
639
+ ### Interactive Shell
640
+
641
+ ![fast-agent](https://github.com/user-attachments/assets/3e692103-bf97-489a-b519-2d0fee036369)
642
+
619
643
  ## Project Notes
620
644
 
621
645
  `fast-agent` builds on the [`mcp-agent`](https://github.com/lastmile-ai/mcp-agent) project by Sarmad Qadri.
622
646
 
623
- ### llmindset.co.uk fork:
624
-
625
- - Addition of MCP Prompts including Prompt Server and agent save/replay ability.
626
- - Overhaul of Eval/Opt for Conversation Management
627
- - Removed instructor/double-llm calling - native structured outputs for OAI.
628
- - Improved handling of Parallel/Fan-In and respose option
629
- - XML based generated prompts
630
- - "FastAgent" style prototyping, with per-agent models
631
- - API keys through Environment Variables
632
- - Warm-up / Post-Workflow Agent Interactions
633
- - Quick Setup
634
- - Interactive Prompt Mode
635
- - Simple Model Selection with aliases
636
- - User/Assistant and Tool Call message display
637
- - MCP Sever Environment Variable support
638
- - MCP Roots support
639
- - Comprehensive Progress display
640
- - JSONL file logging with secret revokation
641
- - OpenAI o1/o3-mini support with reasoning level
642
- - Enhanced Human Input Messaging and Handling
643
- - Declarative workflows
644
- - Numerous defect fixes
645
-
646
- ### Features to add (Commmitted)
647
-
648
- - Run Agent as MCP Server, with interop
649
- - Multi-part content types supporing Vision, PDF and multi-part Text.
650
- - 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,15 +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 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
- > [!TIP] > `fast-agent` is now MCP Native! Coming Soon - Full Documentation Site.
18
+ > [!TIP]
19
+ > `fast-agent` is now MCP Native! Coming Soon - Full Documentation Site and Further MCP Examples.
22
20
 
23
21
  ### Agent Application Development
24
22
 
@@ -28,7 +26,7 @@ Chat with individual Agents and Components before, during and after workflow exe
28
26
 
29
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/)
30
28
 
31
- ![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)
32
30
 
33
31
  ## Get started:
34
32
 
@@ -353,6 +351,14 @@ agent["greeter"].send("Good Evening!") # Dictionary access is supported
353
351
 
354
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:
355
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
+
356
362
  #### MCP Tool Result Conversion
357
363
 
358
364
  LLM APIs have restrictions on the content types that can be returned as Tool Calls/Function results via their Chat Completions API's:
@@ -368,40 +374,33 @@ MCP Prompts are supported with `apply_prompt(name,arguments)`, which always retu
368
374
 
369
375
  Prompts can also be applied interactively through the interactive interface by using the `/prompt` command.
370
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
+
371
391
  ### Secrets File
372
392
 
373
393
  > [!TIP]
374
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.
375
395
 
396
+ ### Interactive Shell
397
+
398
+ ![fast-agent](https://github.com/user-attachments/assets/3e692103-bf97-489a-b519-2d0fee036369)
399
+
376
400
  ## Project Notes
377
401
 
378
402
  `fast-agent` builds on the [`mcp-agent`](https://github.com/lastmile-ai/mcp-agent) project by Sarmad Qadri.
379
403
 
380
- ### llmindset.co.uk fork:
381
-
382
- - Addition of MCP Prompts including Prompt Server and agent save/replay ability.
383
- - Overhaul of Eval/Opt for Conversation Management
384
- - Removed instructor/double-llm calling - native structured outputs for OAI.
385
- - Improved handling of Parallel/Fan-In and respose option
386
- - XML based generated prompts
387
- - "FastAgent" style prototyping, with per-agent models
388
- - API keys through Environment Variables
389
- - Warm-up / Post-Workflow Agent Interactions
390
- - Quick Setup
391
- - Interactive Prompt Mode
392
- - Simple Model Selection with aliases
393
- - User/Assistant and Tool Call message display
394
- - MCP Sever Environment Variable support
395
- - MCP Roots support
396
- - Comprehensive Progress display
397
- - JSONL file logging with secret revokation
398
- - OpenAI o1/o3-mini support with reasoning level
399
- - Enhanced Human Input Messaging and Handling
400
- - Declarative workflows
401
- - Numerous defect fixes
402
-
403
- ### Features to add (Commmitted)
404
-
405
- - Run Agent as MCP Server, with interop
406
- - Multi-part content types supporing Vision, PDF and multi-part Text.
407
- - 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.9"
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",
@@ -9,7 +9,10 @@ from mcp.types import (
9
9
  ListToolsResult,
10
10
  TextContent,
11
11
  Tool,
12
+ EmbeddedResource,
13
+ ReadResourceResult,
12
14
  )
15
+ from mcp_agent.mcp.prompt_message_multipart import PromptMessageMultipart
13
16
 
14
17
  from mcp_agent.core.exceptions import PromptExitError
15
18
  from mcp_agent.mcp.mcp_aggregator import MCPAggregator
@@ -320,6 +323,11 @@ class Agent(MCPAggregator):
320
323
  ],
321
324
  )
322
325
 
326
+ async def read_resource(
327
+ self, server_name: str, resource_name: str
328
+ ) -> ReadResourceResult:
329
+ return None
330
+
323
331
  async def apply_prompt(
324
332
  self, prompt_name: str, arguments: dict[str, str] = None
325
333
  ) -> str:
@@ -359,3 +367,107 @@ class Agent(MCPAggregator):
359
367
  # The LLM will automatically generate a response if needed
360
368
  result = await self._llm.apply_prompt_template(prompt_result, display_name)
361
369
  return result
370
+
371
+ async def get_resource(self, server_name: str, resource_name: str):
372
+ """
373
+ Get a resource directly from an MCP server by name.
374
+
375
+ Args:
376
+ server_name: Name of the MCP server to retrieve the resource from
377
+ resource_name: Name of the resource to retrieve
378
+
379
+ Returns:
380
+ The resource object from the MCP server
381
+
382
+ Raises:
383
+ ValueError: If the server doesn't exist or the resource couldn't be found
384
+ """
385
+ if not self.initialized:
386
+ await self.initialize()
387
+
388
+ # Get the specified server connection
389
+ server = self.get_server(server_name)
390
+ if not server:
391
+ raise ValueError(f"Server '{server_name}' not found or not connected")
392
+
393
+ # Request the resource directly from the server
394
+ try:
395
+ resource_result = await server.get_resource(resource_name)
396
+ return resource_result
397
+ except Exception as e:
398
+ self.logger.error(
399
+ f"Error retrieving resource '{resource_name}' from server '{server_name}': {str(e)}"
400
+ )
401
+ raise ValueError(
402
+ f"Failed to retrieve resource '{resource_name}' from server '{server_name}': {str(e)}"
403
+ )
404
+
405
+ async def get_embedded_resources(
406
+ self, server_name: str, resource_name: str
407
+ ) -> List[EmbeddedResource]:
408
+ """
409
+ Get a resource from an MCP server and return it as a list of embedded resources ready for use in prompts.
410
+
411
+ Args:
412
+ server_name: Name of the MCP server to retrieve the resource from
413
+ resource_name: Name or URI of the resource to retrieve
414
+
415
+ Returns:
416
+ List of EmbeddedResource objects ready to use in a PromptMessageMultipart
417
+
418
+ Raises:
419
+ ValueError: If the server doesn't exist or the resource couldn't be found
420
+ """
421
+ # Get the raw resource result
422
+ result: ReadResourceResult = await super().get_resource(
423
+ server_name, resource_name
424
+ )
425
+
426
+ # Convert each resource content to an EmbeddedResource
427
+ embedded_resources: List[EmbeddedResource] = []
428
+ for resource_content in result.contents:
429
+ embedded_resource = EmbeddedResource(
430
+ type="resource", resource=resource_content, annotations=None
431
+ )
432
+ embedded_resources.append(embedded_resource)
433
+
434
+ return embedded_resources
435
+
436
+ async def with_resource(
437
+ self,
438
+ prompt_content: Union[str, PromptMessageMultipart],
439
+ server_name: str,
440
+ resource_name: str,
441
+ ) -> str:
442
+ """
443
+ Create a prompt with the given content and resource, then send it to the agent.
444
+
445
+ Args:
446
+ prompt_content: Either a string message or an existing PromptMessageMultipart
447
+ server_name: Name of the MCP server to retrieve the resource from
448
+ resource_name: Name or URI of the resource to retrieve
449
+
450
+ Returns:
451
+ The agent's response as a string
452
+ """
453
+ # Get the embedded resources
454
+ embedded_resources: List[EmbeddedResource] = await self.get_embedded_resources(
455
+ server_name, resource_name
456
+ )
457
+
458
+ # Create or update the prompt message
459
+ prompt: PromptMessageMultipart
460
+ if isinstance(prompt_content, str):
461
+ # Create a new prompt with the text and resources
462
+ content = [TextContent(type="text", text=prompt_content)]
463
+ content.extend(embedded_resources)
464
+ prompt = PromptMessageMultipart(role="user", content=content)
465
+ elif isinstance(prompt_content, PromptMessageMultipart):
466
+ # Add resources to the existing prompt
467
+ prompt = prompt_content
468
+ prompt.content.extend(embedded_resources)
469
+ else:
470
+ raise TypeError("prompt_content must be a string or PromptMessageMultipart")
471
+
472
+ # Send the prompt to the agent and return the response
473
+ return await self._llm.generate_prompt(prompt, None)
@@ -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."""
@@ -24,7 +24,6 @@ from mcp_agent.executor.executor import Executor
24
24
  from mcp_agent.executor.decorator_registry import (
25
25
  DecoratorRegistry,
26
26
  register_asyncio_decorators,
27
- register_temporal_decorators,
28
27
  )
29
28
  from mcp_agent.executor.task_registry import ActivityRegistry
30
29
  from mcp_agent.executor.executor import AsyncioExecutor
@@ -194,7 +193,6 @@ async def initialize_context(
194
193
 
195
194
  context.decorator_registry = DecoratorRegistry()
196
195
  register_asyncio_decorators(context.decorator_registry)
197
- register_temporal_decorators(context.decorator_registry)
198
196
 
199
197
  # Store the tracer in context if needed
200
198
  context.tracer = trace.get_tracer(config.otel.service_name)
@@ -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
  """
@@ -172,16 +172,17 @@ async def create_agents_by_type(
172
172
  if agent_type == AgentType.BASIC:
173
173
  # Get the agent name for special handling
174
174
  agent_name = agent_data["config"].name
175
- agent = Agent(config=config, context=app_instance.context)
176
-
177
- # Set up LLM with proper configuration
178
- async with agent:
179
- llm_factory = model_factory_func(
180
- model=config.model,
181
- request_params=config.default_request_params,
182
- )
183
- agent._llm = await agent.attach_llm(llm_factory)
175
+ agent = Agent(
176
+ config=config,
177
+ context=app_instance.context,
178
+ )
179
+ await agent.initialize()
184
180
 
181
+ llm_factory = model_factory_func(
182
+ model=config.model,
183
+ request_params=config.default_request_params,
184
+ )
185
+ agent._llm = await agent.attach_llm(llm_factory)
185
186
  # Store the agent
186
187
  instance = agent
187
188
 
@@ -222,16 +223,16 @@ async def create_agents_by_type(
222
223
  default_request_params=base_params,
223
224
  )
224
225
  planner_agent = Agent(
225
- config=planner_config, context=app_instance.context
226
+ config=planner_config,
227
+ context=app_instance.context,
226
228
  )
227
229
  planner_factory = model_factory_func(
228
230
  model=config.model,
229
231
  request_params=config.default_request_params,
230
232
  )
231
233
 
232
- async with planner_agent:
233
- planner = await planner_agent.attach_llm(planner_factory)
234
-
234
+ planner = await planner_agent.attach_llm(planner_factory)
235
+ await planner.initialize()
235
236
  # Create the orchestrator with pre-configured planner
236
237
  instance = Orchestrator(
237
238
  name=config.name,
@@ -16,7 +16,6 @@ from contextlib import asynccontextmanager
16
16
  from functools import partial
17
17
 
18
18
  from mcp_agent.app import MCPApp
19
- from mcp_agent.context_dependent import ContextDependent
20
19
  from mcp_agent.config import Settings
21
20
 
22
21
  from mcp_agent.core.agent_app import AgentApp
@@ -64,7 +63,7 @@ from mcp_agent.mcp_server import AgentMCPServer
64
63
  T = TypeVar("T") # For the wrapper classes
65
64
 
66
65
 
67
- class FastAgent(ContextDependent):
66
+ class FastAgent:
68
67
  """
69
68
  A decorator-based interface for MCP Agent applications.
70
69
  Provides a simplified way to create and manage agents using decorators.
@@ -320,6 +319,7 @@ class FastAgent(ContextDependent):
320
319
  """
321
320
  active_agents = {}
322
321
  had_error = False
322
+ await self.app.initialize()
323
323
 
324
324
  # Handle quiet mode by disabling logger settings after initialization
325
325
  quiet_mode = hasattr(self, "args") and self.args.quiet
@@ -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
@@ -8,6 +11,7 @@ from typing import List, Optional, Dict, Union, TYPE_CHECKING
8
11
  from mcp_agent.agents.agent import Agent
9
12
  from mcp_agent.app import MCPApp
10
13
  from mcp_agent.mcp.prompt_message_multipart import PromptMessageMultipart
14
+ from mcp.types import EmbeddedResource
11
15
 
12
16
  # Handle circular imports
13
17
  if TYPE_CHECKING:
@@ -129,6 +133,43 @@ class LLMAgentProxy(BaseAgentProxy):
129
133
  """
130
134
  return await self._agent.apply_prompt(prompt_name, arguments)
131
135
 
136
+ # Add the new methods
137
+ async def get_embedded_resources(
138
+ self, server_name: str, resource_name: str
139
+ ) -> List[EmbeddedResource]:
140
+ """
141
+ Get a resource from an MCP server and return it as a list of embedded resources ready for use in prompts.
142
+
143
+ Args:
144
+ server_name: Name of the MCP server to retrieve the resource from
145
+ resource_name: Name or URI of the resource to retrieve
146
+
147
+ Returns:
148
+ List of EmbeddedResource objects ready to use in a PromptMessageMultipart
149
+ """
150
+ return await self._agent.get_embedded_resources(server_name, resource_name)
151
+
152
+ async def with_resource(
153
+ self,
154
+ prompt_content: Union[str, PromptMessageMultipart],
155
+ server_name: str,
156
+ resource_name: str,
157
+ ) -> str:
158
+ """
159
+ Create a prompt with the given content and resource, then send it to the agent.
160
+
161
+ Args:
162
+ prompt_content: Either a string message or an existing PromptMessageMultipart
163
+ server_name: Name of the MCP server to retrieve the resource from
164
+ resource_name: Name or URI of the resource to retrieve
165
+
166
+ Returns:
167
+ The agent's response as a string
168
+ """
169
+ return await self._agent.with_resource(
170
+ prompt_content, server_name, resource_name
171
+ )
172
+
132
173
 
133
174
  class WorkflowProxy(BaseAgentProxy):
134
175
  """Proxy for workflow types that implement generate_str() directly"""
@@ -177,10 +177,7 @@ class BatchingListener(FilteredListener):
177
177
 
178
178
  if self._flush_task and not self._flush_task.done():
179
179
  self._flush_task.cancel()
180
- try:
181
- await self._flush_task
182
- except asyncio.CancelledError:
183
- pass
180
+ await self._flush_task
184
181
  self._flush_task = None
185
182
  await self.flush()
186
183
 
@@ -193,8 +190,8 @@ class BatchingListener(FilteredListener):
193
190
  )
194
191
  except asyncio.TimeoutError:
195
192
  await self.flush()
196
- except asyncio.CancelledError:
197
- pass
193
+ # except asyncio.CancelledError:
194
+ # break
198
195
  finally:
199
196
  await self.flush() # Final flush
200
197
 
@@ -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.