fast-agent-mcp 0.2.36__py3-none-any.whl → 0.2.38__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.36.dist-info → fast_agent_mcp-0.2.38.dist-info}/METADATA +10 -7
- {fast_agent_mcp-0.2.36.dist-info → fast_agent_mcp-0.2.38.dist-info}/RECORD +45 -47
- {fast_agent_mcp-0.2.36.dist-info → fast_agent_mcp-0.2.38.dist-info}/licenses/LICENSE +1 -1
- mcp_agent/cli/commands/quickstart.py +60 -5
- mcp_agent/config.py +10 -0
- mcp_agent/context.py +1 -4
- mcp_agent/core/agent_types.py +7 -6
- mcp_agent/core/direct_decorators.py +14 -0
- mcp_agent/core/direct_factory.py +1 -0
- mcp_agent/core/fastagent.py +23 -2
- mcp_agent/human_input/elicitation_form.py +723 -0
- mcp_agent/human_input/elicitation_forms.py +59 -0
- mcp_agent/human_input/elicitation_handler.py +88 -0
- mcp_agent/human_input/elicitation_state.py +34 -0
- mcp_agent/llm/providers/augmented_llm_google_native.py +4 -2
- mcp_agent/llm/providers/augmented_llm_openai.py +1 -1
- mcp_agent/mcp/elicitation_factory.py +84 -0
- mcp_agent/mcp/elicitation_handlers.py +155 -0
- mcp_agent/mcp/helpers/content_helpers.py +27 -0
- mcp_agent/mcp/helpers/server_config_helpers.py +10 -8
- mcp_agent/mcp/mcp_agent_client_session.py +44 -1
- mcp_agent/mcp/mcp_aggregator.py +56 -11
- mcp_agent/mcp/mcp_connection_manager.py +30 -18
- mcp_agent/mcp_server/agent_server.py +2 -0
- mcp_agent/mcp_server_registry.py +16 -8
- mcp_agent/resources/examples/data-analysis/analysis.py +1 -2
- mcp_agent/resources/examples/mcp/elicitations/elicitation_account_server.py +88 -0
- mcp_agent/resources/examples/mcp/elicitations/elicitation_forms_server.py +232 -0
- mcp_agent/resources/examples/mcp/elicitations/elicitation_game_server.py +164 -0
- mcp_agent/resources/examples/mcp/elicitations/fastagent.config.yaml +35 -0
- mcp_agent/resources/examples/mcp/elicitations/fastagent.secrets.yaml.example +17 -0
- mcp_agent/resources/examples/mcp/elicitations/forms_demo.py +111 -0
- mcp_agent/resources/examples/mcp/elicitations/game_character.py +65 -0
- mcp_agent/resources/examples/mcp/elicitations/game_character_handler.py +256 -0
- mcp_agent/resources/examples/{prompting/agent.py → mcp/elicitations/tool_call.py} +4 -5
- mcp_agent/resources/examples/mcp/state-transfer/agent_two.py +1 -1
- mcp_agent/resources/examples/mcp/state-transfer/fastagent.config.yaml +1 -1
- mcp_agent/resources/examples/mcp/state-transfer/fastagent.secrets.yaml.example +1 -0
- mcp_agent/resources/examples/workflows/evaluator.py +1 -1
- mcp_agent/resources/examples/workflows/graded_report.md +89 -0
- mcp_agent/resources/examples/workflows/orchestrator.py +7 -9
- mcp_agent/resources/examples/workflows/parallel.py +0 -2
- mcp_agent/resources/examples/workflows/short_story.md +13 -0
- mcp_agent/resources/examples/in_dev/agent_build.py +0 -84
- mcp_agent/resources/examples/in_dev/css-LICENSE.txt +0 -21
- mcp_agent/resources/examples/in_dev/slides.py +0 -110
- mcp_agent/resources/examples/internal/agent.py +0 -20
- mcp_agent/resources/examples/internal/fastagent.config.yaml +0 -66
- mcp_agent/resources/examples/internal/history_transfer.py +0 -35
- mcp_agent/resources/examples/internal/job.py +0 -84
- mcp_agent/resources/examples/internal/prompt_category.py +0 -21
- mcp_agent/resources/examples/internal/prompt_sizing.py +0 -51
- mcp_agent/resources/examples/internal/simple.txt +0 -2
- mcp_agent/resources/examples/internal/sizer.py +0 -20
- mcp_agent/resources/examples/internal/social.py +0 -67
- mcp_agent/resources/examples/prompting/__init__.py +0 -3
- mcp_agent/resources/examples/prompting/delimited_prompt.txt +0 -14
- mcp_agent/resources/examples/prompting/fastagent.config.yaml +0 -43
- mcp_agent/resources/examples/prompting/image_server.py +0 -52
- mcp_agent/resources/examples/prompting/prompt1.txt +0 -6
- mcp_agent/resources/examples/prompting/work_with_image.py +0 -19
- {fast_agent_mcp-0.2.36.dist-info → fast_agent_mcp-0.2.38.dist-info}/WHEEL +0 -0
- {fast_agent_mcp-0.2.36.dist-info → fast_agent_mcp-0.2.38.dist-info}/entry_points.txt +0 -0
|
@@ -40,7 +40,7 @@ fast = FastAgent("Evaluator-Optimizer")
|
|
|
40
40
|
Summarize your evaluation as a structured response with:
|
|
41
41
|
- Overall quality rating.
|
|
42
42
|
- Specific feedback and areas for improvement.""",
|
|
43
|
-
model="gpt-
|
|
43
|
+
model="gpt-4.1",
|
|
44
44
|
)
|
|
45
45
|
# Define the evaluator-optimizer workflow
|
|
46
46
|
@fast.evaluator_optimizer(
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Graded Report: "The Kittens Castle Adventure"
|
|
2
|
+
|
|
3
|
+
## Proofreading Feedback
|
|
4
|
+
|
|
5
|
+
### Spelling Errors
|
|
6
|
+
1. "Adventuer" → "Adventure"
|
|
7
|
+
2. "lil" → "little"
|
|
8
|
+
3. "name" → "named"
|
|
9
|
+
4. "threw" → "through"
|
|
10
|
+
5. "mystirus" → "mysterious"
|
|
11
|
+
6. "forrest" → "forest"
|
|
12
|
+
7. "was" → "were"
|
|
13
|
+
8. "an" → "and"
|
|
14
|
+
9. "Suddenlee" → "Suddenly"
|
|
15
|
+
10. "sawd" → "saw"
|
|
16
|
+
11. "somthing" → "something"
|
|
17
|
+
12. "chese" → "cheese"
|
|
18
|
+
13. "windos" → "windows"
|
|
19
|
+
14. "turrits" → "turrets"
|
|
20
|
+
15. "tuch" → "touch"
|
|
21
|
+
16. "clowds" → "clouds"
|
|
22
|
+
17. "doars" → "doors"
|
|
23
|
+
18. "enuff" → "enough"
|
|
24
|
+
19. "elefant" → "elephant"
|
|
25
|
+
20. "sed" → "said"
|
|
26
|
+
21. "tale" → "tail"
|
|
27
|
+
22. "poofy" → "puffy"
|
|
28
|
+
23. "fowned" → "found"
|
|
29
|
+
24. "meowed" → added missing period
|
|
30
|
+
25. "smallist" → "smallest"
|
|
31
|
+
26. "rond" → "round"
|
|
32
|
+
27. "climed" → "climbed"
|
|
33
|
+
28. "slip-slidin" → "slip-sliding"
|
|
34
|
+
29. "smoth" → "smooth"
|
|
35
|
+
30. "surfase" → "surface"
|
|
36
|
+
31. "ful" → "full"
|
|
37
|
+
32. "dangling" → added missing period
|
|
38
|
+
33. "JINGEL" → "jingle"
|
|
39
|
+
34. "paradyse" → "paradise"
|
|
40
|
+
35. "figur" → "figure"
|
|
41
|
+
36. "gaurd" → "guard"
|
|
42
|
+
37. "sumthing" → "something"
|
|
43
|
+
38. "mor" → "more"
|
|
44
|
+
39. "hudeld" → "huddled"
|
|
45
|
+
40. "togethar" → "together"
|
|
46
|
+
41. "there" → "their"
|
|
47
|
+
42. "happan" → "happen"
|
|
48
|
+
43. "amazeing" → "amazing"
|
|
49
|
+
|
|
50
|
+
### Grammar and Syntax Errors
|
|
51
|
+
1. Inconsistent verb tenses throughout the story
|
|
52
|
+
2. Improper use of articles (a/an)
|
|
53
|
+
3. Missing punctuation
|
|
54
|
+
4. Lack of subject-verb agreement
|
|
55
|
+
5. Incorrect capitalization
|
|
56
|
+
|
|
57
|
+
### Style and Formatting Recommendations
|
|
58
|
+
1. Use standard capitalization for proper nouns
|
|
59
|
+
2. Maintain consistent verb tense (past tense recommended)
|
|
60
|
+
3. Use proper punctuation
|
|
61
|
+
4. Avoid excessive use of exclamation points
|
|
62
|
+
5. Use standard spelling for all words
|
|
63
|
+
|
|
64
|
+
## Factuality and Logical Consistency
|
|
65
|
+
- The story is a fictional narrative about three kittens, so traditional factual constraints do not strictly apply
|
|
66
|
+
- The narrative maintains internal logical consistency
|
|
67
|
+
- The cliffhanger ending leaves room for imagination
|
|
68
|
+
|
|
69
|
+
## Style Adherence
|
|
70
|
+
### APA Formatting Guidelines
|
|
71
|
+
- Title should be centered and in title case
|
|
72
|
+
- Use 12-point Times New Roman font (not applicable in markdown)
|
|
73
|
+
- Double-spacing recommended (not applicable in markdown)
|
|
74
|
+
- 1-inch margins (not applicable in markdown)
|
|
75
|
+
|
|
76
|
+
### Recommendations for Improvement
|
|
77
|
+
1. Proofread and correct all spelling errors
|
|
78
|
+
2. Maintain consistent grammar and syntax
|
|
79
|
+
3. Use standard English spelling
|
|
80
|
+
4. Add more descriptive language
|
|
81
|
+
5. Develop a more structured narrative arc
|
|
82
|
+
|
|
83
|
+
## Overall Assessment
|
|
84
|
+
**Writing Quality**: Needs Significant Improvement
|
|
85
|
+
**Creativity**: Excellent
|
|
86
|
+
**Potential**: High
|
|
87
|
+
|
|
88
|
+
### Suggested Revision
|
|
89
|
+
Revise the text to correct spelling, grammar, and syntax while preserving the original creative narrative and imaginative elements.
|
|
@@ -13,7 +13,7 @@ fast = FastAgent("Orchestrator-Workers")
|
|
|
13
13
|
@fast.agent(
|
|
14
14
|
"author",
|
|
15
15
|
instruction="""You are to role play a poorly skilled writer,
|
|
16
|
-
who makes frequent grammar,
|
|
16
|
+
who makes frequent grammar, punctuation and spelling errors. You enjoy
|
|
17
17
|
writing short stories, but the narrative doesn't always make sense""",
|
|
18
18
|
servers=["filesystem"],
|
|
19
19
|
)
|
|
@@ -25,7 +25,7 @@ fast = FastAgent("Orchestrator-Workers")
|
|
|
25
25
|
the closest match to a user's request, make the appropriate tool calls,
|
|
26
26
|
and return the URI and CONTENTS of the closest match.""",
|
|
27
27
|
servers=["fetch", "filesystem"],
|
|
28
|
-
model="gpt-
|
|
28
|
+
model="gpt-4.1",
|
|
29
29
|
)
|
|
30
30
|
@fast.agent(
|
|
31
31
|
name="writer",
|
|
@@ -40,19 +40,17 @@ fast = FastAgent("Orchestrator-Workers")
|
|
|
40
40
|
Identify any awkward phrasing or structural issues that could improve clarity.
|
|
41
41
|
Provide detailed feedback on corrections.""",
|
|
42
42
|
servers=["fetch"],
|
|
43
|
-
model="gpt-
|
|
43
|
+
model="gpt-4.1",
|
|
44
44
|
)
|
|
45
45
|
# Define the orchestrator to coordinate the other agents
|
|
46
46
|
@fast.orchestrator(
|
|
47
|
-
name="orchestrate",
|
|
48
|
-
agents=["finder", "writer", "proofreader"],
|
|
49
|
-
plan_type="full",
|
|
47
|
+
name="orchestrate", agents=["finder", "writer", "proofreader"], plan_type="full", model="sonnet"
|
|
50
48
|
)
|
|
51
49
|
async def main() -> None:
|
|
52
50
|
async with fast.run() as agent:
|
|
53
|
-
await agent.author(
|
|
54
|
-
|
|
55
|
-
)
|
|
51
|
+
# await agent.author(
|
|
52
|
+
# "write a 250 word short story about kittens discovering a castle, and save it to short_story.md"
|
|
53
|
+
# )
|
|
56
54
|
|
|
57
55
|
# The orchestrator can be used just like any other agent
|
|
58
56
|
task = """Load the student's short story from short_story.md,
|
|
@@ -25,7 +25,6 @@ fast = FastAgent(
|
|
|
25
25
|
instruction="""Verify the factual consistency within the story. Identify any contradictions,
|
|
26
26
|
logical inconsistencies, or inaccuracies in the plot, character actions, or setting.
|
|
27
27
|
Highlight potential issues with reasoning or coherence.""",
|
|
28
|
-
model="gpt-4.1-mini",
|
|
29
28
|
)
|
|
30
29
|
@fast.agent(
|
|
31
30
|
name="style_enforcer",
|
|
@@ -40,7 +39,6 @@ fast = FastAgent(
|
|
|
40
39
|
into a structured report. Summarize key issues and categorize them by type.
|
|
41
40
|
Provide actionable recommendations for improving the story,
|
|
42
41
|
and give an overall grade based on the feedback.""",
|
|
43
|
-
model="o3-mini.low",
|
|
44
42
|
)
|
|
45
43
|
@fast.parallel(
|
|
46
44
|
fan_out=["proofreader", "fact_checker", "style_enforcer"],
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
The Kittens Castle Adventuer
|
|
2
|
+
|
|
3
|
+
One sunny day, three lil kittens name Whiskers, Socks, and Mittens was walkin threw a mystirus forrest. They hadnt never seen such a big forrest before! The trees was tall an spooky, an the ground was coverd in moss an stikks.
|
|
4
|
+
|
|
5
|
+
Suddenlee, thru the trees, they sawd somthing HUUUUGE! It was a castell, but not just eny castell. This castell was made of sparkling chese an glittery windos. The turrits was so high they tuch the clowds, an the doars was big enuff for a elefant to walk threw!
|
|
6
|
+
|
|
7
|
+
"Lookk!" sed Whiskers, his tale all poofy wit exsitement. "We fowned a castell!" Socks meowed loudly an jumped up an down. Mittens, who was the smallist kitten, just stared wit her big rond eyes.
|
|
8
|
+
|
|
9
|
+
They climed up the cheesy walls, slip-slidin on the smoth surfase. Inside, they discoverd rooms ful of soft pillows an dangling strings an shiny things that went JINGEL when they tuch them. It was like a kitten paradyse!
|
|
10
|
+
|
|
11
|
+
But then, a big shadowy figur apeared... was it the castell gaurd? Or sumthing mor mystirus? The kittens hudeld togethar, there lil hearts beating fast. What wud happan next in there amazeing adventuer?
|
|
12
|
+
|
|
13
|
+
THE END??
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
This demonstrates creating multiple agents and an orchestrator to coordinate them.
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
import asyncio
|
|
6
|
-
|
|
7
|
-
from mcp_agent.core.fastagent import FastAgent
|
|
8
|
-
from mcp_agent.llm.augmented_llm import RequestParams
|
|
9
|
-
|
|
10
|
-
# Create the application
|
|
11
|
-
fast = FastAgent("Agent Builder")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
@fast.agent(
|
|
15
|
-
"agent_expert",
|
|
16
|
-
instruction="""
|
|
17
|
-
You design agent workflows, adhering to 'Building Effective Agents' (details to follow).
|
|
18
|
-
|
|
19
|
-
You provide concise specific guidance on design and composition. Prefer simple solutions,
|
|
20
|
-
and don't nest workflows more than one level deep.
|
|
21
|
-
|
|
22
|
-
Your objective is to produce a single '.py' agent in the style of the examples.
|
|
23
|
-
|
|
24
|
-
Keep the application simple, concentrationg on defining Agent instructions, MCP Servers and
|
|
25
|
-
appropriate use of Workflows.
|
|
26
|
-
|
|
27
|
-
The style of the program should be like the examples you have been shown, with a minimum of
|
|
28
|
-
additional code, using only very simple Python where absolutely necessary.
|
|
29
|
-
|
|
30
|
-
Concentrate on the quality of the Agent instructions and "warmup" prompts given to them.
|
|
31
|
-
|
|
32
|
-
Keep requirements minimal: focus on building the prompts and the best workflow. The program
|
|
33
|
-
is expected to be adjusted and refined later.
|
|
34
|
-
|
|
35
|
-
If you are unsure about how to proceed, request input from the Human.
|
|
36
|
-
|
|
37
|
-
Use the filesystem tools to save your completed fastagent program, in an appropriately named '.py' file.
|
|
38
|
-
|
|
39
|
-
""",
|
|
40
|
-
servers=["filesystem", "fetch"],
|
|
41
|
-
request_params=RequestParams(maxTokens=8192),
|
|
42
|
-
)
|
|
43
|
-
# Define worker agents
|
|
44
|
-
@fast.agent(
|
|
45
|
-
"requirements_capture",
|
|
46
|
-
instruction="""
|
|
47
|
-
You help the Human define their requirements for building Agent based systems.
|
|
48
|
-
|
|
49
|
-
Keep questions short, simple and minimal, always offering to complete the questioning
|
|
50
|
-
if desired. If uncertain about something, respond asking the 'agent_expert' for guidance.
|
|
51
|
-
|
|
52
|
-
Do not interrogate the Human, prefer to move the process on, as more details can be requested later
|
|
53
|
-
if needed. Remind the Human of this.
|
|
54
|
-
""",
|
|
55
|
-
human_input=True,
|
|
56
|
-
)
|
|
57
|
-
# Define the orchestrator to coordinate the other agents
|
|
58
|
-
@fast.orchestrator(
|
|
59
|
-
name="agent_builder",
|
|
60
|
-
agents=["agent_expert", "requirements_capture"],
|
|
61
|
-
model="sonnet",
|
|
62
|
-
plan_type="iterative",
|
|
63
|
-
request_params=RequestParams(maxTokens=8192),
|
|
64
|
-
plan_iterations=5,
|
|
65
|
-
)
|
|
66
|
-
async def main() -> None:
|
|
67
|
-
async with fast.run() as agent:
|
|
68
|
-
CODER_WARMUP = """
|
|
69
|
-
- Read this paper: https://www.anthropic.com/research/building-effective-agents" to understand how
|
|
70
|
-
and when to use different types of Agents and Workflow types.
|
|
71
|
-
|
|
72
|
-
- Read this README https://raw.githubusercontent.com/evalstate/fast-agent/refs/heads/main/README.md file
|
|
73
|
-
to see how to use "fast-agent" framework.
|
|
74
|
-
|
|
75
|
-
- Look at the 'fastagent.config.yaml' file to see the available and configured MCP Servers.
|
|
76
|
-
|
|
77
|
-
"""
|
|
78
|
-
await agent.agent_expert(CODER_WARMUP)
|
|
79
|
-
|
|
80
|
-
await agent.agent_builder()
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if __name__ == "__main__":
|
|
84
|
-
asyncio.run(main())
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021-2024 Paulo Cunha
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
4
|
-
|
|
5
|
-
from mcp_agent.core.fastagent import FastAgent
|
|
6
|
-
from mcp_agent.llm.augmented_llm import RequestParams
|
|
7
|
-
from mcp_agent.mcp.prompts.prompt_load import load_prompt_multipart
|
|
8
|
-
|
|
9
|
-
if TYPE_CHECKING:
|
|
10
|
-
from mcp_agent.mcp.prompt_message_multipart import PromptMessageMultipart
|
|
11
|
-
|
|
12
|
-
# Create the application
|
|
13
|
-
fast = FastAgent("Data Analysis (Roots)")
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# The sample data is under Database Contents License (DbCL) v1.0.
|
|
17
|
-
|
|
18
|
-
# Available here : https://www.kaggle.com/datasets/pavansubhasht/ibm-hr-analytics-attrition-dataset
|
|
19
|
-
|
|
20
|
-
# The CSS files are distributed under the MIT License from the excellent
|
|
21
|
-
# marpstyle project : https://github.com/cunhapaulo/marpstyle
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
@fast.agent(
|
|
25
|
-
name="slides",
|
|
26
|
-
servers=["filesystem"],
|
|
27
|
-
instruction="""
|
|
28
|
-
You produce compelling slide decks for impactful presentations. You usually try and keep the pack to between
|
|
29
|
-
8-12 slides, with key insights at the start, backed up with data, diagrams and analysis as available. You
|
|
30
|
-
are able to help direct colour, style and and questions for enhancing the presentation. Produced charts and
|
|
31
|
-
visualisations will be in the ./mount-point/ directory. You output MARP markdown files.
|
|
32
|
-
""",
|
|
33
|
-
request_params=RequestParams(maxTokens=8192),
|
|
34
|
-
)
|
|
35
|
-
@fast.agent(
|
|
36
|
-
name="data_analysis",
|
|
37
|
-
instruction="""
|
|
38
|
-
You have access to a Python 3.12 interpreter and you can use this to analyse and process data.
|
|
39
|
-
Common analysis packages such as Pandas, Seaborn and Matplotlib are already installed.
|
|
40
|
-
You can add further packages if needed.
|
|
41
|
-
Data files are accessible from the /mnt/data/ directory (this is the current working directory).
|
|
42
|
-
Visualisations should be saved as .png files in the current working directory.
|
|
43
|
-
""",
|
|
44
|
-
servers=["interpreter"],
|
|
45
|
-
request_params=RequestParams(maxTokens=8192),
|
|
46
|
-
)
|
|
47
|
-
@fast.orchestrator(
|
|
48
|
-
name="orchestrator",
|
|
49
|
-
plan_type="iterative",
|
|
50
|
-
agents=["slides", "data_analysis"],
|
|
51
|
-
)
|
|
52
|
-
async def main() -> None:
|
|
53
|
-
# Use the app's context manager
|
|
54
|
-
async with fast.run() as agent:
|
|
55
|
-
prompts: list[PromptMessageMultipart] = load_prompt_multipart(Path("slides.md"))
|
|
56
|
-
await agent.slides.apply_prompt_messages(prompts)
|
|
57
|
-
|
|
58
|
-
await agent.orchestrator.send(
|
|
59
|
-
"Produce a compelling presentation for the CSV data file in the /mnt/data/ directory."
|
|
60
|
-
"The slides agent will produce a presentation, make sure to consult it first for "
|
|
61
|
-
"colour scheme and formatting guidance. Make sure that any 'call-outs' have a distinct"
|
|
62
|
-
"background to ensure they stand out."
|
|
63
|
-
"Make sure the presentation is impactful, concise and visualises key insights in to the data"
|
|
64
|
-
" in a compelling way."
|
|
65
|
-
"The presentation is by the 'llmindset team' and produced in 'march 2025'."
|
|
66
|
-
"Produce it step-by-step; long responses without checking in are likely to exceed"
|
|
67
|
-
"maximum output token limits."
|
|
68
|
-
)
|
|
69
|
-
# colours: str = await agent.slides.send("Tell the Data Analysis agent what colour schemes and chart sizes you prefer for the presentation")
|
|
70
|
-
|
|
71
|
-
# analysis: str = await agent.data_analysis.send(
|
|
72
|
-
# "Examine the CSV file in /mnt/data, produce a detailed analysis of the data,"
|
|
73
|
-
# "and any patterns it contains. Visualise some of the key points, saving .png files to"
|
|
74
|
-
# "your current workig folder (/mnt/data). Respond with a summary of your findings, and a list"
|
|
75
|
-
# "of visualiations and their filenames ready to incorporate in to a slide deck. The presentation agent has"
|
|
76
|
-
# f"specified the following style guidelines for generated charts:\n {colours}"
|
|
77
|
-
# )
|
|
78
|
-
# await agent.slides.send(
|
|
79
|
-
# "Produce a MARP Presentation for the this analysis. You will find the visualisations in "
|
|
80
|
-
# f"in the ./mount-point/ folder. The analysis follows....\n{analysis}"
|
|
81
|
-
# )
|
|
82
|
-
|
|
83
|
-
await agent()
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if __name__ == "__main__":
|
|
87
|
-
asyncio.run(main())
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
############################################################################################################
|
|
91
|
-
# Example of evaluator/optimizer flow
|
|
92
|
-
############################################################################################################
|
|
93
|
-
# @fast.agent(
|
|
94
|
-
# "evaluator",
|
|
95
|
-
# """You are collaborating with a Data Analysis tool that has the capability to analyse data and produce visualisations.
|
|
96
|
-
# You must make sure that the tool has:
|
|
97
|
-
# - Considered the best way for a Human to interpret the data
|
|
98
|
-
# - Produced insightful visualasions.
|
|
99
|
-
# - Provided a high level summary report for the Human.
|
|
100
|
-
# - Has had its findings challenged, and justified
|
|
101
|
-
# """,
|
|
102
|
-
# request_params=RequestParams(maxTokens=8192),
|
|
103
|
-
# )
|
|
104
|
-
# @fast.evaluator_optimizer(
|
|
105
|
-
# "analysis_tool",
|
|
106
|
-
# generator="data_analysis",
|
|
107
|
-
# evaluator="evaluator",
|
|
108
|
-
# max_refinements=3,
|
|
109
|
-
# min_rating="EXCELLENT",
|
|
110
|
-
# )
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
|
|
3
|
-
from mcp_agent.core.fastagent import FastAgent
|
|
4
|
-
|
|
5
|
-
# Create the application
|
|
6
|
-
fast = FastAgent("FastAgent Example")
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# Define the agent
|
|
10
|
-
@fast.agent(servers=["category", "mcp_hfspace","mcp_webcam"])
|
|
11
|
-
#@fast.agent(name="test")
|
|
12
|
-
async def main() -> None:
|
|
13
|
-
# use the --model command line switch or agent arguments to change model
|
|
14
|
-
async with fast.run() as agent:
|
|
15
|
-
# await agent.prompt(agent_name="test")
|
|
16
|
-
await agent()
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if __name__ == "__main__":
|
|
20
|
-
asyncio.run(main())
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
default_model: sonnet
|
|
2
|
-
|
|
3
|
-
# on windows, adjust the mount point to be the full path e.g. x:/temp/data-analysis/mount-point:/mnt/data/
|
|
4
|
-
|
|
5
|
-
# logger:
|
|
6
|
-
# level: "debug"
|
|
7
|
-
# type: "console"
|
|
8
|
-
|
|
9
|
-
mcp:
|
|
10
|
-
servers:
|
|
11
|
-
interpreter:
|
|
12
|
-
command: "docker"
|
|
13
|
-
args:
|
|
14
|
-
[
|
|
15
|
-
"run",
|
|
16
|
-
"-i",
|
|
17
|
-
"--rm",
|
|
18
|
-
"--pull=always",
|
|
19
|
-
"-v",
|
|
20
|
-
"./mount-point:/mnt/data/",
|
|
21
|
-
"ghcr.io/evalstate/mcp-py-repl:latest",
|
|
22
|
-
]
|
|
23
|
-
roots:
|
|
24
|
-
- uri: "file://./mount-point/"
|
|
25
|
-
name: "test_data"
|
|
26
|
-
server_uri_alias: "file:///mnt/data/"
|
|
27
|
-
filesystem:
|
|
28
|
-
# On windows update the command and arguments to use `node` and the absolute path to the server.
|
|
29
|
-
# Use `npm i -g @modelcontextprotocol/server-filesystem` to install the server globally.
|
|
30
|
-
# Use `npm -g root` to find the global node_modules path.`
|
|
31
|
-
# command: "node"
|
|
32
|
-
# args: ["c:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js","."]
|
|
33
|
-
command: "npx"
|
|
34
|
-
args:
|
|
35
|
-
[
|
|
36
|
-
"-y",
|
|
37
|
-
"@modelcontextprotocol/server-filesystem",
|
|
38
|
-
"src/mcp_agent/resources/examples/data-analysis/mount-point/",
|
|
39
|
-
]
|
|
40
|
-
fetch:
|
|
41
|
-
command: "uvx"
|
|
42
|
-
args: ["mcp-server-fetch"]
|
|
43
|
-
brave:
|
|
44
|
-
# On windows replace the command and args line to use `node` and the absolute path to the server.
|
|
45
|
-
# Use `npm i -g @modelcontextprotocol/server-brave-search` to install the server globally.
|
|
46
|
-
# Use `npm -g root` to find the global node_modules path.`
|
|
47
|
-
# command: "node"
|
|
48
|
-
# args: ["c:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
|
|
49
|
-
command: "npx"
|
|
50
|
-
args: ["-y", "@modelcontextprotocol/server-brave-search"]
|
|
51
|
-
sizing_setup:
|
|
52
|
-
command: "uv"
|
|
53
|
-
args: ["run", "prompt_sizing1.py"]
|
|
54
|
-
|
|
55
|
-
category:
|
|
56
|
-
command: "prompt-server"
|
|
57
|
-
args: ["simple.txt"]
|
|
58
|
-
|
|
59
|
-
mcp_hfspace:
|
|
60
|
-
command: "npx"
|
|
61
|
-
args: ["@llmindset/mcp-hfspace"]
|
|
62
|
-
|
|
63
|
-
mcp_webcam:
|
|
64
|
-
command: "npx"
|
|
65
|
-
args: ["@llmindset/mcp-webcam"]
|
|
66
|
-
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import asyncio
|
|
2
|
-
|
|
3
|
-
from mcp_agent.core.fastagent import FastAgent
|
|
4
|
-
|
|
5
|
-
# Create the application
|
|
6
|
-
fast = FastAgent("FastAgent Example")
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# Define the agent
|
|
10
|
-
@fast.agent(name="haiku", model="haiku")
|
|
11
|
-
@fast.agent(name="openai", model="o3-mini.medium")
|
|
12
|
-
|
|
13
|
-
# @fast.agent(name="test")
|
|
14
|
-
async def main() -> None:
|
|
15
|
-
async with fast.run() as agent:
|
|
16
|
-
# Start an interactive session with "haiku"
|
|
17
|
-
await agent.prompt(agent_name="haiku")
|
|
18
|
-
# Transfer the message history top "openai"
|
|
19
|
-
await agent.openai.generate(agent.haiku.message_history)
|
|
20
|
-
# Continue the conversation
|
|
21
|
-
await agent.prompt(agent_name="openai") # Interactive shell
|
|
22
|
-
|
|
23
|
-
# result: str = await agent.send("foo")
|
|
24
|
-
# mcp_prompt: PromptMessage = PromptMessage(
|
|
25
|
-
# role="user", content=TextContent(type="text", text="How are you?")
|
|
26
|
-
# )
|
|
27
|
-
# result: str = agent.send(mcp_prompt)
|
|
28
|
-
# resource: ReadResourceResult = agent.openai.get_resource(
|
|
29
|
-
# "server_name", "resource://images/cat.png"
|
|
30
|
-
# )
|
|
31
|
-
# response: str = Prompt.user("What is in this image?", resource)
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
if __name__ == "__main__":
|
|
35
|
-
asyncio.run(main())
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
PMO Job Description Generator Agent
|
|
3
|
-
Purpose: Generate comprehensive PMO job descriptions using a multi-stage approach
|
|
4
|
-
for clarity, consistency and quality control
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
import asyncio
|
|
8
|
-
|
|
9
|
-
from mcp_agent.core.fastagent import FastAgent
|
|
10
|
-
|
|
11
|
-
# Create the application
|
|
12
|
-
fast = FastAgent("PMO Job Description Generator")
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
@fast.agent(
|
|
16
|
-
name="content_generator",
|
|
17
|
-
instruction="""You are a PMO job description expert. Generate job descriptions for PMO roles
|
|
18
|
-
following these guidelines:
|
|
19
|
-
- Focus on modern lean/agile and product-based approaches
|
|
20
|
-
- Emphasize practical experience and demonstrated results over formal requirements
|
|
21
|
-
- Ensure clear role differentiation with minimal overlap
|
|
22
|
-
- Format output in Markdown
|
|
23
|
-
- Context: Telecommunications industry in open organization valuing practical experience
|
|
24
|
-
|
|
25
|
-
Structure each job description with:
|
|
26
|
-
1. Role Title
|
|
27
|
-
2. Position Summary
|
|
28
|
-
3. Key Responsibilities
|
|
29
|
-
4. Required Experience
|
|
30
|
-
5. Desired Capabilities
|
|
31
|
-
""",
|
|
32
|
-
model="anthropic.claude-3-5-haiku-latest",
|
|
33
|
-
)
|
|
34
|
-
@fast.agent(
|
|
35
|
-
name="consistency_checker",
|
|
36
|
-
instruction="""Review PMO job descriptions for:
|
|
37
|
-
1. Alignment with lean/agile principles
|
|
38
|
-
2. Clear role differentiation
|
|
39
|
-
3. Progressive responsibility levels
|
|
40
|
-
4. Consistent formatting and structure
|
|
41
|
-
5. Telecommunications industry relevance
|
|
42
|
-
6. Emphasis on practical experience over formal requirements
|
|
43
|
-
|
|
44
|
-
Provide specific feedback for improvements.""",
|
|
45
|
-
model="gpt-4.1",
|
|
46
|
-
)
|
|
47
|
-
@fast.agent(
|
|
48
|
-
name="file_handler",
|
|
49
|
-
instruction="""Save the finalized job descriptions as individual Markdown files.
|
|
50
|
-
Use consistent naming like 'pmo_director.md', 'pmo_manager.md' etc.""",
|
|
51
|
-
servers=["filesystem"],
|
|
52
|
-
use_history=False,
|
|
53
|
-
)
|
|
54
|
-
@fast.evaluator_optimizer(
|
|
55
|
-
name="job_description_writer",
|
|
56
|
-
generator="content_generator",
|
|
57
|
-
evaluator="consistency_checker",
|
|
58
|
-
min_rating="EXCELLENT",
|
|
59
|
-
max_refinements=2,
|
|
60
|
-
)
|
|
61
|
-
async def main() -> None:
|
|
62
|
-
async with fast.run() as agent:
|
|
63
|
-
roles = [
|
|
64
|
-
"PMO Director",
|
|
65
|
-
"Portfolio Manager",
|
|
66
|
-
"Senior Program Manager",
|
|
67
|
-
"Project Manager",
|
|
68
|
-
"PMO Analyst",
|
|
69
|
-
"Project Coordinator",
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
# Pre-initialize the file_handler to establish a persistent connection
|
|
73
|
-
await agent.file_handler("Test connection to filesystem")
|
|
74
|
-
|
|
75
|
-
for role in roles:
|
|
76
|
-
# Generate and refine job description
|
|
77
|
-
description = await agent.job_description_writer(
|
|
78
|
-
f"Create job description for {role} role"
|
|
79
|
-
)
|
|
80
|
-
await agent.file_handler(f"Save this job description: {description}")
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
if __name__ == "__main__":
|
|
84
|
-
asyncio.run(main())
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from mcp.server.fastmcp import FastMCP
|
|
2
|
-
from mcp.server.fastmcp.prompts.base import AssistantMessage, UserMessage
|
|
3
|
-
|
|
4
|
-
mcp = FastMCP("MCP Root Tester")
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@mcp.prompt(name="category_prompt", description="set up the category protocol")
|
|
8
|
-
def category_prompt():
|
|
9
|
-
return [
|
|
10
|
-
UserMessage("Cat"),
|
|
11
|
-
AssistantMessage("animal"),
|
|
12
|
-
UserMessage("dog"),
|
|
13
|
-
AssistantMessage("animal"),
|
|
14
|
-
UserMessage("quartz"),
|
|
15
|
-
AssistantMessage("mineral"),
|
|
16
|
-
# UserMessage("the sun"),
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if __name__ == "__main__":
|
|
21
|
-
mcp.run()
|