fast-agent-mcp 0.0.7__tar.gz → 0.0.9__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.
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/.gitignore +1 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/PKG-INFO +24 -57
- fast_agent_mcp-0.0.9/README.md +53 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/pyproject.toml +16 -5
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/agents/agent.py +8 -4
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/app.py +5 -1
- fast_agent_mcp-0.0.9/src/mcp_agent/cli/commands/bootstrap.py +283 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/cli/commands/setup.py +20 -16
- fast_agent_mcp-0.0.9/src/mcp_agent/core/exceptions.py +47 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/core/fastagent.py +250 -124
- fast_agent_mcp-0.0.9/src/mcp_agent/core/server_validation.py +44 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/event_progress.py +4 -1
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/logging/rich_progress.py +11 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/mcp/mcp_connection_manager.py +11 -2
- fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/data-analysis/analysis.py +35 -0
- fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/data-analysis/fastagent.config.yaml +22 -0
- fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +1471 -0
- fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/workflows/chaining.py +31 -0
- fast_agent_mcp-0.0.7/src/mcp_agent/resources/examples/decorator/optimizer.py → fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/workflows/evaluator.py +7 -10
- fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/workflows/fastagent.config.yaml +9 -0
- fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/workflows/human_input.py +25 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/resources/examples/decorator → fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/workflows}/orchestrator.py +20 -17
- {fast_agent_mcp-0.0.7/src/mcp_agent/resources/examples/decorator → fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/workflows}/parallel.py +14 -18
- {fast_agent_mcp-0.0.7/src/mcp_agent/resources/examples/decorator → fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/workflows}/router.py +9 -10
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/llm/augmented_llm_anthropic.py +54 -14
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/llm/augmented_llm_openai.py +38 -9
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/orchestrator/orchestrator.py +53 -108
- fast_agent_mcp-0.0.9/src/mcp_agent/workflows/swarm/__init__.py +0 -0
- fast_agent_mcp-0.0.7/README.md +0 -85
- fast_agent_mcp-0.0.7/src/mcp_agent/cli/commands/bootstrap.py +0 -221
- fast_agent_mcp-0.0.7/src/mcp_agent/resources/examples/decorator/main.py +0 -26
- fast_agent_mcp-0.0.7/src/mcp_agent/resources/examples/decorator/tiny.py +0 -22
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/LICENSE +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/agents/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/cli/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/cli/__main__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/cli/commands/config.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/cli/main.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/cli/terminal.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/config.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/console.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/context.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/context_dependent.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/eval → fast_agent_mcp-0.0.9/src/mcp_agent/core}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/executor → fast_agent_mcp-0.0.9/src/mcp_agent/eval}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/human_input → fast_agent_mcp-0.0.9/src/mcp_agent/executor}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/executor/decorator_registry.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/executor/executor.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/executor/task_registry.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/executor/temporal.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/executor/workflow.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/executor/workflow_signal.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/logging → fast_agent_mcp-0.0.9/src/mcp_agent/human_input}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/human_input/handler.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/human_input/types.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/mcp → fast_agent_mcp-0.0.9/src/mcp_agent/logging}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/logging/events.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/logging/json_serializer.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/logging/listeners.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/logging/logger.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/logging/tracing.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/logging/transport.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/telemetry → fast_agent_mcp-0.0.9/src/mcp_agent/mcp}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/mcp/gen_client.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/mcp/mcp_activity.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/mcp/mcp_agent_client_session.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/mcp/mcp_agent_server.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/mcp/mcp_aggregator.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/mcp/stdio.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/mcp_server_registry.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/progress_display.py +0 -0
- /fast_agent_mcp-0.0.7/src/mcp_agent/resources/examples/mcp_researcher/main-evalopt.py → /fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/mcp_researcher/researcher-eval.py +0 -0
- /fast_agent_mcp-0.0.7/src/mcp_agent/resources/examples/mcp_researcher/main.py → /fast_agent_mcp-0.0.9/src/mcp_agent/resources/examples/mcp_researcher/researcher.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/workflows → fast_agent_mcp-0.0.9/src/mcp_agent/telemetry}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/telemetry/usage_tracking.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/workflows/embedding → fast_agent_mcp-0.0.9/src/mcp_agent/workflows}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/workflows/evaluator_optimizer → fast_agent_mcp-0.0.9/src/mcp_agent/workflows/embedding}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/embedding/embedding_base.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/embedding/embedding_cohere.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/embedding/embedding_openai.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/workflows/intent_classifier → fast_agent_mcp-0.0.9/src/mcp_agent/workflows/evaluator_optimizer}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/evaluator_optimizer/evaluator_optimizer.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/workflows/llm → fast_agent_mcp-0.0.9/src/mcp_agent/workflows/intent_classifier}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/intent_classifier/intent_classifier_base.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding_cohere.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/intent_classifier/intent_classifier_embedding_openai.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm_anthropic.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/intent_classifier/intent_classifier_llm_openai.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/workflows/orchestrator → fast_agent_mcp-0.0.9/src/mcp_agent/workflows/llm}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/llm/augmented_llm.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/llm/llm_selector.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/llm/model_factory.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/workflows/parallel → fast_agent_mcp-0.0.9/src/mcp_agent/workflows/orchestrator}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/orchestrator/orchestrator_models.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/orchestrator/orchestrator_prompts.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/workflows/router → fast_agent_mcp-0.0.9/src/mcp_agent/workflows/parallel}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/parallel/fan_in.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/parallel/fan_out.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/parallel/parallel_llm.py +0 -0
- {fast_agent_mcp-0.0.7/src/mcp_agent/workflows/swarm → fast_agent_mcp-0.0.9/src/mcp_agent/workflows/router}/__init__.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/router/router_base.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/router/router_embedding.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/router/router_embedding_cohere.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/router/router_embedding_openai.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/router/router_llm.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/swarm/swarm.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/swarm/swarm_anthropic.py +0 -0
- {fast_agent_mcp-0.0.7 → fast_agent_mcp-0.0.9}/src/mcp_agent/workflows/swarm/swarm_openai.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fast-agent-mcp
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.0.9
|
|
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
|
|
7
7
|
Version 2.0, January 2004
|
|
@@ -219,7 +219,6 @@ Requires-Dist: opentelemetry-distro>=0.50b0
|
|
|
219
219
|
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.29.0
|
|
220
220
|
Requires-Dist: pydantic-settings>=2.7.0
|
|
221
221
|
Requires-Dist: pydantic>=2.10.4
|
|
222
|
-
Requires-Dist: pyreadline3>=3.5.4
|
|
223
222
|
Requires-Dist: pyyaml>=6.0.2
|
|
224
223
|
Requires-Dist: rich>=13.9.4
|
|
225
224
|
Requires-Dist: scikit-learn>=1.6.0
|
|
@@ -238,35 +237,39 @@ Description-Content-Type: text/markdown
|
|
|
238
237
|
## FastAgent
|
|
239
238
|
|
|
240
239
|
<p align="center">
|
|
241
|
-
<a href="https://pypi.org/project/
|
|
242
|
-
<a href="https://github.com/
|
|
240
|
+
<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>
|
|
241
|
+
<a href="https://github.com/evalstate/fast-agent/issues"><img src="https://img.shields.io/github/issues-raw/evalstate/fast-agent" /></a>
|
|
243
242
|
<a href="https://lmai.link/discord/mcp-agent"><img src="https://shields.io/discord/1089284610329952357" alt="discord" /></a>
|
|
244
|
-
<img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/
|
|
245
|
-
<a href="https://github.com/
|
|
243
|
+
<img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/fast-agent-mcp?label=pypi%20%7C%20downloads"/>
|
|
244
|
+
<a href="https://github.com/evalstate/fast-agent-mcp/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/fast-agent-mcp" /></a>
|
|
246
245
|
</p>
|
|
247
246
|
|
|
248
247
|
## Overview
|
|
249
248
|
|
|
250
|
-
**`
|
|
249
|
+
**`fast-agent`** lets you define, test and compose agents and tools in minutes.
|
|
251
250
|
|
|
252
|
-
|
|
251
|
+
### Get started:
|
|
253
252
|
|
|
254
|
-
|
|
255
|
-
2. [Building Effective Agents](https://www.anthropic.com/research/building-effective-agents) - a seminal writeup on simple, composable patterns for building production-ready AI agents.
|
|
253
|
+
Install the [uv package manager](https://docs.astral.sh/uv/).
|
|
256
254
|
|
|
257
|
-
`
|
|
255
|
+
`uv pip install fast-agent-mcp` - download and install fast-agent
|
|
258
256
|
|
|
259
|
-
|
|
260
|
-
2. It implements every pattern described in Building Effective Agents, and does so in a _composable_ way, allowing you to chain these patterns together.
|
|
261
|
-
3. **Bonus**: It implements [OpenAI's Swarm](https://github.com/openai/swarm) pattern for multi-agent orchestration, but in a model-agnostic way.
|
|
257
|
+
`fast-agent setup` - setup an agent and configuration files.
|
|
262
258
|
|
|
263
|
-
|
|
264
|
-
|
|
259
|
+
`uv run agent.py` - run and interact with your first agent.
|
|
260
|
+
|
|
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.
|
|
262
|
+
|
|
263
|
+
`fast-agent bootstrap` -
|
|
264
|
+
|
|
265
|
+
It's built on top of [mcp-agent](todo).
|
|
265
266
|
|
|
266
267
|
### llmindset.co.uk fork:
|
|
267
268
|
|
|
268
|
-
- "FastAgent" style prototyping
|
|
269
|
-
-
|
|
269
|
+
- "FastAgent" style prototyping, with per-agent models
|
|
270
|
+
- Warm-up / Post-Workflow Agent Interactions
|
|
271
|
+
- Quick Setup
|
|
272
|
+
- Interactive Prompt Mode
|
|
270
273
|
- Simple Model Selection with aliases
|
|
271
274
|
- User/Assistant and Tool Call message display
|
|
272
275
|
- MCP Sever Environment Variable support
|
|
@@ -274,49 +277,13 @@ We welcome all kinds of [contributions](/CONTRIBUTING.md), feedback and your hel
|
|
|
274
277
|
- Comprehensive Progress display
|
|
275
278
|
- JSONL file logging with secret revokation
|
|
276
279
|
- OpenAI o1/o3-mini support with reasoning level
|
|
277
|
-
-
|
|
280
|
+
- Enhanced Human Input Messaging and Handling
|
|
281
|
+
- Declarative workflows
|
|
278
282
|
|
|
279
283
|
## Get Started
|
|
280
284
|
|
|
281
285
|
We recommend using [uv](https://docs.astral.sh/uv/) to manage your Python projects:
|
|
282
286
|
|
|
283
|
-
```bash
|
|
284
|
-
uv add "mcp-agent"
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
Alternatively:
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
pip install mcp-agent
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### Quickstart
|
|
294
|
-
|
|
295
|
-
> [!TIP]
|
|
296
|
-
> The [`examples`](/examples) directory has several example applications to get started with.
|
|
297
|
-
> To run an example, clone this repo, then:
|
|
298
|
-
>
|
|
299
|
-
> ```bash
|
|
300
|
-
> cd examples/mcp_basic_agent # Or any other example
|
|
301
|
-
> cp mcp_agent.secrets.yaml.example mcp_agent.secrets.yaml # Update API keys
|
|
302
|
-
> uv run main.py
|
|
303
|
-
> ```
|
|
304
|
-
|
|
305
287
|
## Table of Contents
|
|
306
288
|
|
|
307
|
-
## Workflows
|
|
308
|
-
|
|
309
|
-
mcp-agent provides implementations for every pattern in Anthropic’s [Building Effective Agents](https://www.anthropic.com/research/building-effective-agents), as well as the OpenAI [Swarm](https://github.com/openai/swarm) pattern.
|
|
310
|
-
Each pattern is model-agnostic, and exposed as an `AugmentedLLM`, making everything very composable.
|
|
311
|
-
|
|
312
|
-
</details>
|
|
313
|
-
|
|
314
|
-
### Signaling and Human Input
|
|
315
|
-
|
|
316
|
-
**Signaling**: The framework can pause/resume tasks. The agent or LLM might “signal” that it needs user input, so the workflow awaits. A developer may signal during a workflow to seek approval or review before continuing with a workflow.
|
|
317
|
-
|
|
318
|
-
**Human Input**: If an Agent has a `human_input_callback`, the LLM can call a `__human_input__` tool to request user input mid-workflow.
|
|
319
|
-
|
|
320
|
-
## Contributing
|
|
321
|
-
|
|
322
289
|
We welcome any and all kinds of contributions. Please see the [CONTRIBUTING guidelines](./CONTRIBUTING.md) to get started.
|
|
@@ -0,0 +1,53 @@
|
|
|
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`** lets you define, test and compose agents and tools in minutes.
|
|
14
|
+
|
|
15
|
+
### Get started:
|
|
16
|
+
|
|
17
|
+
Install the [uv package manager](https://docs.astral.sh/uv/).
|
|
18
|
+
|
|
19
|
+
`uv pip install fast-agent-mcp` - download and install fast-agent
|
|
20
|
+
|
|
21
|
+
`fast-agent setup` - setup an agent and configuration files.
|
|
22
|
+
|
|
23
|
+
`uv run agent.py` - run and interact with your first agent.
|
|
24
|
+
|
|
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.
|
|
26
|
+
|
|
27
|
+
`fast-agent bootstrap` -
|
|
28
|
+
|
|
29
|
+
It's built on top of [mcp-agent](todo).
|
|
30
|
+
|
|
31
|
+
### llmindset.co.uk fork:
|
|
32
|
+
|
|
33
|
+
- "FastAgent" style prototyping, with per-agent models
|
|
34
|
+
- Warm-up / Post-Workflow Agent Interactions
|
|
35
|
+
- Quick Setup
|
|
36
|
+
- Interactive Prompt Mode
|
|
37
|
+
- Simple Model Selection with aliases
|
|
38
|
+
- User/Assistant and Tool Call message display
|
|
39
|
+
- MCP Sever Environment Variable support
|
|
40
|
+
- MCP Roots support
|
|
41
|
+
- Comprehensive Progress display
|
|
42
|
+
- JSONL file logging with secret revokation
|
|
43
|
+
- OpenAI o1/o3-mini support with reasoning level
|
|
44
|
+
- Enhanced Human Input Messaging and Handling
|
|
45
|
+
- Declarative workflows
|
|
46
|
+
|
|
47
|
+
## Get Started
|
|
48
|
+
|
|
49
|
+
We recommend using [uv](https://docs.astral.sh/uv/) to manage your Python projects:
|
|
50
|
+
|
|
51
|
+
## Table of Contents
|
|
52
|
+
|
|
53
|
+
We welcome any and all kinds of contributions. Please see the [CONTRIBUTING guidelines](./CONTRIBUTING.md) to get started.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "fast-agent-mcp"
|
|
3
|
-
version = "0.0.
|
|
4
|
-
description = "
|
|
3
|
+
version = "0.0.9"
|
|
4
|
+
description = "Define, Prompt and Test MCP enabled Agents and Workflows"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { file = "LICENSE" }
|
|
7
7
|
authors = [
|
|
@@ -27,7 +27,6 @@ dependencies = [
|
|
|
27
27
|
"typer>=0.15.1",
|
|
28
28
|
"numpy>=2.2.1",
|
|
29
29
|
"scikit-learn>=1.6.0",
|
|
30
|
-
"pyreadline3>=3.5.4",
|
|
31
30
|
"anthropic>=0.42.0",
|
|
32
31
|
"openai>=1.63.2",
|
|
33
32
|
]
|
|
@@ -57,7 +56,13 @@ packages = ["src/mcp_agent"]
|
|
|
57
56
|
[tool.hatch.build]
|
|
58
57
|
include = [
|
|
59
58
|
"src/mcp_agent/**/*.py",
|
|
59
|
+
"src/mcp_agent/**/*.yaml",
|
|
60
|
+
"src/mcp_agent/**/*.yml",
|
|
61
|
+
"src/mcp_agent/**/*.csv",
|
|
60
62
|
"src/mcp_agent/resources/**/*.py",
|
|
63
|
+
"src/mcp_agent/resources/**/*.yaml",
|
|
64
|
+
"src/mcp_agent/resources/**/*.yml",
|
|
65
|
+
"src/mcp_agent/resources/**/*.csv",
|
|
61
66
|
]
|
|
62
67
|
|
|
63
68
|
[dependency-groups]
|
|
@@ -77,6 +82,12 @@ fastagent = "mcp_agent.cli.__main__:app"
|
|
|
77
82
|
silsila = "mcp_agent.cli.__main__:app"
|
|
78
83
|
|
|
79
84
|
[tool.setuptools.package-data]
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
mcp_agent = [
|
|
86
|
+
"data/*.json",
|
|
87
|
+
"resources/examples/**/*.py",
|
|
88
|
+
"resources/examples/**/*.yaml",
|
|
89
|
+
"resources/examples/**/*.yml",
|
|
90
|
+
"resources/examples/**/*.csv",
|
|
91
|
+
"resources/examples/**/mount-point/*.csv"
|
|
92
|
+
]
|
|
82
93
|
|
|
@@ -43,6 +43,7 @@ class AgentConfig:
|
|
|
43
43
|
model: Optional[str] = None
|
|
44
44
|
use_history: bool = True
|
|
45
45
|
default_request_params: Optional[RequestParams] = None
|
|
46
|
+
human_input: bool = False
|
|
46
47
|
|
|
47
48
|
def __post_init__(self):
|
|
48
49
|
"""Ensure default_request_params exists with proper history setting"""
|
|
@@ -103,10 +104,13 @@ class Agent(MCPAggregator):
|
|
|
103
104
|
# Map function names to tools
|
|
104
105
|
self._function_tool_map: Dict[str, FastTool] = {}
|
|
105
106
|
|
|
106
|
-
self.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
if not self.config.human_input:
|
|
108
|
+
self.human_input_callback = None
|
|
109
|
+
else:
|
|
110
|
+
self.human_input_callback: HumanInputCallback | None = human_input_callback
|
|
111
|
+
if not human_input_callback:
|
|
112
|
+
if self.context.human_input_handler:
|
|
113
|
+
self.human_input_callback = self.context.human_input_handler
|
|
110
114
|
|
|
111
115
|
async def initialize(self):
|
|
112
116
|
"""
|
|
@@ -154,7 +154,11 @@ class MCPApp:
|
|
|
154
154
|
"agent_name": "mcp_application_loop",
|
|
155
155
|
},
|
|
156
156
|
)
|
|
157
|
-
|
|
157
|
+
try:
|
|
158
|
+
await cleanup_context()
|
|
159
|
+
except asyncio.CancelledError:
|
|
160
|
+
self.logger.debug("Cleanup cancelled error during shutdown")
|
|
161
|
+
|
|
158
162
|
self._context = None
|
|
159
163
|
self._initialized = False
|
|
160
164
|
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"""Bootstrap command to create example applications."""
|
|
2
|
+
|
|
3
|
+
import shutil
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
import typer
|
|
6
|
+
from rich.console import Console
|
|
7
|
+
from rich.table import Table
|
|
8
|
+
from rich.panel import Panel
|
|
9
|
+
|
|
10
|
+
app = typer.Typer(
|
|
11
|
+
help="Create example applications",
|
|
12
|
+
no_args_is_help=False, # Allow showing our custom help instead
|
|
13
|
+
)
|
|
14
|
+
console = Console()
|
|
15
|
+
|
|
16
|
+
EXAMPLE_TYPES = {
|
|
17
|
+
"workflow": {
|
|
18
|
+
"description": "Example workflows, demonstrating each of the patterns in Anthropic's\n"
|
|
19
|
+
"'Building Effective Agents' paper. Some agents use the 'fetch'\n"
|
|
20
|
+
"and filesystem MCP Servers.",
|
|
21
|
+
"files": [
|
|
22
|
+
"chaining.py",
|
|
23
|
+
"evaluator.py",
|
|
24
|
+
"human_input.py",
|
|
25
|
+
"orchestrator.py",
|
|
26
|
+
"parallel.py",
|
|
27
|
+
"router.py",
|
|
28
|
+
],
|
|
29
|
+
"create_subdir": False,
|
|
30
|
+
},
|
|
31
|
+
"researcher": {
|
|
32
|
+
"description": "Research agent example with additional evaluation/optimization\n"
|
|
33
|
+
"example. Uses Brave Search and Docker MCP Servers.\n"
|
|
34
|
+
"Creates examples in a 'researcher' subdirectory.",
|
|
35
|
+
"files": [
|
|
36
|
+
"researcher.py",
|
|
37
|
+
"researcher-eval.py",
|
|
38
|
+
"mcp_agent.secrets.yaml.example",
|
|
39
|
+
],
|
|
40
|
+
"create_subdir": True,
|
|
41
|
+
},
|
|
42
|
+
"data-analysis": {
|
|
43
|
+
"description": "Data analysis agent examples that demonstrate working with\n"
|
|
44
|
+
"datasets, performing statistical analysis, and generating visualizations.\n"
|
|
45
|
+
"Creates examples in a 'data-analysis' subdirectory with mount-point for data.\n"
|
|
46
|
+
"Uses MCP 'roots' feature for mapping",
|
|
47
|
+
"files": ["analysis.py", "fastagent.config.yaml"],
|
|
48
|
+
"mount_point_files": ["WA_Fn-UseC_-HR-Employee-Attrition.csv"],
|
|
49
|
+
"create_subdir": True,
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def copy_example_files(
|
|
55
|
+
example_type: str, target_dir: Path, force: bool = False
|
|
56
|
+
) -> list[str]:
|
|
57
|
+
"""Copy example files from resources to target directory."""
|
|
58
|
+
created = []
|
|
59
|
+
|
|
60
|
+
# Determine if we should create a subdirectory for this example type
|
|
61
|
+
example_info = EXAMPLE_TYPES[example_type]
|
|
62
|
+
if example_info["create_subdir"]:
|
|
63
|
+
target_dir = target_dir / example_type
|
|
64
|
+
if not target_dir.exists():
|
|
65
|
+
target_dir.mkdir(parents=True)
|
|
66
|
+
console.print(f"Created subdirectory: {target_dir}")
|
|
67
|
+
|
|
68
|
+
# Create mount-point directory if needed
|
|
69
|
+
mount_point_files = example_info.get("mount_point_files", [])
|
|
70
|
+
if mount_point_files:
|
|
71
|
+
mount_point_dir = target_dir / "mount-point"
|
|
72
|
+
if not mount_point_dir.exists():
|
|
73
|
+
mount_point_dir.mkdir(parents=True)
|
|
74
|
+
console.print(f"Created mount-point directory: {mount_point_dir}")
|
|
75
|
+
|
|
76
|
+
# Use the resources directory from the package
|
|
77
|
+
source_dir = (
|
|
78
|
+
Path(__file__).parent.parent.parent
|
|
79
|
+
/ "resources"
|
|
80
|
+
/ "examples"
|
|
81
|
+
/ ("workflows" if example_type == "workflow" else f"{example_type}")
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
if not source_dir.exists():
|
|
85
|
+
console.print(f"[red]Error: Source directory not found: {source_dir}[/red]")
|
|
86
|
+
return created
|
|
87
|
+
|
|
88
|
+
for filename in example_info["files"]:
|
|
89
|
+
source = source_dir / filename
|
|
90
|
+
target = target_dir / filename
|
|
91
|
+
|
|
92
|
+
try:
|
|
93
|
+
if not source.exists():
|
|
94
|
+
console.print(f"[red]Error: Source file not found: {source}[/red]")
|
|
95
|
+
continue
|
|
96
|
+
|
|
97
|
+
if target.exists() and not force:
|
|
98
|
+
console.print(f"[yellow]Skipping[/yellow] {filename} (already exists)")
|
|
99
|
+
continue
|
|
100
|
+
|
|
101
|
+
shutil.copy2(source, target)
|
|
102
|
+
created.append(str(target.relative_to(target_dir.parent)))
|
|
103
|
+
console.print(f"[green]Created[/green] {created[-1]}")
|
|
104
|
+
|
|
105
|
+
except Exception as e:
|
|
106
|
+
console.print(f"[red]Error copying {filename}: {str(e)}[/red]")
|
|
107
|
+
|
|
108
|
+
# Copy mount-point files if any
|
|
109
|
+
if mount_point_files:
|
|
110
|
+
source_mount_point = source_dir / "mount-point"
|
|
111
|
+
for filename in mount_point_files:
|
|
112
|
+
source = source_mount_point / filename
|
|
113
|
+
target = mount_point_dir / filename
|
|
114
|
+
|
|
115
|
+
try:
|
|
116
|
+
if not source.exists():
|
|
117
|
+
console.print(f"[red]Error: Source file not found: {source}[/red]")
|
|
118
|
+
continue
|
|
119
|
+
|
|
120
|
+
if target.exists() and not force:
|
|
121
|
+
console.print(
|
|
122
|
+
f"[yellow]Skipping[/yellow] mount-point/{filename} (already exists)"
|
|
123
|
+
)
|
|
124
|
+
continue
|
|
125
|
+
|
|
126
|
+
shutil.copy2(source, target)
|
|
127
|
+
created.append(f"{example_type}/mount-point/{filename}")
|
|
128
|
+
console.print(f"[green]Created[/green] mount-point/{filename}")
|
|
129
|
+
|
|
130
|
+
except Exception as e:
|
|
131
|
+
console.print(
|
|
132
|
+
f"[red]Error copying mount-point/{filename}: {str(e)}[/red]"
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
return created
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def show_overview():
|
|
139
|
+
"""Display an overview of available examples in a nicely formatted table."""
|
|
140
|
+
console.print("\n[bold cyan]FastAgent Example Applications[/bold cyan]")
|
|
141
|
+
console.print("Build agents and compose workflows through practical examples\n")
|
|
142
|
+
|
|
143
|
+
# Create a table for better organization
|
|
144
|
+
table = Table(
|
|
145
|
+
show_header=True, header_style="bold magenta", box=None, padding=(0, 2)
|
|
146
|
+
)
|
|
147
|
+
table.add_column("Example")
|
|
148
|
+
table.add_column("Description")
|
|
149
|
+
table.add_column("Files")
|
|
150
|
+
|
|
151
|
+
for name, info in EXAMPLE_TYPES.items():
|
|
152
|
+
files_list = "\n".join(f"• {f}" for f in info["files"])
|
|
153
|
+
if "mount_point_files" in info:
|
|
154
|
+
files_list += "\n[blue]mount-point:[/blue]\n" + "\n".join(
|
|
155
|
+
f"• {f}" for f in info["mount_point_files"]
|
|
156
|
+
)
|
|
157
|
+
table.add_row(f"[green]{name}[/green]", info["description"], files_list)
|
|
158
|
+
|
|
159
|
+
console.print(table)
|
|
160
|
+
|
|
161
|
+
# Show usage instructions in a panel
|
|
162
|
+
usage_text = (
|
|
163
|
+
"[bold]Commands:[/bold]\n"
|
|
164
|
+
" fastagent bootstrap workflow DIR Create workflow examples in DIR\n"
|
|
165
|
+
" fastagent bootstrap researcher DIR Create researcher example in 'researcher' subdirectory\n"
|
|
166
|
+
" fastagent bootstrap data-analysis DIR Create data analysis examples in 'data-analysis' subdirectory\n\n"
|
|
167
|
+
"[bold]Options:[/bold]\n"
|
|
168
|
+
" --force Overwrite existing files\n\n"
|
|
169
|
+
"[bold]Examples:[/bold]\n"
|
|
170
|
+
" fastagent bootstrap workflow . Create in current directory\n"
|
|
171
|
+
" fastagent bootstrap researcher . Create in researcher subdirectory\n"
|
|
172
|
+
" fastagent bootstrap data-analysis . --force Force overwrite files in data-analysis subdirectory"
|
|
173
|
+
)
|
|
174
|
+
console.print(Panel(usage_text, title="Usage", border_style="blue"))
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
@app.command()
|
|
178
|
+
def workflow(
|
|
179
|
+
directory: Path = typer.Argument(
|
|
180
|
+
Path("."),
|
|
181
|
+
help="Directory where workflow examples will be created",
|
|
182
|
+
),
|
|
183
|
+
force: bool = typer.Option(
|
|
184
|
+
False, "--force", "-f", help="Force overwrite existing files"
|
|
185
|
+
),
|
|
186
|
+
):
|
|
187
|
+
"""Create workflow pattern examples."""
|
|
188
|
+
target_dir = directory.resolve()
|
|
189
|
+
if not target_dir.exists():
|
|
190
|
+
target_dir.mkdir(parents=True)
|
|
191
|
+
console.print(f"Created directory: {target_dir}")
|
|
192
|
+
|
|
193
|
+
created = copy_example_files("workflow", target_dir, force)
|
|
194
|
+
_show_completion_message("workflow", created)
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
@app.command()
|
|
198
|
+
def researcher(
|
|
199
|
+
directory: Path = typer.Argument(
|
|
200
|
+
Path("."),
|
|
201
|
+
help="Directory where researcher examples will be created (in 'researcher' subdirectory)",
|
|
202
|
+
),
|
|
203
|
+
force: bool = typer.Option(
|
|
204
|
+
False, "--force", "-f", help="Force overwrite existing files"
|
|
205
|
+
),
|
|
206
|
+
):
|
|
207
|
+
"""Create researcher pattern examples."""
|
|
208
|
+
target_dir = directory.resolve()
|
|
209
|
+
if not target_dir.exists():
|
|
210
|
+
target_dir.mkdir(parents=True)
|
|
211
|
+
console.print(f"Created directory: {target_dir}")
|
|
212
|
+
|
|
213
|
+
created = copy_example_files("researcher", target_dir, force)
|
|
214
|
+
_show_completion_message("researcher", created)
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
@app.command()
|
|
218
|
+
def data_analysis(
|
|
219
|
+
directory: Path = typer.Argument(
|
|
220
|
+
Path("."),
|
|
221
|
+
help="Directory where data analysis examples will be created (creates 'data-analysis' subdirectory with mount-point)",
|
|
222
|
+
),
|
|
223
|
+
force: bool = typer.Option(
|
|
224
|
+
False, "--force", "-f", help="Force overwrite existing files"
|
|
225
|
+
),
|
|
226
|
+
):
|
|
227
|
+
"""Create data analysis examples with sample dataset."""
|
|
228
|
+
target_dir = directory.resolve()
|
|
229
|
+
if not target_dir.exists():
|
|
230
|
+
target_dir.mkdir(parents=True)
|
|
231
|
+
console.print(f"Created directory: {target_dir}")
|
|
232
|
+
|
|
233
|
+
created = copy_example_files("data-analysis", target_dir, force)
|
|
234
|
+
_show_completion_message("data-analysis", created)
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
def _show_completion_message(example_type: str, created: list[str]):
|
|
238
|
+
"""Show completion message and next steps."""
|
|
239
|
+
if created:
|
|
240
|
+
console.print("\n[green]Setup completed successfully![/green]")
|
|
241
|
+
console.print("\nCreated files:")
|
|
242
|
+
for f in created:
|
|
243
|
+
console.print(f" - {f}")
|
|
244
|
+
|
|
245
|
+
console.print("\n[bold]Next Steps:[/bold]")
|
|
246
|
+
if example_type == "workflow":
|
|
247
|
+
console.print("1. Review chaining.py for the basic workflow example")
|
|
248
|
+
console.print("2. Check other examples:")
|
|
249
|
+
console.print(" - parallel.py: Run agents in parallel")
|
|
250
|
+
console.print(" - router.py: Route requests between agents")
|
|
251
|
+
console.print(" - evaluator.py: Add evaluation capabilities")
|
|
252
|
+
console.print(" - human_input.py: Incorporate human feedback")
|
|
253
|
+
console.print("3. Run an example with: uv run <example>.py")
|
|
254
|
+
console.print(
|
|
255
|
+
"4. Try a different model with --model=<model>, or update the agent config"
|
|
256
|
+
)
|
|
257
|
+
|
|
258
|
+
elif example_type == "researcher":
|
|
259
|
+
console.print(
|
|
260
|
+
"1. Set up the Brave MCP Server (get an API key from https://brave.com/search/api/)"
|
|
261
|
+
)
|
|
262
|
+
console.print("2. Try `uv run researcher.py` for the basic version")
|
|
263
|
+
console.print(
|
|
264
|
+
"3. Try `uv run researcher-eval.py` for the eval/optimize version"
|
|
265
|
+
)
|
|
266
|
+
elif example_type == "data-analysis":
|
|
267
|
+
console.print(
|
|
268
|
+
"1. Run uv `analysis.py` to perform data analysis and visualization"
|
|
269
|
+
)
|
|
270
|
+
console.print("2. The dataset is available in the mount-point directory:")
|
|
271
|
+
console.print(" - mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv")
|
|
272
|
+
console.print(
|
|
273
|
+
"On Windows platforms, please edit the fastagent.config.yaml and adjust the volume mount point."
|
|
274
|
+
)
|
|
275
|
+
else:
|
|
276
|
+
console.print("\n[yellow]No files were created.[/yellow]")
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
@app.callback(invoke_without_command=True)
|
|
280
|
+
def main(ctx: typer.Context):
|
|
281
|
+
"""Create example applications and learn FastAgent patterns."""
|
|
282
|
+
if ctx.invoked_subcommand is None:
|
|
283
|
+
show_overview()
|
|
@@ -22,28 +22,31 @@ FASTAGENT_CONFIG_TEMPLATE = """
|
|
|
22
22
|
default_model: sonnet
|
|
23
23
|
|
|
24
24
|
# Logging and Console Configuration:
|
|
25
|
-
|
|
25
|
+
logger:
|
|
26
26
|
# level: "debug" | "info" | "warning" | "error"
|
|
27
27
|
# type: "none" | "console" | "file" | "http"
|
|
28
28
|
# path: "/path/to/logfile.jsonl"
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
# Switch the progress display on or off
|
|
32
|
-
|
|
32
|
+
progress_display: true
|
|
33
33
|
|
|
34
34
|
# Show chat User/Assistant messages on the console
|
|
35
|
-
|
|
35
|
+
show_chat: true
|
|
36
36
|
# Show tool calls on the console
|
|
37
|
-
|
|
37
|
+
show_tools: true
|
|
38
38
|
# Truncate long tool responses on the console
|
|
39
|
-
|
|
39
|
+
truncate_tools: true
|
|
40
40
|
|
|
41
41
|
# MCP Servers
|
|
42
42
|
mcp:
|
|
43
43
|
servers:
|
|
44
44
|
fetch:
|
|
45
45
|
command: "uvx"
|
|
46
|
-
args: ["mcp-server-fetch"]
|
|
46
|
+
args: ["mcp-server-fetch"]
|
|
47
|
+
filesystem:
|
|
48
|
+
command: "npx"
|
|
49
|
+
args: ["-y", "@modelcontextprotocol/server-filesystem", "."]
|
|
47
50
|
|
|
48
51
|
"""
|
|
49
52
|
|
|
@@ -51,6 +54,8 @@ FASTAGENT_SECRETS_TEMPLATE = """
|
|
|
51
54
|
# FastAgent Secrets Configuration
|
|
52
55
|
# WARNING: Keep this file secure and never commit to version control
|
|
53
56
|
|
|
57
|
+
# Alternatively set OPENAI_API_KEY and ANTHROPIC_API_KEY environment variables. Config file takes precedence.
|
|
58
|
+
|
|
54
59
|
openai:
|
|
55
60
|
api_key: <your-api-key-here>
|
|
56
61
|
anthropic:
|
|
@@ -110,17 +115,14 @@ import asyncio
|
|
|
110
115
|
from mcp_agent.core.fastagent import FastAgent
|
|
111
116
|
|
|
112
117
|
# Create the application
|
|
113
|
-
|
|
114
|
-
# Uncomment the below to disable human input callback tool
|
|
115
|
-
# agent_app.app._human_input_callback = None
|
|
118
|
+
fast = FastAgent("FastAgent Example")
|
|
116
119
|
|
|
117
120
|
|
|
118
121
|
# Define the agent
|
|
119
|
-
@
|
|
120
|
-
# @agent_app.agent(servers=["fetch"])
|
|
122
|
+
@fast.agent(servers=["fetch"])
|
|
121
123
|
async def main():
|
|
122
|
-
# use the --model
|
|
123
|
-
async with
|
|
124
|
+
# use the --model command line switch or agent arguments to change model
|
|
125
|
+
async with fast.run() as agent:
|
|
124
126
|
await agent()
|
|
125
127
|
|
|
126
128
|
|
|
@@ -217,11 +219,13 @@ def init(
|
|
|
217
219
|
|
|
218
220
|
if created:
|
|
219
221
|
console.print("\n[green]Setup completed successfully![/green]")
|
|
220
|
-
if "fastagent
|
|
222
|
+
if "fastagent.secrets.yaml" in created:
|
|
221
223
|
console.print("\n[yellow]Important:[/yellow] Remember to:")
|
|
222
|
-
console.print("1. Add your API keys to fastagent-secrets.yaml")
|
|
223
224
|
console.print(
|
|
224
|
-
"
|
|
225
|
+
"1. Add your API keys to fastagent-secrets.yaml or set OPENAI_API_KEY and ANTHROPIC_API_KEY environment variables"
|
|
226
|
+
)
|
|
227
|
+
console.print(
|
|
228
|
+
"2. Keep fastagent.secrets.yaml secure and never commit it to version control"
|
|
225
229
|
)
|
|
226
230
|
console.print("\nTo get started, run:")
|
|
227
231
|
console.print(" uv run agent.py")
|