fast-agent-mcp 0.0.9__tar.gz → 0.0.12__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.

Potentially problematic release.


This version of fast-agent-mcp might be problematic. Click here for more details.

Files changed (116) hide show
  1. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/PKG-INFO +17 -11
  2. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/README.md +15 -10
  3. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/pyproject.toml +2 -1
  4. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/app.py +4 -4
  5. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/cli/commands/bootstrap.py +2 -5
  6. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/cli/commands/setup.py +1 -1
  7. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/cli/main.py +4 -4
  8. fast_agent_mcp-0.0.12/src/mcp_agent/core/enhanced_prompt.py +315 -0
  9. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/core/fastagent.py +520 -388
  10. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/event_progress.py +5 -2
  11. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/human_input/handler.py +6 -2
  12. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/logging/rich_progress.py +10 -5
  13. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/mcp/mcp_aggregator.py +2 -1
  14. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/mcp/mcp_connection_manager.py +67 -37
  15. fast_agent_mcp-0.0.12/src/mcp_agent/resources/examples/internal/agent.py +17 -0
  16. fast_agent_mcp-0.0.12/src/mcp_agent/resources/examples/internal/job.py +83 -0
  17. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/mcp_researcher/researcher-eval.py +1 -1
  18. fast_agent_mcp-0.0.12/src/mcp_agent/resources/examples/researcher/fastagent.config.yaml +53 -0
  19. fast_agent_mcp-0.0.12/src/mcp_agent/resources/examples/researcher/researcher-eval.py +53 -0
  20. fast_agent_mcp-0.0.12/src/mcp_agent/resources/examples/researcher/researcher.py +38 -0
  21. fast_agent_mcp-0.0.12/src/mcp_agent/resources/examples/workflows/agent.py +17 -0
  22. fast_agent_mcp-0.0.12/src/mcp_agent/resources/examples/workflows/agent_build.py +61 -0
  23. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/workflows/chaining.py +0 -1
  24. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/workflows/evaluator.py +6 -3
  25. fast_agent_mcp-0.0.12/src/mcp_agent/resources/examples/workflows/fastagent.py +22 -0
  26. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/workflows/orchestrator.py +1 -1
  27. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py +91 -92
  28. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/llm/augmented_llm.py +14 -3
  29. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py +8 -5
  30. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/llm/augmented_llm_openai.py +20 -9
  31. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/llm/model_factory.py +25 -11
  32. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/orchestrator/orchestrator.py +68 -7
  33. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/orchestrator/orchestrator_prompts.py +11 -6
  34. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/router/router_llm.py +13 -2
  35. fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/workflows/fastagent.config.yaml +0 -9
  36. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/.gitignore +0 -0
  37. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/LICENSE +0 -0
  38. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/__init__.py +0 -0
  39. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/agents/__init__.py +0 -0
  40. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/agents/agent.py +0 -0
  41. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/cli/__init__.py +0 -0
  42. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/cli/__main__.py +0 -0
  43. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/cli/commands/config.py +0 -0
  44. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/cli/terminal.py +0 -0
  45. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/config.py +0 -0
  46. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/console.py +0 -0
  47. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/context.py +0 -0
  48. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/context_dependent.py +0 -0
  49. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/core/__init__.py +0 -0
  50. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/core/exceptions.py +0 -0
  51. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/core/server_validation.py +0 -0
  52. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/eval/__init__.py +0 -0
  53. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/executor/__init__.py +0 -0
  54. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/executor/decorator_registry.py +0 -0
  55. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/executor/executor.py +0 -0
  56. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/executor/task_registry.py +0 -0
  57. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/executor/temporal.py +0 -0
  58. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/executor/workflow.py +0 -0
  59. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/executor/workflow_signal.py +0 -0
  60. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/human_input/__init__.py +0 -0
  61. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/human_input/types.py +0 -0
  62. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/logging/__init__.py +0 -0
  63. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/logging/events.py +0 -0
  64. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/logging/json_serializer.py +0 -0
  65. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/logging/listeners.py +0 -0
  66. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/logging/logger.py +0 -0
  67. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/logging/tracing.py +0 -0
  68. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/logging/transport.py +0 -0
  69. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/mcp/__init__.py +0 -0
  70. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/mcp/gen_client.py +0 -0
  71. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/mcp/mcp_activity.py +0 -0
  72. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/mcp/mcp_agent_client_session.py +0 -0
  73. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/mcp/mcp_agent_server.py +0 -0
  74. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/mcp/stdio.py +0 -0
  75. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/mcp_server_registry.py +0 -0
  76. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/progress_display.py +0 -0
  77. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/data-analysis/analysis.py +0 -0
  78. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/data-analysis/fastagent.config.yaml +0 -0
  79. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +0 -0
  80. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/mcp_researcher/researcher.py +0 -0
  81. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/workflows/human_input.py +0 -0
  82. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/workflows/parallel.py +0 -0
  83. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/resources/examples/workflows/router.py +0 -0
  84. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/telemetry/__init__.py +0 -0
  85. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/telemetry/usage_tracking.py +0 -0
  86. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/__init__.py +0 -0
  87. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/embedding/__init__.py +0 -0
  88. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/embedding/embedding_base.py +0 -0
  89. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/embedding/embedding_cohere.py +0 -0
  90. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/embedding/embedding_openai.py +0 -0
  91. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/evaluator_optimizer/__init__.py +0 -0
  92. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/intent_classifier/__init__.py +0 -0
  93. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py +0 -0
  94. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py +0 -0
  95. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding_cohere.py +0 -0
  96. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding_openai.py +0 -0
  97. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py +0 -0
  98. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm_anthropic.py +0 -0
  99. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm_openai.py +0 -0
  100. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/llm/__init__.py +0 -0
  101. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/llm/llm_selector.py +0 -0
  102. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/orchestrator/__init__.py +0 -0
  103. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/orchestrator/orchestrator_models.py +0 -0
  104. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/parallel/__init__.py +0 -0
  105. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/parallel/fan_in.py +0 -0
  106. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/parallel/fan_out.py +0 -0
  107. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/parallel/parallel_llm.py +0 -0
  108. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/router/__init__.py +0 -0
  109. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/router/router_base.py +0 -0
  110. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/router/router_embedding.py +0 -0
  111. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/router/router_embedding_cohere.py +0 -0
  112. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/router/router_embedding_openai.py +0 -0
  113. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/swarm/__init__.py +0 -0
  114. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/swarm/swarm.py +0 -0
  115. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/src/mcp_agent/workflows/swarm/swarm_anthropic.py +0 -0
  116. {fast_agent_mcp-0.0.9 → fast_agent_mcp-0.0.12}/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.9
3
+ Version: 0.0.12
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
@@ -217,6 +217,7 @@ Requires-Dist: numpy>=2.2.1
217
217
  Requires-Dist: openai>=1.63.2
218
218
  Requires-Dist: opentelemetry-distro>=0.50b0
219
219
  Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.29.0
220
+ Requires-Dist: prompt-toolkit>=3.0.50
220
221
  Requires-Dist: pydantic-settings>=2.7.0
221
222
  Requires-Dist: pydantic>=2.10.4
222
223
  Requires-Dist: pyyaml>=6.0.2
@@ -246,27 +247,32 @@ Description-Content-Type: text/markdown
246
247
 
247
248
  ## Overview
248
249
 
249
- **`fast-agent`** lets you define, test and compose agents and tools in minutes.
250
+ **`fast-agent`** lets you define, test and interact with agents, tools and workflows in minutes.
250
251
 
251
- ### Get started:
252
-
253
- Install the [uv package manager](https://docs.astral.sh/uv/).
252
+ The simple declarative syntax lets you concentrate on the prompts, MCP Servers and compositions to build effective agents.
254
253
 
255
- `uv pip install fast-agent-mcp` - download and install fast-agent
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.
256
255
 
257
- `fast-agent setup` - setup an agent and configuration files.
256
+ ### Get started:
258
257
 
259
- `uv run agent.py` - run and interact with your first agent.
258
+ Start by installing the [uv package manager](https://docs.astral.sh/uv/) for Python. Then:
260
259
 
261
- `fast-agent bootstrap workflow` - generate example agents and workflows demonstrating each of the patterns from Anthropic's "[Building Effective Agents](https://www.anthropic.com/research/building-effective-agents)" paper.
260
+ ```bash
261
+ uv pip install fast-agent-mcp # install fast-agent
262
+ fast-agent setup # create an example agent and config files
263
+ uv run agent.py # run your first agent
264
+ uv run agent.py --model=o3-mini.low # specify a model
265
+ fast-agent bootstrap workflow # create "building effective agents" examples
266
+ ```
262
267
 
263
- `fast-agent bootstrap` -
268
+ Other bootstrap examples include a Researcher (with Evaluator-Optimizer workflow) and Data Analysis (similar to ChatGPT experience), demonstrating MCP Roots support.
264
269
 
265
- It's built on top of [mcp-agent](todo).
270
+ > 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.
266
271
 
267
272
  ### llmindset.co.uk fork:
268
273
 
269
274
  - "FastAgent" style prototyping, with per-agent models
275
+ - Api keys through Environment Variables
270
276
  - Warm-up / Post-Workflow Agent Interactions
271
277
  - Quick Setup
272
278
  - Interactive Prompt Mode
@@ -10,27 +10,32 @@
10
10
 
11
11
  ## Overview
12
12
 
13
- **`fast-agent`** lets you define, test and compose agents and tools in minutes.
13
+ **`fast-agent`** lets you define, test and interact with agents, tools and workflows in minutes.
14
14
 
15
- ### Get started:
16
-
17
- Install the [uv package manager](https://docs.astral.sh/uv/).
15
+ The simple declarative syntax lets you concentrate on the prompts, MCP Servers and compositions to build effective agents.
18
16
 
19
- `uv pip install fast-agent-mcp` - download and install fast-agent
17
+ 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.
20
18
 
21
- `fast-agent setup` - setup an agent and configuration files.
19
+ ### Get started:
22
20
 
23
- `uv run agent.py` - run and interact with your first agent.
21
+ Start by installing the [uv package manager](https://docs.astral.sh/uv/) for Python. Then:
24
22
 
25
- `fast-agent bootstrap workflow` - generate example agents and workflows demonstrating each of the patterns from Anthropic's "[Building Effective Agents](https://www.anthropic.com/research/building-effective-agents)" paper.
23
+ ```bash
24
+ uv pip install fast-agent-mcp # install fast-agent
25
+ fast-agent setup # create an example agent and config files
26
+ uv run agent.py # run your first agent
27
+ uv run agent.py --model=o3-mini.low # specify a model
28
+ fast-agent bootstrap workflow # create "building effective agents" examples
29
+ ```
26
30
 
27
- `fast-agent bootstrap` -
31
+ Other bootstrap examples include a Researcher (with Evaluator-Optimizer workflow) and Data Analysis (similar to ChatGPT experience), demonstrating MCP Roots support.
28
32
 
29
- It's built on top of [mcp-agent](todo).
33
+ > 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.
30
34
 
31
35
  ### llmindset.co.uk fork:
32
36
 
33
37
  - "FastAgent" style prototyping, with per-agent models
38
+ - Api keys through Environment Variables
34
39
  - Warm-up / Post-Workflow Agent Interactions
35
40
  - Quick Setup
36
41
  - Interactive Prompt Mode
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fast-agent-mcp"
3
- version = "0.0.9"
3
+ version = "0.0.12"
4
4
  description = "Define, Prompt and Test MCP enabled Agents and Workflows"
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
@@ -29,6 +29,7 @@ dependencies = [
29
29
  "scikit-learn>=1.6.0",
30
30
  "anthropic>=0.42.0",
31
31
  "openai>=1.63.2",
32
+ "prompt-toolkit>=3.0.50",
32
33
  ]
33
34
 
34
35
  [project.optional-dependencies]
@@ -135,8 +135,8 @@ class MCPApp:
135
135
  "MCPAgent initialized",
136
136
  data={
137
137
  "progress_action": "Running",
138
- "target": self.name,
139
- "agent_name": "mcp_application_loop",
138
+ "target": self.name or "mcp_application",
139
+ "agent_name": self.name or "fastagent loop",
140
140
  },
141
141
  )
142
142
 
@@ -150,8 +150,8 @@ class MCPApp:
150
150
  "MCPAgent cleanup",
151
151
  data={
152
152
  "progress_action": ProgressAction.FINISHED,
153
- "target": self.name,
154
- "agent_name": "mcp_application_loop",
153
+ "target": self.name or "mcp_application",
154
+ "agent_name": self.name or "fastagent loop",
155
155
  },
156
156
  )
157
157
  try:
@@ -19,6 +19,7 @@ EXAMPLE_TYPES = {
19
19
  "'Building Effective Agents' paper. Some agents use the 'fetch'\n"
20
20
  "and filesystem MCP Servers.",
21
21
  "files": [
22
+ "agent_build.py",
22
23
  "chaining.py",
23
24
  "evaluator.py",
24
25
  "human_input.py",
@@ -32,11 +33,7 @@ EXAMPLE_TYPES = {
32
33
  "description": "Research agent example with additional evaluation/optimization\n"
33
34
  "example. Uses Brave Search and Docker MCP Servers.\n"
34
35
  "Creates examples in a 'researcher' subdirectory.",
35
- "files": [
36
- "researcher.py",
37
- "researcher-eval.py",
38
- "mcp_agent.secrets.yaml.example",
39
- ],
36
+ "files": ["researcher.py", "researcher-eval.py", "fastagent.config.yaml"],
40
37
  "create_subdir": True,
41
38
  },
42
39
  "data-analysis": {
@@ -19,7 +19,7 @@ FASTAGENT_CONFIG_TEMPLATE = """
19
19
  # If not specified, defaults to "haiku".
20
20
  # Can be overriden with a command line switch --model=<model>, or within the Agent constructor.
21
21
 
22
- default_model: sonnet
22
+ default_model: haiku
23
23
 
24
24
  # Logging and Console Configuration:
25
25
  logger:
@@ -40,11 +40,11 @@ def show_welcome():
40
40
 
41
41
  console.print("\n[bold]Getting Started:[/bold]")
42
42
  console.print("1. Set up a new project:")
43
- console.print(" mcp-agent setup")
43
+ console.print(" fastagent setup")
44
44
  console.print("\n2. Try an example:")
45
- console.print(" mcp-agent bootstrap create decorator")
45
+ console.print(" fastagent bootstrap create decorator")
46
46
  console.print("\nUse --help with any command for more information")
47
- console.print("Example: mcp-agent bootstrap --help")
47
+ console.print("Example: fastagent bootstrap --help")
48
48
 
49
49
 
50
50
  @app.callback(invoke_without_command=True)
@@ -56,7 +56,7 @@ def main(
56
56
  True, "--color/--no-color", help="Enable/disable color output"
57
57
  ),
58
58
  ):
59
- """MCP Agent CLI - Build effective agents using Model Context Protocol (MCP).
59
+ """FastAgent CLI - Build effective agents using Model Context Protocol (MCP).
60
60
 
61
61
  Use --help with any command for detailed usage information.
62
62
  """
@@ -0,0 +1,315 @@
1
+ """
2
+ Enhanced prompt functionality with advanced prompt_toolkit features.
3
+ """
4
+
5
+ from typing import List
6
+ from prompt_toolkit import PromptSession
7
+ from prompt_toolkit.formatted_text import HTML
8
+ from prompt_toolkit.history import InMemoryHistory
9
+ from prompt_toolkit.key_binding import KeyBindings
10
+ from prompt_toolkit.completion import Completer, Completion
11
+ from prompt_toolkit.lexers import PygmentsLexer
12
+ from prompt_toolkit.filters import Condition
13
+ from pygments.lexers.python import PythonLexer
14
+ from rich import print as rich_print
15
+
16
+ # Map of agent names to their history
17
+ agent_histories = {}
18
+
19
+ # Store available agents for auto-completion
20
+ available_agents = set()
21
+
22
+ # Keep track of multi-line mode state
23
+ in_multiline_mode = False
24
+
25
+ # Track which agents have already shown welcome messages
26
+ agent_messages_shown = set()
27
+
28
+
29
+ class AgentCompleter(Completer):
30
+ """Provide completion for agent names and common commands."""
31
+
32
+ def __init__(self, agents: List[str], commands: List[str] = None, agent_types: dict = None):
33
+ self.agents = agents
34
+ self.commands = commands or ["help", "clear", "STOP"]
35
+ self.agent_types = agent_types or {}
36
+
37
+ def get_completions(self, document, complete_event):
38
+ """Synchronous completions method - this is what prompt_toolkit expects by default"""
39
+ text = document.text_before_cursor.lower()
40
+
41
+ # Complete commands
42
+ if text.startswith("/"):
43
+ cmd = text[1:]
44
+ for command in self.commands:
45
+ if command.lower().startswith(cmd):
46
+ yield Completion(
47
+ command,
48
+ start_position=-len(cmd),
49
+ display=command,
50
+ display_meta="Command",
51
+ )
52
+
53
+ # Complete agent names for agent-related commands
54
+ elif text.startswith("@"):
55
+ agent_name = text[1:]
56
+ for agent in self.agents:
57
+ if agent.lower().startswith(agent_name.lower()):
58
+ # Get agent type or default to "Agent"
59
+ agent_type = self.agent_types.get(agent, "Agent")
60
+ yield Completion(
61
+ agent,
62
+ start_position=-len(agent_name),
63
+ display=agent,
64
+ display_meta=agent_type,
65
+ )
66
+
67
+
68
+ def create_keybindings(on_toggle_multiline=None, app=None):
69
+ """Create custom key bindings."""
70
+ kb = KeyBindings()
71
+
72
+ @kb.add("c-m", filter=Condition(lambda: not in_multiline_mode))
73
+ def _(event):
74
+ """Enter: accept input when not in multiline mode."""
75
+ event.current_buffer.validate_and_handle()
76
+
77
+ @kb.add("c-m", filter=Condition(lambda: in_multiline_mode))
78
+ def _(event):
79
+ """Enter: insert newline when in multiline mode."""
80
+ event.current_buffer.insert_text("\n")
81
+
82
+ @kb.add("escape", "enter")
83
+ def _(event):
84
+ """Alt+Enter: always submit even in multiline mode."""
85
+ event.current_buffer.validate_and_handle()
86
+
87
+ @kb.add("c-t")
88
+ def _(event):
89
+ """Ctrl+T: Toggle multiline mode."""
90
+ global in_multiline_mode
91
+ in_multiline_mode = not in_multiline_mode
92
+
93
+ # Force redraw the app to update toolbar
94
+ if event.app:
95
+ event.app.invalidate()
96
+ elif app:
97
+ app.invalidate()
98
+
99
+ # Call the toggle callback if provided
100
+ if on_toggle_multiline:
101
+ on_toggle_multiline(in_multiline_mode)
102
+
103
+ # Instead of printing, we'll just update the toolbar
104
+ # The toolbar will show the current mode
105
+
106
+ @kb.add("c-l")
107
+ def _(event):
108
+ """Ctrl+L: Clear input."""
109
+ event.current_buffer.text = ""
110
+
111
+ return kb
112
+
113
+
114
+ async def get_enhanced_input(
115
+ agent_name: str,
116
+ default: str = "",
117
+ show_default: bool = False,
118
+ show_stop_hint: bool = False,
119
+ multiline: bool = False,
120
+ available_agent_names: List[str] = None,
121
+ syntax: str = None,
122
+ agent_types: dict = None,
123
+ ) -> str:
124
+ """
125
+ Enhanced input with advanced prompt_toolkit features.
126
+
127
+ Args:
128
+ agent_name: Name of the agent (used for prompt and history)
129
+ default: Default value if user presses enter
130
+ show_default: Whether to show the default value in the prompt
131
+ show_stop_hint: Whether to show the STOP hint
132
+ multiline: Start in multiline mode
133
+ available_agent_names: List of agent names for auto-completion
134
+ syntax: Syntax highlighting (e.g., 'python', 'sql')
135
+ agent_types: Dictionary mapping agent names to their types for display
136
+
137
+ Returns:
138
+ User input string
139
+ """
140
+ global in_multiline_mode, available_agents
141
+
142
+ # Update global state
143
+ in_multiline_mode = multiline
144
+ if available_agent_names:
145
+ available_agents = set(available_agent_names)
146
+
147
+ # Get or create history object for this agent
148
+ if agent_name not in agent_histories:
149
+ agent_histories[agent_name] = InMemoryHistory()
150
+
151
+ # Define callback for multiline toggle
152
+ def on_multiline_toggle(enabled):
153
+ nonlocal session
154
+ if hasattr(session, "app") and session.app:
155
+ session.app.invalidate()
156
+
157
+ # Define toolbar function that will update dynamically
158
+ def get_toolbar():
159
+ if in_multiline_mode:
160
+ mode_style = "ansired" # More noticeable for multiline mode
161
+ mode_text = "MULTILINE"
162
+ toggle_text = "Normal Editing"
163
+ else:
164
+ mode_style = "ansigreen"
165
+ mode_text = "NORMAL"
166
+ toggle_text = "Multiline Editing"
167
+
168
+ shortcuts = [
169
+ ("Ctrl+T", toggle_text),
170
+ ("Alt+Enter", "Submit" if in_multiline_mode else ""),
171
+ ("Ctrl+L", "Clear"),
172
+ ("↑/↓", "History"),
173
+ ]
174
+ # Only show relevant shortcuts based on mode
175
+ shortcuts = [(k, v) for k, v in shortcuts if v]
176
+
177
+ shortcut_text = " | ".join(f"{key}:{action}" for key, action in shortcuts)
178
+ return HTML(
179
+ f" <b>Agent:</b> <ansiblue> {agent_name} </ansiblue> | <b>Mode:</b> <{mode_style}> {mode_text} </{mode_style}> | {shortcut_text}"
180
+ )
181
+
182
+ # Create session with history and completions
183
+ session = PromptSession(
184
+ history=agent_histories[agent_name],
185
+ completer=AgentCompleter(
186
+ agents=list(available_agents) if available_agents else [],
187
+ agent_types=agent_types or {},
188
+ ),
189
+ complete_while_typing=True,
190
+ lexer=PygmentsLexer(PythonLexer) if syntax == "python" else None,
191
+ multiline=Condition(lambda: in_multiline_mode),
192
+ complete_in_thread=True,
193
+ mouse_support=True,
194
+ bottom_toolbar=get_toolbar, # Pass the function here
195
+ )
196
+
197
+ # Create key bindings with a reference to the app
198
+ bindings = create_keybindings(
199
+ on_toggle_multiline=on_multiline_toggle, app=session.app
200
+ )
201
+ session.app.key_bindings = bindings
202
+
203
+ # Create formatted prompt text
204
+ prompt_text = f"<ansicyan>{agent_name}</ansicyan> > "
205
+
206
+ # Add default value display if requested
207
+ if show_default and default and default != "STOP":
208
+ prompt_text = f"{prompt_text} [<ansigreen>{default}</ansigreen>] "
209
+
210
+ # Only show hints at startup if requested
211
+ if show_stop_hint:
212
+ if default == "STOP":
213
+ rich_print("[yellow]Press <ENTER> to finish.[/yellow]")
214
+ else:
215
+ rich_print("Enter a prompt, or [red]STOP[/red] to finish")
216
+ if default:
217
+ rich_print(
218
+ f"Press <ENTER> to use the default prompt:\n[cyan]{default}[/cyan]"
219
+ )
220
+
221
+ # Mention available features but only on first usage for this agent
222
+ if agent_name not in agent_messages_shown:
223
+ rich_print(
224
+ "[dim]Tip: Type /help for commands, press F1 for keyboard shortcuts. Ctrl+T toggles multiline mode. @Agent to switch agent[/dim]"
225
+ )
226
+ agent_messages_shown.add(agent_name)
227
+
228
+ # Process special commands
229
+ def pre_process_input(text):
230
+ # Command processing
231
+ if text and text.startswith("/"):
232
+ cmd = text[1:].strip().lower()
233
+ if cmd == "help":
234
+ return "HELP"
235
+ elif cmd == "clear":
236
+ return "CLEAR"
237
+ elif cmd == "agents":
238
+ return "LIST_AGENTS"
239
+
240
+ # Agent switching
241
+ if text and text.startswith("@"):
242
+ return f"SWITCH:{text[1:].strip()}"
243
+
244
+ return text
245
+
246
+ # Get the input - using async version
247
+ try:
248
+ result = await session.prompt_async(HTML(prompt_text), default=default)
249
+ return pre_process_input(result)
250
+ except KeyboardInterrupt:
251
+ # Handle Ctrl+C gracefully
252
+ return "STOP"
253
+ except EOFError:
254
+ # Handle Ctrl+D gracefully
255
+ return "STOP"
256
+ except Exception as e:
257
+ # Log and gracefully handle other exceptions
258
+ print(f"\nInput error: {type(e).__name__}: {e}")
259
+ return "STOP"
260
+
261
+
262
+ async def handle_special_commands(command, agent_app=None):
263
+ """Handle special input commands."""
264
+ # Quick guard for empty or None commands
265
+ if not command:
266
+ return False
267
+
268
+ # Check for special commands
269
+ if command == "HELP":
270
+ rich_print("\n[bold]Available Commands:[/bold]")
271
+ rich_print(" /help - Show this help")
272
+ rich_print(" /clear - Clear screen")
273
+ rich_print(" /agents - List available agents")
274
+ rich_print(" @agent_name - Switch to agent")
275
+ rich_print(" STOP - End session")
276
+ rich_print("\n[bold]Keyboard Shortcuts:[/bold]")
277
+ rich_print(
278
+ " Enter - Submit (normal mode) / New line (multiline mode)"
279
+ )
280
+ rich_print(" Alt+Enter - Always submit (even in multiline mode)")
281
+ rich_print(" Ctrl+T - Toggle multiline mode")
282
+ rich_print(" Ctrl+L - Clear input")
283
+ rich_print(" Up/Down - Navigate history")
284
+ rich_print(" F1 - Show help")
285
+ return True
286
+
287
+ elif command == "CLEAR":
288
+ # Clear screen (ANSI escape sequence)
289
+ print("\033c", end="")
290
+ return True
291
+
292
+ elif command == "LIST_AGENTS":
293
+ if available_agents:
294
+ rich_print("\n[bold]Available Agents:[/bold]")
295
+ for agent in sorted(available_agents):
296
+ rich_print(f" @{agent}")
297
+ else:
298
+ rich_print("[yellow]No agents available[/yellow]")
299
+ return True
300
+
301
+ elif isinstance(command, str) and command.startswith("SWITCH:"):
302
+ agent_name = command.split(":", 1)[1]
303
+ if agent_name in available_agents:
304
+ if agent_app:
305
+ rich_print(f"[green]Switching to agent: {agent_name}[/green]")
306
+ return {"switch_agent": agent_name}
307
+ else:
308
+ rich_print(
309
+ "[yellow]Agent switching not available in this context[/yellow]"
310
+ )
311
+ else:
312
+ rich_print(f"[red]Unknown agent: {agent_name}[/red]")
313
+ return True
314
+
315
+ return False