fast-agent-mcp 0.2.0__py3-none-any.whl → 0.2.1__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.
Potentially problematic release.
This version of fast-agent-mcp might be problematic. Click here for more details.
- {fast_agent_mcp-0.2.0.dist-info → fast_agent_mcp-0.2.1.dist-info}/METADATA +1 -1
- {fast_agent_mcp-0.2.0.dist-info → fast_agent_mcp-0.2.1.dist-info}/RECORD +21 -6
- mcp_agent/cli/commands/bootstrap.py +27 -4
- mcp_agent/resources/examples/data-analysis/analysis-campaign.py +188 -0
- mcp_agent/resources/examples/data-analysis/analysis.py +65 -0
- mcp_agent/resources/examples/data-analysis/fastagent.config.yaml +41 -0
- mcp_agent/resources/examples/data-analysis/mount-point/WA_Fn-UseC_-HR-Employee-Attrition.csv +1471 -0
- mcp_agent/resources/examples/researcher/fastagent.config.yaml +66 -0
- mcp_agent/resources/examples/researcher/researcher-eval.py +53 -0
- mcp_agent/resources/examples/researcher/researcher-imp.py +189 -0
- mcp_agent/resources/examples/researcher/researcher.py +36 -0
- mcp_agent/resources/examples/workflows/chaining.py +36 -0
- mcp_agent/resources/examples/workflows/evaluator.py +77 -0
- mcp_agent/resources/examples/workflows/fastagent.config.yaml +24 -0
- mcp_agent/resources/examples/workflows/human_input.py +26 -0
- mcp_agent/resources/examples/workflows/orchestrator.py +69 -0
- mcp_agent/resources/examples/workflows/parallel.py +58 -0
- mcp_agent/resources/examples/workflows/router.py +54 -0
- {fast_agent_mcp-0.2.0.dist-info → fast_agent_mcp-0.2.1.dist-info}/WHEEL +0 -0
- {fast_agent_mcp-0.2.0.dist-info → fast_agent_mcp-0.2.1.dist-info}/entry_points.txt +0 -0
- {fast_agent_mcp-0.2.0.dist-info → fast_agent_mcp-0.2.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,54 @@
|
|
1
|
+
"""
|
2
|
+
Example MCP Agent application showing router workflow with decorator syntax.
|
3
|
+
Demonstrates router's ability to either:
|
4
|
+
1. Use tools directly to handle requests
|
5
|
+
2. Delegate requests to specialized agents
|
6
|
+
"""
|
7
|
+
|
8
|
+
import asyncio
|
9
|
+
|
10
|
+
from mcp_agent.core.fastagent import FastAgent
|
11
|
+
|
12
|
+
# Create the application
|
13
|
+
fast = FastAgent(
|
14
|
+
"Router Workflow",
|
15
|
+
)
|
16
|
+
|
17
|
+
# Sample requests demonstrating direct tool use vs agent delegation
|
18
|
+
SAMPLE_REQUESTS = [
|
19
|
+
"Download and summarize https://llmindset.co.uk/posts/2024/12/mcp-build-notes/", # Router handles directly with fetch
|
20
|
+
"Analyze the quality of the Python codebase in the current working directory", # Delegated to code expert
|
21
|
+
"What are the key principles of effective beekeeping?", # Delegated to general assistant
|
22
|
+
]
|
23
|
+
|
24
|
+
|
25
|
+
@fast.agent(
|
26
|
+
name="fetcher",
|
27
|
+
instruction="""You are an agent, with a tool enabling you to fetch URLs.""",
|
28
|
+
servers=["fetch"],
|
29
|
+
)
|
30
|
+
@fast.agent(
|
31
|
+
name="code_expert",
|
32
|
+
instruction="""You are an expert in code analysis and software engineering.
|
33
|
+
When asked about code, architecture, or development practices,
|
34
|
+
you provide thorough and practical insights.""",
|
35
|
+
servers=["filesystem"],
|
36
|
+
)
|
37
|
+
@fast.agent(
|
38
|
+
name="general_assistant",
|
39
|
+
instruction="""You are a knowledgeable assistant that provides clear,
|
40
|
+
well-reasoned responses about general topics, concepts, and principles.""",
|
41
|
+
)
|
42
|
+
@fast.router(
|
43
|
+
name="route",
|
44
|
+
model="sonnet",
|
45
|
+
agents=["code_expert", "general_assistant", "fetcher"],
|
46
|
+
)
|
47
|
+
async def main() -> None:
|
48
|
+
async with fast.run() as agent:
|
49
|
+
for request in SAMPLE_REQUESTS:
|
50
|
+
await agent.route(request)
|
51
|
+
|
52
|
+
|
53
|
+
if __name__ == "__main__":
|
54
|
+
asyncio.run(main())
|
File without changes
|
File without changes
|
File without changes
|