fast-agent-mcp 0.0.15__py3-none-any.whl → 0.1.0__py3-none-any.whl
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.
- {fast_agent_mcp-0.0.15.dist-info → fast_agent_mcp-0.1.0.dist-info}/METADATA +121 -21
- {fast_agent_mcp-0.0.15.dist-info → fast_agent_mcp-0.1.0.dist-info}/RECORD +27 -25
- mcp_agent/cli/__main__.py +3 -0
- mcp_agent/cli/commands/bootstrap.py +1 -1
- mcp_agent/cli/commands/setup.py +4 -1
- mcp_agent/cli/main.py +13 -3
- mcp_agent/config.py +19 -11
- mcp_agent/core/agent_app.py +1 -1
- mcp_agent/core/enhanced_prompt.py +13 -5
- mcp_agent/core/fastagent.py +87 -49
- mcp_agent/resources/examples/data-analysis/analysis-campaign.py +188 -0
- mcp_agent/resources/examples/data-analysis/analysis.py +26 -0
- mcp_agent/resources/examples/workflows/evaluator.py +3 -3
- mcp_agent/resources/examples/workflows/orchestrator.py +1 -1
- mcp_agent/resources/examples/workflows/parallel.py +0 -4
- mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py +229 -91
- mcp_agent/workflows/llm/augmented_llm_anthropic.py +16 -2
- mcp_agent/workflows/llm/augmented_llm_openai.py +13 -1
- mcp_agent/workflows/llm/prompt_utils.py +137 -0
- mcp_agent/workflows/orchestrator/orchestrator.py +252 -50
- mcp_agent/workflows/orchestrator/orchestrator_models.py +81 -9
- mcp_agent/workflows/orchestrator/orchestrator_prompts.py +112 -42
- mcp_agent/workflows/router/router_base.py +113 -21
- mcp_agent/workflows/router/router_llm.py +19 -5
- {fast_agent_mcp-0.0.15.dist-info → fast_agent_mcp-0.1.0.dist-info}/WHEEL +0 -0
- {fast_agent_mcp-0.0.15.dist-info → fast_agent_mcp-0.1.0.dist-info}/entry_points.txt +0 -0
- {fast_agent_mcp-0.0.15.dist-info → fast_agent_mcp-0.1.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fast-agent-mcp
|
3
|
-
Version: 0.0
|
3
|
+
Version: 0.1.0
|
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
|
@@ -235,7 +235,7 @@ Provides-Extra: temporal
|
|
235
235
|
Requires-Dist: temporalio>=1.8.0; extra == 'temporal'
|
236
236
|
Description-Content-Type: text/markdown
|
237
237
|
|
238
|
-
##
|
238
|
+
## fast-agent
|
239
239
|
|
240
240
|
<p align="center">
|
241
241
|
<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>
|
@@ -259,14 +259,17 @@ Prompts and configurations that define your Agent Applications are stored in sim
|
|
259
259
|
|
260
260
|
Chat with individual Agents and Components before, during and after workflow execution to tune and diagnose your application.
|
261
261
|
|
262
|
-
Simple model selection makes testing Model <-> MCP Server interaction painless.
|
262
|
+
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/)
|
263
|
+
|
264
|
+

|
263
265
|
|
264
266
|
## Get started:
|
265
267
|
|
266
268
|
Start by installing the [uv package manager](https://docs.astral.sh/uv/) for Python. Then:
|
267
269
|
|
268
270
|
```bash
|
269
|
-
uv pip install fast-agent-mcp # install fast-agent
|
271
|
+
uv pip install fast-agent-mcp # install fast-agent!
|
272
|
+
|
270
273
|
fast-agent setup # create an example agent and config files
|
271
274
|
uv run agent.py # run your first agent
|
272
275
|
uv run agent.py --model=o3-mini.low # specify a model
|
@@ -275,6 +278,7 @@ fast-agent bootstrap workflow # create "building effective agents" example
|
|
275
278
|
|
276
279
|
Other bootstrap examples include a Researcher Agent (with Evaluator-Optimizer workflow) and Data Analysis Agent (similar to the ChatGPT experience), demonstrating MCP Roots support.
|
277
280
|
|
281
|
+
> [!TIP]
|
278
282
|
> 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.
|
279
283
|
|
280
284
|
### Basic Agents
|
@@ -354,7 +358,7 @@ async def main():
|
|
354
358
|
)
|
355
359
|
```
|
356
360
|
|
357
|
-
All Agents and Workflows respond to `.send("message")`
|
361
|
+
All Agents and Workflows respond to `.send("message")` or `.prompt()` to begin a chat session.
|
358
362
|
|
359
363
|
Saved as `social.py` we can now run this workflow from the command line with:
|
360
364
|
|
@@ -362,7 +366,7 @@ Saved as `social.py` we can now run this workflow from the command line with:
|
|
362
366
|
uv run social.py --agent social_media --message "<url>"
|
363
367
|
```
|
364
368
|
|
365
|
-
Add the `--quiet` switch to only return the final response.
|
369
|
+
Add the `--quiet` switch to only return the final response, which is useful for simple automations.
|
366
370
|
|
367
371
|
## Workflows
|
368
372
|
|
@@ -383,7 +387,7 @@ async with fast.run() as agent:
|
|
383
387
|
|
384
388
|
```
|
385
389
|
|
386
|
-
This starts an interactive session, which produces a short social media post for a given URL. If a _chain_ is prompted
|
390
|
+
This starts an interactive session, which produces a short social media post for a given URL. If a _chain_ is prompted it returns to a chat with last Agent in the chain. You can switch the agent to prompt by typing `@agent-name`.
|
387
391
|
|
388
392
|
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
393
|
|
@@ -407,13 +411,17 @@ The Parallel Workflow sends the same message to multiple Agents simultaneously (
|
|
407
411
|
)
|
408
412
|
```
|
409
413
|
|
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.
|
414
|
+
Look at the `parallel.py` workflow example for more examples. If you don't specify a `fan-in` agent, the `parallel` returns the combined Agent results verbatim.
|
415
|
+
|
416
|
+
`parallel` is also useful to ensemble ideas from different LLMs.
|
411
417
|
|
412
|
-
|
418
|
+
When using `parallel` in other workflows, specify an `instruction` to describe its operation.
|
413
419
|
|
414
420
|
### Evaluator-Optimizer
|
415
421
|
|
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.
|
422
|
+
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. The final result from the Generator is returned.
|
423
|
+
|
424
|
+
If the Generator has `use_history` off, the previous iteration is returned when asking for improvements - otherwise conversational context is used.
|
417
425
|
|
418
426
|
```python
|
419
427
|
@fast.evaluator_optimizer(
|
@@ -428,6 +436,8 @@ async with fast.run() as agent:
|
|
428
436
|
await agent.researcher.send("produce a report on how to make the perfect espresso")
|
429
437
|
```
|
430
438
|
|
439
|
+
When used in a workflow, it returns the last `generator` message as the result.
|
440
|
+
|
431
441
|
See the `evaluator.py` workflow example, or `fast-agent bootstrap researcher` for a more complete example.
|
432
442
|
|
433
443
|
### Router
|
@@ -458,20 +468,107 @@ See `orchestrator.py` in the workflow examples.
|
|
458
468
|
|
459
469
|
## Agent Features
|
460
470
|
|
471
|
+
### Calling Agents
|
472
|
+
|
473
|
+
All definitions allow omitting the name and instructions arguments for brevity:
|
474
|
+
|
475
|
+
```python
|
476
|
+
@fast.agent("You are a helpful agent") # Create an agent with a default name.
|
477
|
+
@fast.agent("greeter","Respond cheerfully!") # Create an agent with the name "greeter"
|
478
|
+
|
479
|
+
moon_size = await agent("the moon") # Call the default (first defined agent) with a message
|
480
|
+
|
481
|
+
result = await agent.greeter("Good morning!") # Send a message to an agent by name using dot notation
|
482
|
+
result = await agent.greeter.send("Hello!") # You can call 'send' explicitly
|
483
|
+
|
484
|
+
await agent.greeter() # If no message is specified, a chat session will open
|
485
|
+
await agent.greeter.prompt() # that can be made more explicit
|
486
|
+
await agent.greeter.prompt(default_prompt="OK") # and supports setting a default prompt
|
487
|
+
|
488
|
+
agent["greeter"].send("Good Evening!") # Dictionary access is supported if preferred
|
489
|
+
```
|
490
|
+
|
491
|
+
### Defining Agents
|
492
|
+
|
493
|
+
#### Basic Agent
|
494
|
+
|
461
495
|
```python
|
462
496
|
@fast.agent(
|
463
|
-
name="agent",
|
464
|
-
|
465
|
-
servers=["filesystem"],
|
466
|
-
model="o3-mini.high",
|
467
|
-
use_history=True,
|
468
|
-
|
497
|
+
name="agent", # name of the agent
|
498
|
+
instruction="You are a helpful Agent", # base instruction for the agent
|
499
|
+
servers=["filesystem"], # list of MCP Servers for the agent
|
500
|
+
model="o3-mini.high", # specify a model for the agent
|
501
|
+
use_history=True, # agent maintains chat history
|
502
|
+
request_params={"temperature": 0.7}, # additional parameters for the LLM (or RequestParams())
|
503
|
+
human_input=True, # agent can request human input
|
469
504
|
)
|
470
505
|
```
|
471
506
|
|
472
|
-
|
507
|
+
#### Chain
|
508
|
+
|
509
|
+
```python
|
510
|
+
@fast.chain(
|
511
|
+
name="chain", # name of the chain
|
512
|
+
sequence=["agent1", "agent2", ...], # list of agents in execution order
|
513
|
+
instruction="instruction", # instruction to describe the chain for other workflows
|
514
|
+
continue_with_final=True, # open chat with agent at end of chain after prompting
|
515
|
+
)
|
516
|
+
```
|
473
517
|
|
474
|
-
|
518
|
+
#### Parallel
|
519
|
+
|
520
|
+
```python
|
521
|
+
@fast.parallel(
|
522
|
+
name="parallel", # name of the parallel workflow
|
523
|
+
fan_out=["agent1", "agent2"], # list of agents to run in parallel
|
524
|
+
fan_in="aggregator", # name of agent that combines results (optional)
|
525
|
+
instruction="instruction", # instruction to describe the parallel for other workflows
|
526
|
+
include_request=True, # include original request in fan-in message
|
527
|
+
)
|
528
|
+
```
|
529
|
+
|
530
|
+
#### Evaluator-Optimizer
|
531
|
+
|
532
|
+
```python
|
533
|
+
@fast.evaluator_optimizer(
|
534
|
+
name="researcher", # name of the workflow
|
535
|
+
generator="web_searcher", # name of the content generator agent
|
536
|
+
evaluator="quality_assurance", # name of the evaluator agent
|
537
|
+
min_rating="GOOD", # minimum acceptable quality (EXCELLENT, GOOD, FAIR, POOR)
|
538
|
+
max_refinements=3, # maximum number of refinement iterations
|
539
|
+
)
|
540
|
+
```
|
541
|
+
|
542
|
+
#### Router
|
543
|
+
|
544
|
+
```python
|
545
|
+
@fast.router(
|
546
|
+
name="route", # name of the router
|
547
|
+
agents=["agent1", "agent2", "agent3"], # list of agent names router can delegate to
|
548
|
+
model="o3-mini.high", # specify routing model
|
549
|
+
use_history=False, # router maintains conversation history
|
550
|
+
human_input=False, # whether router can request human input
|
551
|
+
)
|
552
|
+
```
|
553
|
+
|
554
|
+
#### Orchestrator
|
555
|
+
|
556
|
+
```python
|
557
|
+
@fast.orchestrator(
|
558
|
+
name="orchestrator", # name of the orchestrator
|
559
|
+
instruction="instruction", # base instruction for the orchestrator
|
560
|
+
agents=["agent1", "agent2"], # list of agent names this orchestrator can use
|
561
|
+
model="o3-mini.high", # specify orchestrator planning model
|
562
|
+
use_history=False, # orchestrator doesn't maintain chat history by default
|
563
|
+
human_input=False, # whether orchestrator can request human input
|
564
|
+
plan_type="full", # planning approach: "full" or "iterative"
|
565
|
+
)
|
566
|
+
```
|
567
|
+
|
568
|
+
### Secrets File
|
569
|
+
|
570
|
+
> [!TIP]
|
571
|
+
> 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.
|
475
572
|
|
476
573
|
## Project Notes
|
477
574
|
|
@@ -479,8 +576,12 @@ When `human_input` is set to true for an Agent, it is presented with the option
|
|
479
576
|
|
480
577
|
### llmindset.co.uk fork:
|
481
578
|
|
579
|
+
- Overhaul of Eval/Opt for Conversation Management
|
580
|
+
- Remove instructor use for Orchestrator
|
581
|
+
- Improved handling of Parallel/Fan-In and respose option
|
582
|
+
- XML based generated prompts
|
482
583
|
- "FastAgent" style prototyping, with per-agent models
|
483
|
-
-
|
584
|
+
- API keys through Environment Variables
|
484
585
|
- Warm-up / Post-Workflow Agent Interactions
|
485
586
|
- Quick Setup
|
486
587
|
- Interactive Prompt Mode
|
@@ -493,7 +594,6 @@ When `human_input` is set to true for an Agent, it is presented with the option
|
|
493
594
|
- OpenAI o1/o3-mini support with reasoning level
|
494
595
|
- Enhanced Human Input Messaging and Handling
|
495
596
|
- Declarative workflows
|
597
|
+
- Numerous defect fixes
|
496
598
|
|
497
599
|
### Features to add.
|
498
|
-
|
499
|
-
- Chat History Clear.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
mcp_agent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
mcp_agent/app.py,sha256=0_C1xmNZlk9qZoewnNI_mC7sSfO9oJgkOyiKkQ62MHU,10606
|
3
|
-
mcp_agent/config.py,sha256=
|
3
|
+
mcp_agent/config.py,sha256=OpPTsk9gNm2IA1laUomAMkGA-pAlp5uILQpEPBjavQs,10644
|
4
4
|
mcp_agent/console.py,sha256=Gjf2QLFumwG1Lav__c07X_kZxxEUSkzV-1_-YbAwcwo,813
|
5
5
|
mcp_agent/context.py,sha256=qzwUrexZXVBzFiNkYI4xjztdGxuuiDWZbWrQgVhA-vE,8126
|
6
6
|
mcp_agent/context_dependent.py,sha256=TGqRLzYCOnsWGoaD1HtrliYtWo8MeaWCQk6ePUmyYCw,1446
|
@@ -10,20 +10,20 @@ mcp_agent/progress_display.py,sha256=GeJU9VUt6qKsFVymG688hCMVCsAygG9ifiiEb5IcbN4
|
|
10
10
|
mcp_agent/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
11
11
|
mcp_agent/agents/agent.py,sha256=losanPSdZXZzmeiX-J6ctOinLlkhNZsxwi3Swr8lnxA,11482
|
12
12
|
mcp_agent/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
-
mcp_agent/cli/__main__.py,sha256=
|
14
|
-
mcp_agent/cli/main.py,sha256=
|
13
|
+
mcp_agent/cli/__main__.py,sha256=AVZ7tQFhU_sDOGuUGJq8ujgKtcxsYJBJwHbVaaiRDlI,166
|
14
|
+
mcp_agent/cli/main.py,sha256=DE6EZzspfzHwPK59x8vL4AIDHRQkVQ1Ja70XRGU1IQs,2753
|
15
15
|
mcp_agent/cli/terminal.py,sha256=5fqrKlJvIpKEuvpvZ653OueQSYFFktBEbosjr2ucMUc,1026
|
16
|
-
mcp_agent/cli/commands/bootstrap.py,sha256=
|
16
|
+
mcp_agent/cli/commands/bootstrap.py,sha256=Rmwbuwl52eHfnya7fnwKk2J7nCsHpSh6irka4mBDEnU,10779
|
17
17
|
mcp_agent/cli/commands/config.py,sha256=32YTS5jmsYAs9QzAhjkG70_daAHqOemf4XbZBBSMz6g,204
|
18
|
-
mcp_agent/cli/commands/setup.py,sha256=
|
18
|
+
mcp_agent/cli/commands/setup.py,sha256=_SCpd6_PrixqbSaE72JQ7erIRkZnJGmh_3TvvwSzEiE,6392
|
19
19
|
mcp_agent/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
20
|
-
mcp_agent/core/agent_app.py,sha256=
|
20
|
+
mcp_agent/core/agent_app.py,sha256=6U3HLYAJOfyVuUpZVELWT5lOo64-b_sfWp0yn88s7Wo,6085
|
21
21
|
mcp_agent/core/agent_types.py,sha256=yKiMbv9QO2dduq4zXmoMZlOZpXJZhM4oNwIq1-134FE,318
|
22
22
|
mcp_agent/core/agent_utils.py,sha256=yUJ-qvw5TblqqOsB1vj0Qvcz9mass9awPA6UNNvuw0A,1738
|
23
|
-
mcp_agent/core/enhanced_prompt.py,sha256=
|
23
|
+
mcp_agent/core/enhanced_prompt.py,sha256=XraDKdIMW960KXCiMfCEPKDakbf1wHYgvHwD-9CBDi0,13011
|
24
24
|
mcp_agent/core/error_handling.py,sha256=D3HMW5odrbJvaKqcpCGj6eDXrbFcuqYaCZz7fyYiTu4,623
|
25
25
|
mcp_agent/core/exceptions.py,sha256=a2-JGRwFFRoQEPuAq0JC5PhAJ5TO3xVJfdS4-VN29cw,2225
|
26
|
-
mcp_agent/core/fastagent.py,sha256=
|
26
|
+
mcp_agent/core/fastagent.py,sha256=CuT50oaexYq7L5-1xHR5HfS7qYKNToH3wmBAeD8kcBY,58234
|
27
27
|
mcp_agent/core/proxies.py,sha256=hXDUpsgGO4xBTIjdUeXj6vULPb8sf55vAFVQh6Ybn60,4411
|
28
28
|
mcp_agent/core/server_validation.py,sha256=_59cn16nNT4HGPwg19HgxMtHK4MsdWYDUw_CuL-5xek,1696
|
29
29
|
mcp_agent/core/types.py,sha256=Zhi9iW7uiOfdpSt9NC0FCtGRFtJPg4mpZPK2aYi7a7M,817
|
@@ -54,7 +54,8 @@ mcp_agent/mcp/mcp_agent_server.py,sha256=xP09HZTeguJi4Fq0p3fjLBP55uSYe5AdqM90xCg
|
|
54
54
|
mcp_agent/mcp/mcp_aggregator.py,sha256=RVsgNnSJ1IPBkqKgF_Gp-Cpv97FVBIdppPey6FRoHB0,14751
|
55
55
|
mcp_agent/mcp/mcp_connection_manager.py,sha256=WLli0w3TVcsszyD9M7zP7vLKPetnQLTf_0PGhvMm9YM,13145
|
56
56
|
mcp_agent/mcp/stdio.py,sha256=tW075R5rQ-UlflXWFKIFDgCbWbuhKqxhiYolWvyEkFs,3985
|
57
|
-
mcp_agent/resources/examples/data-analysis/analysis.py,sha256=
|
57
|
+
mcp_agent/resources/examples/data-analysis/analysis-campaign.py,sha256=EG-HhaDHltZ4hHAqhgfX_pHM2wem48aYhSIKJxyWHKc,7269
|
58
|
+
mcp_agent/resources/examples/data-analysis/analysis.py,sha256=yRwcYob-jaqwR1vdx_gYXpfqtBN4w7creNeNgimOHa4,2443
|
58
59
|
mcp_agent/resources/examples/data-analysis/fastagent.config.yaml,sha256=eTKGbjnTHhDTeNRPQvG_fr9OQpEZ5Y9v7X2NyCj0V70,530
|
59
60
|
mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv,sha256=pcMeOL1_r8m8MziE6xgbBrQbjl5Ijo98yycZn7O-dlk,227977
|
60
61
|
mcp_agent/resources/examples/internal/agent.py,sha256=f-jTgYabV3nWCQm0ZP9NtSEWjx3nQbRngzArRufcELg,384
|
@@ -66,11 +67,11 @@ mcp_agent/resources/examples/researcher/researcher-eval.py,sha256=kNPjIU-JwE0oIB
|
|
66
67
|
mcp_agent/resources/examples/researcher/researcher.py,sha256=jPRafm7jbpHKkX_dQiYGG3Sw-e1Dm86q-JZT-WZDhM0,1425
|
67
68
|
mcp_agent/resources/examples/workflows/agent_build.py,sha256=vdjS02rZR88RU53WYzXxPscfFNEFFe_niHYE_i49I8Q,2396
|
68
69
|
mcp_agent/resources/examples/workflows/chaining.py,sha256=1G_0XBcFkSJCOXb6N_iXWlSc_oGAlhENR0k_CN1vJKI,1208
|
69
|
-
mcp_agent/resources/examples/workflows/evaluator.py,sha256=
|
70
|
+
mcp_agent/resources/examples/workflows/evaluator.py,sha256=3XmW1mjImlaWb0c5FWHYS9yP8nVGTbEdJySAoWXwrDg,3109
|
70
71
|
mcp_agent/resources/examples/workflows/fastagent.config.yaml,sha256=k2AiapOcK42uqG2nWDVvnSLqN4okQIQZK0FTbZufBpY,809
|
71
72
|
mcp_agent/resources/examples/workflows/human_input.py,sha256=c8cBdLEPbaMXddFwsfN3Z7RFs5PZXsdrjANfvq1VTPM,605
|
72
|
-
mcp_agent/resources/examples/workflows/orchestrator.py,sha256=
|
73
|
-
mcp_agent/resources/examples/workflows/parallel.py,sha256=
|
73
|
+
mcp_agent/resources/examples/workflows/orchestrator.py,sha256=5TGFWrRQiTCdYY738cyd_OzZc7vckYkk1Up9VejFXB0,2574
|
74
|
+
mcp_agent/resources/examples/workflows/parallel.py,sha256=pLbQrtXfbdYqMVddxtg5dZnBnm5Wo2mXlIa1Vf2F1FQ,3096
|
74
75
|
mcp_agent/resources/examples/workflows/router.py,sha256=XT_ewCrxPxdUTMCYQGw34qZQ3GGu8TYY_v5Lige8By4,1707
|
75
76
|
mcp_agent/telemetry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
76
77
|
mcp_agent/telemetry/usage_tracking.py,sha256=ePujKMSjPxB7k6X34DGaVlnsV1728mcWZq38OqahiCU,501
|
@@ -80,7 +81,7 @@ mcp_agent/workflows/embedding/embedding_base.py,sha256=-c20ggQ8s7XhMxRX-WEhOgHE7
|
|
80
81
|
mcp_agent/workflows/embedding/embedding_cohere.py,sha256=OKTJvKD_uEafd4c2uhR5tBjprea1nyvlJOO-3FDqOnk,1540
|
81
82
|
mcp_agent/workflows/embedding/embedding_openai.py,sha256=dntjJ5P-FSMGYuyPZC8MuCU_ehwjXw9wDfzZZuSQN1E,1480
|
82
83
|
mcp_agent/workflows/evaluator_optimizer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
83
|
-
mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py,sha256=
|
84
|
+
mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py,sha256=N4HjckQf_boFRxoWJmuvwq1IEnGYW-k8pKtqjpsnLSE,19223
|
84
85
|
mcp_agent/workflows/intent_classifier/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
85
86
|
mcp_agent/workflows/intent_classifier/intent_classifier_base.py,sha256=zTbOmq6EY_abOlme4zl28HM4RWNNS6bbHl3tF7SshJ0,4004
|
86
87
|
mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py,sha256=_bWZGukc_q9LdA_Q18UoAMSzhN8tt4K_bRHNUhy7Crw,3997
|
@@ -91,30 +92,31 @@ mcp_agent/workflows/intent_classifier/intent_classifier_llm_anthropic.py,sha256=
|
|
91
92
|
mcp_agent/workflows/intent_classifier/intent_classifier_llm_openai.py,sha256=zj76WlTYnSCYjBQ_IDi5vFBQGmNwYaoUq1rT730sY98,1940
|
92
93
|
mcp_agent/workflows/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
93
94
|
mcp_agent/workflows/llm/augmented_llm.py,sha256=Hyx-jwgbMjE_WQ--YjIUvdj6HAgX36IvXBesGy6uic0,25884
|
94
|
-
mcp_agent/workflows/llm/augmented_llm_anthropic.py,sha256=
|
95
|
-
mcp_agent/workflows/llm/augmented_llm_openai.py,sha256=
|
95
|
+
mcp_agent/workflows/llm/augmented_llm_anthropic.py,sha256=iHfbn7bwC-ICTajEhGwg9vP-UEj681kNmZ9Cv6H05s4,22968
|
96
|
+
mcp_agent/workflows/llm/augmented_llm_openai.py,sha256=a95Q4AFiVw36bXMgYNLFrC2zyDmHERWwkjxJFHlL6JU,25061
|
96
97
|
mcp_agent/workflows/llm/llm_selector.py,sha256=G7pIybuBDwtmyxUDov_QrNYH2FoI0qFRu2JfoxWUF5Y,11045
|
97
98
|
mcp_agent/workflows/llm/model_factory.py,sha256=7zTJrO2ReHa_6dfh_gY6xO8dTySqGFCKlOG9-AMJ-i8,6920
|
99
|
+
mcp_agent/workflows/llm/prompt_utils.py,sha256=EY3eddqnmc_YDUQJFysPnpTH6hr4r2HneeEmX76P8TQ,4948
|
98
100
|
mcp_agent/workflows/orchestrator/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
99
|
-
mcp_agent/workflows/orchestrator/orchestrator.py,sha256=
|
100
|
-
mcp_agent/workflows/orchestrator/orchestrator_models.py,sha256=
|
101
|
-
mcp_agent/workflows/orchestrator/orchestrator_prompts.py,sha256
|
101
|
+
mcp_agent/workflows/orchestrator/orchestrator.py,sha256=nyn0vTjUz-lea7nIYY-aoVWOKB2ceNNV4x4z92bP3CI,23638
|
102
|
+
mcp_agent/workflows/orchestrator/orchestrator_models.py,sha256=xTl2vUIqdLPvDAnqA485Hf_A3DD48TWhAbo-jfGrmRE,7182
|
103
|
+
mcp_agent/workflows/orchestrator/orchestrator_prompts.py,sha256=eJSQThfd6Jvr1jTDx104sJI5R684yE55L_edCiWERsQ,6153
|
102
104
|
mcp_agent/workflows/parallel/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
103
105
|
mcp_agent/workflows/parallel/fan_in.py,sha256=EivpUL5-qftctws-tlfwmYS1QeSwr07POIbBUbwvwOk,13184
|
104
106
|
mcp_agent/workflows/parallel/fan_out.py,sha256=J-yezgjzAWxfueW_Qcgwoet4PFDRIh0h4m48lIbFA4c,7023
|
105
107
|
mcp_agent/workflows/parallel/parallel_llm.py,sha256=fk88DhBRAI41Ph0spe_yBtrMTSj0g47yoA-ozuOxZhE,5807
|
106
108
|
mcp_agent/workflows/router/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
107
|
-
mcp_agent/workflows/router/router_base.py,sha256=
|
109
|
+
mcp_agent/workflows/router/router_base.py,sha256=S-UxofpdW9e7ZQXaZcSE8zBY--6W0m5qc0lw6BZi0ug,14336
|
108
110
|
mcp_agent/workflows/router/router_embedding.py,sha256=wEU49li9OqTX-Xucm0HDUFLZjlND1WuewOcQVAo0s2E,7944
|
109
111
|
mcp_agent/workflows/router/router_embedding_cohere.py,sha256=aKZVzzQfBuz0by9k0zWLAA0Db_unDIMYL4ynVzzx8C4,1975
|
110
112
|
mcp_agent/workflows/router/router_embedding_openai.py,sha256=KqW2IFLdQoAJ2lIz1X18WQJFjXF-YSFSTtsqVnp1JeI,1975
|
111
|
-
mcp_agent/workflows/router/router_llm.py,sha256=
|
113
|
+
mcp_agent/workflows/router/router_llm.py,sha256=jnOK5NHK7zUk-80kJ7HS4p7CGKe3vUA1aZ8-MMflUSA,11030
|
112
114
|
mcp_agent/workflows/swarm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
113
115
|
mcp_agent/workflows/swarm/swarm.py,sha256=-lAIeSWDqbGHGRPTvjiP9nIKWvxxy9DAojl9yQzO1Pw,11050
|
114
116
|
mcp_agent/workflows/swarm/swarm_anthropic.py,sha256=pW8zFx5baUWGd5Vw3nIDF2oVOOGNorij4qvGJKdYPcs,1624
|
115
117
|
mcp_agent/workflows/swarm/swarm_openai.py,sha256=wfteywvAGkT5bLmIxX_StHJq8144whYmCRnJASAjOes,1596
|
116
|
-
fast_agent_mcp-0.0.
|
117
|
-
fast_agent_mcp-0.0.
|
118
|
-
fast_agent_mcp-0.0.
|
119
|
-
fast_agent_mcp-0.0.
|
120
|
-
fast_agent_mcp-0.0.
|
118
|
+
fast_agent_mcp-0.1.0.dist-info/METADATA,sha256=hN241Foz895Wj3dxkXWKDVeeTuIWmAT1zh7Jvgpo3Bo,27257
|
119
|
+
fast_agent_mcp-0.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
120
|
+
fast_agent_mcp-0.1.0.dist-info/entry_points.txt,sha256=2IXtSmDK9XjWN__RWuRIJTgWyW17wJnJ_h-pb0pZAxo,174
|
121
|
+
fast_agent_mcp-0.1.0.dist-info/licenses/LICENSE,sha256=cN3FxDURL9XuzE5mhK9L2paZo82LTfjwCYVT7e3j0e4,10939
|
122
|
+
fast_agent_mcp-0.1.0.dist-info/RECORD,,
|
mcp_agent/cli/__main__.py
CHANGED
@@ -135,7 +135,7 @@ def copy_example_files(
|
|
135
135
|
|
136
136
|
def show_overview():
|
137
137
|
"""Display an overview of available examples in a nicely formatted table."""
|
138
|
-
console.print("\n[bold cyan]
|
138
|
+
console.print("\n[bold cyan]fast-agent Example Applications[/bold cyan]")
|
139
139
|
console.print("Build agents and compose workflows through practical examples\n")
|
140
140
|
|
141
141
|
# Create a table for better organization
|
mcp_agent/cli/commands/setup.py
CHANGED
@@ -185,7 +185,7 @@ def init(
|
|
185
185
|
# Check for existing .gitignore
|
186
186
|
needs_gitignore = not find_gitignore(config_path)
|
187
187
|
|
188
|
-
console.print("\n[bold]
|
188
|
+
console.print("\n[bold]fast-agent Setup[/bold]\n")
|
189
189
|
console.print("This will create the following files:")
|
190
190
|
console.print(f" - {config_path}/fastagent.config.yaml")
|
191
191
|
console.print(f" - {config_path}/fastagent.secrets.yaml")
|
@@ -227,6 +227,9 @@ def init(
|
|
227
227
|
console.print(
|
228
228
|
"2. Keep fastagent.secrets.yaml secure and never commit it to version control"
|
229
229
|
)
|
230
|
+
console.print(
|
231
|
+
"3. Update fastagent.config.yaml to set a default model (currently system default is 'haiku')"
|
232
|
+
)
|
230
233
|
console.print("\nTo get started, run:")
|
231
234
|
console.print(" uv run agent.py")
|
232
235
|
else:
|
mcp_agent/cli/main.py
CHANGED
@@ -22,7 +22,14 @@ console = Console()
|
|
22
22
|
|
23
23
|
def show_welcome():
|
24
24
|
"""Show a welcome message with available commands."""
|
25
|
-
|
25
|
+
from importlib.metadata import version
|
26
|
+
|
27
|
+
try:
|
28
|
+
app_version = version("fast-agent-mcp")
|
29
|
+
except: # noqa: E722
|
30
|
+
app_version = "unknown"
|
31
|
+
|
32
|
+
console.print(f"\n[bold]fast-agent (fast-agent-mcp) {app_version}[/bold]")
|
26
33
|
console.print("Build effective agents using Model Context Protocol (MCP)")
|
27
34
|
|
28
35
|
# Create a table for commands
|
@@ -41,8 +48,11 @@ def show_welcome():
|
|
41
48
|
console.print("\n[bold]Getting Started:[/bold]")
|
42
49
|
console.print("1. Set up a new project:")
|
43
50
|
console.print(" fastagent setup")
|
44
|
-
console.print("\n2.
|
45
|
-
console.print(" fastagent bootstrap
|
51
|
+
console.print("\n2. Create Building Effective Agents workflow examples:")
|
52
|
+
console.print(" fastagent bootstrap workflow")
|
53
|
+
console.print("\n3. Explore other examples:")
|
54
|
+
console.print(" fastagent bootstrap")
|
55
|
+
|
46
56
|
console.print("\nUse --help with any command for more information")
|
47
57
|
console.print("Example: fastagent bootstrap --help")
|
48
58
|
|
mcp_agent/config.py
CHANGED
@@ -313,17 +313,25 @@ def get_settings(config_path: str | None = None) -> Settings:
|
|
313
313
|
with open(config_file, "r", encoding="utf-8") as f:
|
314
314
|
yaml_settings = yaml.safe_load(f) or {}
|
315
315
|
merged_settings = yaml_settings
|
316
|
-
|
317
|
-
#
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
316
|
+
# Look for secrets files recursively up the directory tree
|
317
|
+
# but stop after finding the first one
|
318
|
+
current_dir = config_file.parent
|
319
|
+
found_secrets = False
|
320
|
+
while current_dir != current_dir.parent and not found_secrets:
|
321
|
+
for secrets_filename in [
|
322
|
+
"mcp-agent.secrets.yaml",
|
323
|
+
"mcp_agent.secrets.yaml",
|
324
|
+
"fastagent.secrets.yaml",
|
325
|
+
]:
|
326
|
+
secrets_file = current_dir / secrets_filename
|
327
|
+
if secrets_file.exists():
|
328
|
+
with open(secrets_file, "r", encoding="utf-8") as f:
|
329
|
+
yaml_secrets = yaml.safe_load(f) or {}
|
330
|
+
merged_settings = deep_merge(merged_settings, yaml_secrets)
|
331
|
+
found_secrets = True
|
332
|
+
break
|
333
|
+
if not found_secrets:
|
334
|
+
current_dir = current_dir.parent
|
327
335
|
|
328
336
|
_settings = Settings(**merged_settings)
|
329
337
|
return _settings
|
mcp_agent/core/agent_app.py
CHANGED
@@ -3,6 +3,7 @@ Enhanced prompt functionality with advanced prompt_toolkit features.
|
|
3
3
|
"""
|
4
4
|
|
5
5
|
from typing import List
|
6
|
+
from importlib.metadata import version
|
6
7
|
from prompt_toolkit import PromptSession
|
7
8
|
from prompt_toolkit.formatted_text import HTML
|
8
9
|
from prompt_toolkit.history import InMemoryHistory
|
@@ -15,6 +16,12 @@ from rich import print as rich_print
|
|
15
16
|
|
16
17
|
from mcp_agent.core.exceptions import PromptExitError
|
17
18
|
|
19
|
+
# Get the application version
|
20
|
+
try:
|
21
|
+
app_version = version("fast-agent-mcp")
|
22
|
+
except: # noqa: E722
|
23
|
+
app_version = "unknown"
|
24
|
+
|
18
25
|
# Map of agent names to their history
|
19
26
|
agent_histories = {}
|
20
27
|
|
@@ -45,7 +52,7 @@ class AgentCompleter(Completer):
|
|
45
52
|
"clear": "Clear the screen",
|
46
53
|
"agents": "List available agents",
|
47
54
|
"STOP": "Stop this prompting session and move to next workflow step",
|
48
|
-
"EXIT": "Exit
|
55
|
+
"EXIT": "Exit fast-agent, terminating any running workflows",
|
49
56
|
**(commands or {}), # Allow custom commands to be passed in
|
50
57
|
}
|
51
58
|
if is_human_input:
|
@@ -204,7 +211,7 @@ async def get_enhanced_input(
|
|
204
211
|
|
205
212
|
shortcut_text = " | ".join(f"{key}:{action}" for key, action in shortcuts)
|
206
213
|
return HTML(
|
207
|
-
f" <{toolbar_color}> {agent_name} </{toolbar_color}> | <b>Mode:</b> <{mode_style}> {mode_text} </{mode_style}> {newline} | {shortcut_text}"
|
214
|
+
f" <{toolbar_color}> {agent_name} </{toolbar_color}> | <b>Mode:</b> <{mode_style}> {mode_text} </{mode_style}> {newline} | {shortcut_text} | <dim>v{app_version}</dim>"
|
208
215
|
)
|
209
216
|
|
210
217
|
# Create session with history and completions
|
@@ -312,13 +319,14 @@ async def handle_special_commands(command, agent_app=None):
|
|
312
319
|
rich_print(" @agent_name - Switch to agent")
|
313
320
|
rich_print(" STOP - Return control back to the workflow")
|
314
321
|
rich_print(
|
315
|
-
" EXIT - Exit
|
322
|
+
" EXIT - Exit fast-agent, terminating any running workflows"
|
316
323
|
)
|
317
324
|
rich_print("\n[bold]Keyboard Shortcuts:[/bold]")
|
318
325
|
rich_print(
|
319
326
|
" Enter - Submit (normal mode) / New line (multiline mode)"
|
320
327
|
)
|
321
|
-
rich_print("
|
328
|
+
rich_print(" \\ + Enter - Insert new line in normal mode")
|
329
|
+
rich_print(" Ctrl+Enter - Always submit (in any mode)")
|
322
330
|
rich_print(" Ctrl+T - Toggle multiline mode")
|
323
331
|
rich_print(" Ctrl+L - Clear input")
|
324
332
|
rich_print(" Up/Down - Navigate history")
|
@@ -330,7 +338,7 @@ async def handle_special_commands(command, agent_app=None):
|
|
330
338
|
return True
|
331
339
|
|
332
340
|
elif command == "EXIT":
|
333
|
-
raise PromptExitError("User requested to exit
|
341
|
+
raise PromptExitError("User requested to exit fast-agent session")
|
334
342
|
|
335
343
|
elif command == "LIST_AGENTS":
|
336
344
|
if available_agents:
|