fast-agent-mcp 0.0.13__tar.gz → 0.0.15__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 (122) hide show
  1. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/PKG-INFO +213 -15
  2. fast_agent_mcp-0.0.15/README.md +262 -0
  3. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/pyproject.toml +1 -1
  4. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/cli/commands/bootstrap.py +1 -1
  5. fast_agent_mcp-0.0.15/src/mcp_agent/core/agent_app.py +163 -0
  6. fast_agent_mcp-0.0.15/src/mcp_agent/core/agent_types.py +16 -0
  7. fast_agent_mcp-0.0.15/src/mcp_agent/core/agent_utils.py +65 -0
  8. fast_agent_mcp-0.0.15/src/mcp_agent/core/error_handling.py +23 -0
  9. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/core/exceptions.py +7 -0
  10. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/core/fastagent.py +407 -301
  11. fast_agent_mcp-0.0.15/src/mcp_agent/core/proxies.py +127 -0
  12. fast_agent_mcp-0.0.15/src/mcp_agent/core/types.py +22 -0
  13. fast_agent_mcp-0.0.15/src/mcp_agent/resources/examples/internal/social.py +66 -0
  14. fast_agent_mcp-0.0.15/src/mcp_agent/resources/examples/workflows/chaining.py +44 -0
  15. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/workflows/parallel.py +4 -0
  16. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/llm/augmented_llm.py +75 -1
  17. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py +49 -18
  18. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/parallel/parallel_llm.py +32 -7
  19. fast_agent_mcp-0.0.13/README.md +0 -64
  20. fast_agent_mcp-0.0.13/src/mcp_agent/resources/examples/workflows/chaining.py +0 -34
  21. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/.gitignore +0 -0
  22. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/LICENSE +0 -0
  23. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/__init__.py +0 -0
  24. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/agents/__init__.py +0 -0
  25. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/agents/agent.py +0 -0
  26. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/app.py +0 -0
  27. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/cli/__init__.py +0 -0
  28. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/cli/__main__.py +0 -0
  29. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/cli/commands/config.py +0 -0
  30. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/cli/commands/setup.py +0 -0
  31. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/cli/main.py +0 -0
  32. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/cli/terminal.py +0 -0
  33. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/config.py +0 -0
  34. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/console.py +0 -0
  35. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/context.py +0 -0
  36. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/context_dependent.py +0 -0
  37. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/core/__init__.py +0 -0
  38. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/core/enhanced_prompt.py +0 -0
  39. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/core/server_validation.py +0 -0
  40. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/eval/__init__.py +0 -0
  41. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/event_progress.py +0 -0
  42. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/executor/__init__.py +0 -0
  43. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/executor/decorator_registry.py +0 -0
  44. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/executor/executor.py +0 -0
  45. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/executor/task_registry.py +0 -0
  46. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/executor/temporal.py +0 -0
  47. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/executor/workflow.py +0 -0
  48. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/executor/workflow_signal.py +0 -0
  49. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/human_input/__init__.py +0 -0
  50. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/human_input/handler.py +0 -0
  51. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/human_input/types.py +0 -0
  52. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/logging/__init__.py +0 -0
  53. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/logging/events.py +0 -0
  54. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/logging/json_serializer.py +0 -0
  55. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/logging/listeners.py +0 -0
  56. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/logging/logger.py +0 -0
  57. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/logging/rich_progress.py +0 -0
  58. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/logging/tracing.py +0 -0
  59. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/logging/transport.py +0 -0
  60. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/mcp/__init__.py +0 -0
  61. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/mcp/gen_client.py +0 -0
  62. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/mcp/mcp_activity.py +0 -0
  63. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/mcp/mcp_agent_client_session.py +0 -0
  64. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/mcp/mcp_agent_server.py +0 -0
  65. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/mcp/mcp_aggregator.py +0 -0
  66. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/mcp/mcp_connection_manager.py +0 -0
  67. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/mcp/stdio.py +0 -0
  68. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/mcp_server_registry.py +0 -0
  69. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/progress_display.py +0 -0
  70. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/data-analysis/analysis.py +0 -0
  71. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/data-analysis/fastagent.config.yaml +0 -0
  72. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +0 -0
  73. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/internal/agent.py +0 -0
  74. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/internal/job.py +0 -0
  75. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/mcp_researcher/researcher-eval.py +0 -0
  76. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/researcher/fastagent.config.yaml +0 -0
  77. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/researcher/researcher-eval.py +0 -0
  78. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/researcher/researcher.py +0 -0
  79. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/workflows/agent_build.py +0 -0
  80. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/workflows/evaluator.py +0 -0
  81. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/workflows/fastagent.config.yaml +0 -0
  82. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/workflows/human_input.py +0 -0
  83. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/workflows/orchestrator.py +0 -0
  84. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/resources/examples/workflows/router.py +0 -0
  85. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/telemetry/__init__.py +0 -0
  86. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/telemetry/usage_tracking.py +0 -0
  87. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/__init__.py +0 -0
  88. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/embedding/__init__.py +0 -0
  89. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/embedding/embedding_base.py +0 -0
  90. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/embedding/embedding_cohere.py +0 -0
  91. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/embedding/embedding_openai.py +0 -0
  92. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/evaluator_optimizer/__init__.py +0 -0
  93. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py +0 -0
  94. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/intent_classifier/__init__.py +0 -0
  95. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py +0 -0
  96. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py +0 -0
  97. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding_cohere.py +0 -0
  98. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding_openai.py +0 -0
  99. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py +0 -0
  100. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm_anthropic.py +0 -0
  101. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm_openai.py +0 -0
  102. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/llm/__init__.py +0 -0
  103. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/llm/augmented_llm_openai.py +0 -0
  104. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/llm/llm_selector.py +0 -0
  105. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/llm/model_factory.py +0 -0
  106. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/orchestrator/__init__.py +0 -0
  107. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/orchestrator/orchestrator.py +0 -0
  108. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/orchestrator/orchestrator_models.py +0 -0
  109. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/orchestrator/orchestrator_prompts.py +0 -0
  110. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/parallel/__init__.py +0 -0
  111. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/parallel/fan_in.py +0 -0
  112. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/parallel/fan_out.py +0 -0
  113. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/router/__init__.py +0 -0
  114. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/router/router_base.py +0 -0
  115. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/router/router_embedding.py +0 -0
  116. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/router/router_embedding_cohere.py +0 -0
  117. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/router/router_embedding_openai.py +0 -0
  118. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/router/router_llm.py +0 -0
  119. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/swarm/__init__.py +0 -0
  120. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/swarm/swarm.py +0 -0
  121. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/src/mcp_agent/workflows/swarm/swarm_anthropic.py +0 -0
  122. {fast_agent_mcp-0.0.13 → fast_agent_mcp-0.0.15}/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.0.13
3
+ Version: 0.0.15
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
@@ -247,13 +247,21 @@ Description-Content-Type: text/markdown
247
247
 
248
248
  ## Overview
249
249
 
250
- **`fast-agent`** lets you define, test and interact with agents, tools and workflows in minutes.
250
+ **`fast-agent`** enables you to create and interact with sophisticated Agents and Workflows in minutes.
251
251
 
252
- The simple declarative syntax lets you concentrate on the prompts, MCP Servers and compositions to build effective agents.
252
+ 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).
253
253
 
254
- Quickly compare how different models perform at Agent and MCP Server calling tasks, and build mixed multi-model workflows using the best provider for each task.
254
+ Evaluate how different models handle Agent and MCP Server calling tasks, then build multi-model workflows using the best provider for each task.
255
255
 
256
- ### Get started:
256
+ ### Agent Application Development
257
+
258
+ Prompts and configurations that define your Agent Applications are stored in simple files, with minimal boilerplate, enabling simple management and version control.
259
+
260
+ Chat with individual Agents and Components before, during and after workflow execution to tune and diagnose your application.
261
+
262
+ Simple model selection makes testing Model <-> MCP Server interaction painless.
263
+
264
+ ## Get started:
257
265
 
258
266
  Start by installing the [uv package manager](https://docs.astral.sh/uv/) for Python. Then:
259
267
 
@@ -265,15 +273,209 @@ uv run agent.py --model=o3-mini.low # specify a model
265
273
  fast-agent bootstrap workflow # create "building effective agents" examples
266
274
  ```
267
275
 
268
- Other bootstrap examples include a Researcher (with Evaluator-Optimizer workflow) and Data Analysis (similar to ChatGPT experience), demonstrating MCP Roots support.
276
+ Other bootstrap examples include a Researcher Agent (with Evaluator-Optimizer workflow) and Data Analysis Agent (similar to the ChatGPT experience), demonstrating MCP Roots support.
269
277
 
270
278
  > Windows Users - there are a couple of configuration changes needed for the Filesystem and Docker MCP Servers - necessary changes are detailed within the configuration files.
271
279
 
272
- ## Agent Development
280
+ ### Basic Agents
281
+
282
+ Defining an agent is as simple as:
283
+
284
+ ```python
285
+ @fast.agent(
286
+ instruction="Given an object, respond only with an estimate of its size."
287
+ )
288
+ ```
289
+
290
+ We can then send messages to the Agent:
291
+
292
+ ```python
293
+ async with fast.run() as agent:
294
+ moon_size = await agent("the moon")
295
+ print(moon_size)
296
+ ```
297
+
298
+ Or start an interactive chat with the Agent:
299
+
300
+ ```python
301
+ async with fast.run() as agent:
302
+ await agent()
303
+ ```
304
+
305
+ Here is the complete `sizer.py` Agent application, with boilerplate code:
306
+
307
+ ```python
308
+ import asyncio
309
+ from mcp_agent.core.fastagent import FastAgent
310
+
311
+ # Create the application
312
+ fast = FastAgent("Agent Example")
313
+
314
+ @fast.agent(
315
+ instruction="Given an object, respond only with an estimate of its size."
316
+ )
317
+
318
+ async def main():
319
+ async with fast.run() as agent:
320
+ await agent()
321
+
322
+ if __name__ == "__main__":
323
+ asyncio.run(main())
324
+ ```
325
+
326
+ The Agent can then be run with `uv run sizer.py`.
327
+
328
+ Specify a model with the `--model` switch - for example `uv run sizer.py --model sonnet`.
329
+
330
+ ### Combining Agents and using MCP Servers
331
+
332
+ _To generate examples use `fast-agent bootstrap workflow`. This example can be run with `uv run chaining.py`. fast-agent looks for configuration files in the current directory before checking parent directories recursively._
333
+
334
+ Agents can be chained to build a workflow, using MCP Servers defined in the `fastagent.config.yaml` file:
335
+
336
+ ```python
337
+ @fast.agent(
338
+ "url_fetcher",
339
+ "Given a URL, provide a complete and comprehensive summary",
340
+ servers=["fetch"], # Name of an MCP Server defined in fastagent.config.yaml
341
+ )
342
+ @fast.agent(
343
+ "social_media",
344
+ """
345
+ Write a 280 character social media post for any given text.
346
+ Respond only with the post, never use hashtags.
347
+ """,
348
+ )
349
+
350
+ async def main():
351
+ async with fast.run() as agent:
352
+ await agent.social_media(
353
+ await agent.url_fetcher("http://llmindset.co.uk/resources/mcp-hfspace/")
354
+ )
355
+ ```
356
+
357
+ All Agents and Workflows respond to `.send("message")` and `.prompt()` to begin a chat session.
358
+
359
+ Saved as `social.py` we can now run this workflow from the command line with:
360
+
361
+ ```bash
362
+ uv run social.py --agent social_media --message "<url>"
363
+ ```
364
+
365
+ Add the `--quiet` switch to only return the final response.
366
+
367
+ ## Workflows
368
+
369
+ ### Chain
370
+
371
+ The `chain` workflow offers a more declarative approach to calling Agents in sequence:
372
+
373
+ ```python
273
374
 
274
- FastAgent lets you interact with Agents during a workflow, enabling "warm-up" and diagnostic prompting to improve behaviour and refine prompts.
375
+ @fast.chain(
376
+ "post_writer",
377
+ sequence=["url_fetcher","social_media"]
378
+ )
275
379
 
276
- ## MCP Server Development
380
+ # we can them prompt it directly:
381
+ async with fast.run() as agent:
382
+ await agent.post_writer()
383
+
384
+ ```
385
+
386
+ This starts an interactive session, which produces a short social media post for a given URL. If a _chain_ is prompted, by default it returns to a chat with last Agent in the chain.
387
+
388
+ Chains can be incorporated in other workflows, or contain other workflow elements (including other Chains). You can set an `instruction` to precisely describe it's capabilities to other workflow steps if needed.
389
+
390
+ ### Parallel
391
+
392
+ The Parallel Workflow sends the same message to multiple Agents simultaneously (`fan-out`), then uses the `fan-in` Agent to process the combined content.
393
+
394
+ ```python
395
+ @fast.agent("translate_fr", "Translate the text to French")
396
+ @fast.agent("translate_de", "Translate the text to German")
397
+ @fast.agent("translate_es", "Translate the text to Spanish")
398
+
399
+ @fast.parallel(
400
+ name="translate",
401
+ fan_out=["translate_fr","translate_de","translate_es"]
402
+ )
403
+
404
+ @fast.chain(
405
+ "post_writer",
406
+ sequence=["url_fetcher","social_media","translate"]
407
+ )
408
+ ```
409
+
410
+ Look at the `parallel.py` workflow example for more examples. If you don't specify a `fan-in` agent, the `parallel` returns Agent results verbatim.
411
+
412
+ The Parallel is also useful to ensemble ideas from different LLMs.
413
+
414
+ ### Evaluator-Optimizer
415
+
416
+ Evaluator-Optimizers combine 2 agents: one to generate content (the `generator`), and the other to judge that content and provide actionable feedback (the `evaluator`). Messages are sent to the generator first, then the pair run in a loop until either the evaluator is satisfied with the quality, or the maximum number of refinements is reached.
417
+
418
+ ```python
419
+ @fast.evaluator_optimizer(
420
+ name="researcher"
421
+ generator="web_searcher"
422
+ evaluator="quality_assurance"
423
+ min_rating="EXCELLENT"
424
+ max_refinements=3
425
+ )
426
+
427
+ async with fast.run() as agent:
428
+ await agent.researcher.send("produce a report on how to make the perfect espresso")
429
+ ```
430
+
431
+ See the `evaluator.py` workflow example, or `fast-agent bootstrap researcher` for a more complete example.
432
+
433
+ ### Router
434
+
435
+ Routers use an LLM to assess a message, and route it to the most appropriate Agent. The routing prompt is automatically generated based on the Agent instructions and available Servers.
436
+
437
+ ```python
438
+ @fast.router(
439
+ name="route"
440
+ agents["agent1","agent2","agent3"]
441
+ )
442
+ ```
443
+
444
+ Look at the `router.py` workflow for an example.
445
+
446
+ ### Orchestrator
447
+
448
+ Given a complex task, the Orchestrator uses an LLM to generate a plan to divide the task amongst the available Agents. The planning and aggregation prompts are generated by the Orchestrator, which benefits from using more capable models. Plans can either be built once at the beginning (`plantype="full"`) or iteratively (`plantype="iterative"`).
449
+
450
+ ```python
451
+ @fast.orchestrator(
452
+ name="orchestrate"
453
+ agents=["task1","task2","task3"]
454
+ )
455
+ ```
456
+
457
+ See `orchestrator.py` in the workflow examples.
458
+
459
+ ## Agent Features
460
+
461
+ ```python
462
+ @fast.agent(
463
+ name="agent",
464
+ instructions="instructions",
465
+ servers=["filesystem"], # list of MCP Servers for the agent, configured in fastagent.config.yaml
466
+ model="o3-mini.high", # specify a model for the agent
467
+ use_history=True, # agent can maintain chat history
468
+ human_input=True, # agent can request human input
469
+ )
470
+ ```
471
+
472
+ ### Human Input
473
+
474
+ When `human_input` is set to true for an Agent, it is presented with the option to prompt the User for input.
475
+
476
+ ## Project Notes
477
+
478
+ `fast-agent` builds on the [`mcp-agent`](https://github.com/lastmile-ai/mcp-agent) project by Sarmad Qadri.
277
479
 
278
480
  ### llmindset.co.uk fork:
279
481
 
@@ -292,10 +494,6 @@ FastAgent lets you interact with Agents during a workflow, enabling "warm-up" an
292
494
  - Enhanced Human Input Messaging and Handling
293
495
  - Declarative workflows
294
496
 
295
- ## Get Started
296
-
297
- We recommend using [uv](https://docs.astral.sh/uv/) to manage your Python projects:
298
-
299
- ## Table of Contents
497
+ ### Features to add.
300
498
 
301
- We welcome any and all kinds of contributions. Please see the [CONTRIBUTING guidelines](./CONTRIBUTING.md) to get started.
499
+ - Chat History Clear.
@@ -0,0 +1,262 @@
1
+ ## FastAgent
2
+
3
+ <p align="center">
4
+ <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>
5
+ <a href="https://github.com/evalstate/fast-agent/issues"><img src="https://img.shields.io/github/issues-raw/evalstate/fast-agent" /></a>
6
+ <a href="https://lmai.link/discord/mcp-agent"><img src="https://shields.io/discord/1089284610329952357" alt="discord" /></a>
7
+ <img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/fast-agent-mcp?label=pypi%20%7C%20downloads"/>
8
+ <a href="https://github.com/evalstate/fast-agent-mcp/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/fast-agent-mcp" /></a>
9
+ </p>
10
+
11
+ ## Overview
12
+
13
+ **`fast-agent`** enables you to create and interact with sophisticated Agents and Workflows in minutes.
14
+
15
+ 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
+
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
+ ### Agent Application Development
20
+
21
+ Prompts and configurations that define your Agent Applications are stored in simple files, with minimal boilerplate, enabling simple management and version control.
22
+
23
+ Chat with individual Agents and Components before, during and after workflow execution to tune and diagnose your application.
24
+
25
+ Simple model selection makes testing Model <-> MCP Server interaction painless.
26
+
27
+ ## Get started:
28
+
29
+ Start by installing the [uv package manager](https://docs.astral.sh/uv/) for Python. Then:
30
+
31
+ ```bash
32
+ uv pip install fast-agent-mcp # install fast-agent
33
+ fast-agent setup # create an example agent and config files
34
+ uv run agent.py # run your first agent
35
+ uv run agent.py --model=o3-mini.low # specify a model
36
+ fast-agent bootstrap workflow # create "building effective agents" examples
37
+ ```
38
+
39
+ Other bootstrap examples include a Researcher Agent (with Evaluator-Optimizer workflow) and Data Analysis Agent (similar to the ChatGPT experience), demonstrating MCP Roots support.
40
+
41
+ > Windows Users - there are a couple of configuration changes needed for the Filesystem and Docker MCP Servers - necessary changes are detailed within the configuration files.
42
+
43
+ ### Basic Agents
44
+
45
+ Defining an agent is as simple as:
46
+
47
+ ```python
48
+ @fast.agent(
49
+ instruction="Given an object, respond only with an estimate of its size."
50
+ )
51
+ ```
52
+
53
+ We can then send messages to the Agent:
54
+
55
+ ```python
56
+ async with fast.run() as agent:
57
+ moon_size = await agent("the moon")
58
+ print(moon_size)
59
+ ```
60
+
61
+ Or start an interactive chat with the Agent:
62
+
63
+ ```python
64
+ async with fast.run() as agent:
65
+ await agent()
66
+ ```
67
+
68
+ Here is the complete `sizer.py` Agent application, with boilerplate code:
69
+
70
+ ```python
71
+ import asyncio
72
+ from mcp_agent.core.fastagent import FastAgent
73
+
74
+ # Create the application
75
+ fast = FastAgent("Agent Example")
76
+
77
+ @fast.agent(
78
+ instruction="Given an object, respond only with an estimate of its size."
79
+ )
80
+
81
+ async def main():
82
+ async with fast.run() as agent:
83
+ await agent()
84
+
85
+ if __name__ == "__main__":
86
+ asyncio.run(main())
87
+ ```
88
+
89
+ The Agent can then be run with `uv run sizer.py`.
90
+
91
+ Specify a model with the `--model` switch - for example `uv run sizer.py --model sonnet`.
92
+
93
+ ### Combining Agents and using MCP Servers
94
+
95
+ _To generate examples use `fast-agent bootstrap workflow`. This example can be run with `uv run chaining.py`. fast-agent looks for configuration files in the current directory before checking parent directories recursively._
96
+
97
+ Agents can be chained to build a workflow, using MCP Servers defined in the `fastagent.config.yaml` file:
98
+
99
+ ```python
100
+ @fast.agent(
101
+ "url_fetcher",
102
+ "Given a URL, provide a complete and comprehensive summary",
103
+ servers=["fetch"], # Name of an MCP Server defined in fastagent.config.yaml
104
+ )
105
+ @fast.agent(
106
+ "social_media",
107
+ """
108
+ Write a 280 character social media post for any given text.
109
+ Respond only with the post, never use hashtags.
110
+ """,
111
+ )
112
+
113
+ async def main():
114
+ async with fast.run() as agent:
115
+ await agent.social_media(
116
+ await agent.url_fetcher("http://llmindset.co.uk/resources/mcp-hfspace/")
117
+ )
118
+ ```
119
+
120
+ All Agents and Workflows respond to `.send("message")` and `.prompt()` to begin a chat session.
121
+
122
+ Saved as `social.py` we can now run this workflow from the command line with:
123
+
124
+ ```bash
125
+ uv run social.py --agent social_media --message "<url>"
126
+ ```
127
+
128
+ Add the `--quiet` switch to only return the final response.
129
+
130
+ ## Workflows
131
+
132
+ ### Chain
133
+
134
+ The `chain` workflow offers a more declarative approach to calling Agents in sequence:
135
+
136
+ ```python
137
+
138
+ @fast.chain(
139
+ "post_writer",
140
+ sequence=["url_fetcher","social_media"]
141
+ )
142
+
143
+ # we can them prompt it directly:
144
+ async with fast.run() as agent:
145
+ await agent.post_writer()
146
+
147
+ ```
148
+
149
+ This starts an interactive session, which produces a short social media post for a given URL. If a _chain_ is prompted, by default it returns to a chat with last Agent in the chain.
150
+
151
+ Chains can be incorporated in other workflows, or contain other workflow elements (including other Chains). You can set an `instruction` to precisely describe it's capabilities to other workflow steps if needed.
152
+
153
+ ### Parallel
154
+
155
+ The Parallel Workflow sends the same message to multiple Agents simultaneously (`fan-out`), then uses the `fan-in` Agent to process the combined content.
156
+
157
+ ```python
158
+ @fast.agent("translate_fr", "Translate the text to French")
159
+ @fast.agent("translate_de", "Translate the text to German")
160
+ @fast.agent("translate_es", "Translate the text to Spanish")
161
+
162
+ @fast.parallel(
163
+ name="translate",
164
+ fan_out=["translate_fr","translate_de","translate_es"]
165
+ )
166
+
167
+ @fast.chain(
168
+ "post_writer",
169
+ sequence=["url_fetcher","social_media","translate"]
170
+ )
171
+ ```
172
+
173
+ Look at the `parallel.py` workflow example for more examples. If you don't specify a `fan-in` agent, the `parallel` returns Agent results verbatim.
174
+
175
+ The Parallel is also useful to ensemble ideas from different LLMs.
176
+
177
+ ### Evaluator-Optimizer
178
+
179
+ Evaluator-Optimizers combine 2 agents: one to generate content (the `generator`), and the other to judge that content and provide actionable feedback (the `evaluator`). Messages are sent to the generator first, then the pair run in a loop until either the evaluator is satisfied with the quality, or the maximum number of refinements is reached.
180
+
181
+ ```python
182
+ @fast.evaluator_optimizer(
183
+ name="researcher"
184
+ generator="web_searcher"
185
+ evaluator="quality_assurance"
186
+ min_rating="EXCELLENT"
187
+ max_refinements=3
188
+ )
189
+
190
+ async with fast.run() as agent:
191
+ await agent.researcher.send("produce a report on how to make the perfect espresso")
192
+ ```
193
+
194
+ See the `evaluator.py` workflow example, or `fast-agent bootstrap researcher` for a more complete example.
195
+
196
+ ### Router
197
+
198
+ Routers use an LLM to assess a message, and route it to the most appropriate Agent. The routing prompt is automatically generated based on the Agent instructions and available Servers.
199
+
200
+ ```python
201
+ @fast.router(
202
+ name="route"
203
+ agents["agent1","agent2","agent3"]
204
+ )
205
+ ```
206
+
207
+ Look at the `router.py` workflow for an example.
208
+
209
+ ### Orchestrator
210
+
211
+ Given a complex task, the Orchestrator uses an LLM to generate a plan to divide the task amongst the available Agents. The planning and aggregation prompts are generated by the Orchestrator, which benefits from using more capable models. Plans can either be built once at the beginning (`plantype="full"`) or iteratively (`plantype="iterative"`).
212
+
213
+ ```python
214
+ @fast.orchestrator(
215
+ name="orchestrate"
216
+ agents=["task1","task2","task3"]
217
+ )
218
+ ```
219
+
220
+ See `orchestrator.py` in the workflow examples.
221
+
222
+ ## Agent Features
223
+
224
+ ```python
225
+ @fast.agent(
226
+ name="agent",
227
+ instructions="instructions",
228
+ servers=["filesystem"], # list of MCP Servers for the agent, configured in fastagent.config.yaml
229
+ model="o3-mini.high", # specify a model for the agent
230
+ use_history=True, # agent can maintain chat history
231
+ human_input=True, # agent can request human input
232
+ )
233
+ ```
234
+
235
+ ### Human Input
236
+
237
+ When `human_input` is set to true for an Agent, it is presented with the option to prompt the User for input.
238
+
239
+ ## Project Notes
240
+
241
+ `fast-agent` builds on the [`mcp-agent`](https://github.com/lastmile-ai/mcp-agent) project by Sarmad Qadri.
242
+
243
+ ### llmindset.co.uk fork:
244
+
245
+ - "FastAgent" style prototyping, with per-agent models
246
+ - Api keys through Environment Variables
247
+ - Warm-up / Post-Workflow Agent Interactions
248
+ - Quick Setup
249
+ - Interactive Prompt Mode
250
+ - Simple Model Selection with aliases
251
+ - User/Assistant and Tool Call message display
252
+ - MCP Sever Environment Variable support
253
+ - MCP Roots support
254
+ - Comprehensive Progress display
255
+ - JSONL file logging with secret revokation
256
+ - OpenAI o1/o3-mini support with reasoning level
257
+ - Enhanced Human Input Messaging and Handling
258
+ - Declarative workflows
259
+
260
+ ### Features to add.
261
+
262
+ - Chat History Clear.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fast-agent-mcp"
3
- version = "0.0.13"
3
+ version = "0.0.15"
4
4
  description = "Define, Prompt and Test MCP enabled Agents and Workflows"
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -28,7 +28,7 @@ EXAMPLE_TYPES = {
28
28
  "router.py",
29
29
  "fastagent.config.yaml",
30
30
  ],
31
- "create_subdir": False,
31
+ "create_subdir": True,
32
32
  },
33
33
  "researcher": {
34
34
  "description": "Research agent example with additional evaluation/optimization\n"