fast-agent-mcp 0.2.35__py3-none-any.whl → 0.2.37__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.

Files changed (73) hide show
  1. {fast_agent_mcp-0.2.35.dist-info → fast_agent_mcp-0.2.37.dist-info}/METADATA +15 -12
  2. {fast_agent_mcp-0.2.35.dist-info → fast_agent_mcp-0.2.37.dist-info}/RECORD +55 -56
  3. {fast_agent_mcp-0.2.35.dist-info → fast_agent_mcp-0.2.37.dist-info}/licenses/LICENSE +1 -1
  4. mcp_agent/agents/base_agent.py +2 -2
  5. mcp_agent/agents/workflow/router_agent.py +1 -1
  6. mcp_agent/cli/commands/quickstart.py +59 -5
  7. mcp_agent/config.py +10 -0
  8. mcp_agent/context.py +1 -4
  9. mcp_agent/core/agent_types.py +7 -6
  10. mcp_agent/core/direct_decorators.py +14 -0
  11. mcp_agent/core/direct_factory.py +1 -0
  12. mcp_agent/core/enhanced_prompt.py +73 -13
  13. mcp_agent/core/fastagent.py +23 -2
  14. mcp_agent/core/interactive_prompt.py +118 -8
  15. mcp_agent/human_input/elicitation_form.py +723 -0
  16. mcp_agent/human_input/elicitation_forms.py +59 -0
  17. mcp_agent/human_input/elicitation_handler.py +88 -0
  18. mcp_agent/human_input/elicitation_state.py +34 -0
  19. mcp_agent/llm/augmented_llm.py +31 -0
  20. mcp_agent/llm/providers/augmented_llm_anthropic.py +11 -23
  21. mcp_agent/llm/providers/augmented_llm_azure.py +4 -4
  22. mcp_agent/llm/providers/augmented_llm_google_native.py +4 -2
  23. mcp_agent/llm/providers/augmented_llm_openai.py +195 -12
  24. mcp_agent/llm/providers/multipart_converter_openai.py +4 -3
  25. mcp_agent/mcp/elicitation_factory.py +84 -0
  26. mcp_agent/mcp/elicitation_handlers.py +155 -0
  27. mcp_agent/mcp/helpers/content_helpers.py +27 -0
  28. mcp_agent/mcp/helpers/server_config_helpers.py +10 -8
  29. mcp_agent/mcp/interfaces.py +1 -1
  30. mcp_agent/mcp/mcp_agent_client_session.py +44 -1
  31. mcp_agent/mcp/mcp_aggregator.py +56 -11
  32. mcp_agent/mcp/mcp_connection_manager.py +30 -18
  33. mcp_agent/mcp_server/agent_server.py +2 -0
  34. mcp_agent/mcp_server_registry.py +16 -8
  35. mcp_agent/resources/examples/data-analysis/analysis.py +1 -2
  36. mcp_agent/resources/examples/mcp/elicitations/README.md +157 -0
  37. mcp_agent/resources/examples/mcp/elicitations/elicitation_account_server.py +88 -0
  38. mcp_agent/resources/examples/mcp/elicitations/elicitation_forms_server.py +232 -0
  39. mcp_agent/resources/examples/mcp/elicitations/elicitation_game_server.py +164 -0
  40. mcp_agent/resources/examples/mcp/elicitations/fastagent.config.yaml +35 -0
  41. mcp_agent/resources/examples/mcp/elicitations/fastagent.secrets.yaml.example +17 -0
  42. mcp_agent/resources/examples/mcp/elicitations/forms_demo.py +111 -0
  43. mcp_agent/resources/examples/mcp/elicitations/game_character.py +65 -0
  44. mcp_agent/resources/examples/mcp/elicitations/game_character_handler.py +256 -0
  45. mcp_agent/resources/examples/{prompting/agent.py → mcp/elicitations/tool_call.py} +4 -5
  46. mcp_agent/resources/examples/mcp/state-transfer/agent_two.py +1 -1
  47. mcp_agent/resources/examples/mcp/state-transfer/fastagent.config.yaml +1 -1
  48. mcp_agent/resources/examples/mcp/state-transfer/fastagent.secrets.yaml.example +1 -0
  49. mcp_agent/resources/examples/workflows/evaluator.py +1 -1
  50. mcp_agent/resources/examples/workflows/graded_report.md +89 -0
  51. mcp_agent/resources/examples/workflows/orchestrator.py +7 -9
  52. mcp_agent/resources/examples/workflows/parallel.py +0 -2
  53. mcp_agent/resources/examples/workflows/short_story.md +13 -0
  54. mcp_agent/resources/examples/in_dev/agent_build.py +0 -84
  55. mcp_agent/resources/examples/in_dev/css-LICENSE.txt +0 -21
  56. mcp_agent/resources/examples/in_dev/slides.py +0 -110
  57. mcp_agent/resources/examples/internal/agent.py +0 -20
  58. mcp_agent/resources/examples/internal/fastagent.config.yaml +0 -66
  59. mcp_agent/resources/examples/internal/history_transfer.py +0 -35
  60. mcp_agent/resources/examples/internal/job.py +0 -84
  61. mcp_agent/resources/examples/internal/prompt_category.py +0 -21
  62. mcp_agent/resources/examples/internal/prompt_sizing.py +0 -51
  63. mcp_agent/resources/examples/internal/simple.txt +0 -2
  64. mcp_agent/resources/examples/internal/sizer.py +0 -20
  65. mcp_agent/resources/examples/internal/social.py +0 -67
  66. mcp_agent/resources/examples/prompting/__init__.py +0 -3
  67. mcp_agent/resources/examples/prompting/delimited_prompt.txt +0 -14
  68. mcp_agent/resources/examples/prompting/fastagent.config.yaml +0 -43
  69. mcp_agent/resources/examples/prompting/image_server.py +0 -52
  70. mcp_agent/resources/examples/prompting/prompt1.txt +0 -6
  71. mcp_agent/resources/examples/prompting/work_with_image.py +0 -19
  72. {fast_agent_mcp-0.2.35.dist-info → fast_agent_mcp-0.2.37.dist-info}/WHEEL +0 -0
  73. {fast_agent_mcp-0.2.35.dist-info → fast_agent_mcp-0.2.37.dist-info}/entry_points.txt +0 -0
@@ -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()
@@ -1,51 +0,0 @@
1
- from mcp.server.fastmcp import FastMCP
2
- from mcp.server.fastmcp.prompts.base import AssistantMessage, UserMessage
3
- from pydantic import Field
4
-
5
- mcp = FastMCP("MCP Prompt Tester")
6
-
7
-
8
- @mcp.prompt(name="sizing_prompt", description="set up the sizing protocol")
9
- def sizing_prompt():
10
- return [
11
- UserMessage("What is the size of the moon?"),
12
- AssistantMessage("OBJECT: MOON\nSIZE: 3,474.8\nUNITS: KM\nTYPE: MINERAL"),
13
- UserMessage("What is the size of the Earth?"),
14
- AssistantMessage("OBJECT: EARTH\nSIZE: 12,742\nUNITS: KM\nTYPE: MINERAL"),
15
- UserMessage("A tiger"),
16
- AssistantMessage("OBJECT: TIGER\nSIZE: 1.2\nUNITS: M\nTYPE: ANIMAL"),
17
- UserMessage("Domestic Cat"),
18
- ]
19
-
20
-
21
- @mcp.prompt(
22
- name="sizing_prompt_units",
23
- description="set up the sizing protocol with metric or imperial units",
24
- )
25
- def sizing_prompt_units(
26
- metric: bool = Field(description="Set to True for Metric, False for Imperial", default=True),
27
- ):
28
- if metric:
29
- return [
30
- UserMessage("What is the size of the moon?"),
31
- AssistantMessage("OBJECT: MOON\nSIZE: 3,474.8\nUNITS: KM\nTYPE: MINERAL"),
32
- UserMessage("What is the size of the Earth?"),
33
- AssistantMessage("OBJECT: EARTH\nSIZE: 12,742\nUNITS: KM\nTYPE: MINERAL"),
34
- UserMessage("A tiger"),
35
- AssistantMessage("OBJECT: TIGER\nSIZE: 1.2\nUNITS: M\nTYPE: ANIMAL"),
36
- UserMessage("Domestic Cat"),
37
- ]
38
- else:
39
- return [
40
- UserMessage("What is the size of the moon?"),
41
- AssistantMessage("OBJECT: MOON\nSIZE: 2,159.1\nUNITS: MI\nTYPE: MINERAL"),
42
- UserMessage("What is the size of the Earth?"),
43
- AssistantMessage("OBJECT: EARTH\nSIZE: 7,918\nUNITS: MI\nTYPE: MINERAL"),
44
- UserMessage("A tiger"),
45
- AssistantMessage("OBJECT: TIGER\nSIZE: 3.9\nUNITS: FT\nTYPE: ANIMAL"),
46
- UserMessage("Domestic Cat"),
47
- ]
48
-
49
-
50
- if __name__ == "__main__":
51
- mcp.run()
@@ -1,2 +0,0 @@
1
- hello, world
2
-
@@ -1,20 +0,0 @@
1
- import asyncio
2
-
3
- from mcp_agent.core.fastagent import FastAgent
4
-
5
- fast = FastAgent("Sizer Prompt Test")
6
-
7
-
8
- @fast.agent(
9
- "sizer",
10
- "given an object return its size",
11
- servers=["sizer", "category"],
12
- use_history=True,
13
- )
14
- async def main() -> None:
15
- async with fast.run() as agent:
16
- await agent()
17
-
18
-
19
- if __name__ == "__main__":
20
- asyncio.run(main())
@@ -1,67 +0,0 @@
1
- import asyncio
2
-
3
- from mcp_agent.core.fastagent import FastAgent
4
-
5
- # Create the application
6
- fast = FastAgent("Social Media Manager")
7
-
8
-
9
- @fast.agent(
10
- "url_fetcher",
11
- "Given a URL, provide a complete and comprehensive summary",
12
- servers=["fetch"],
13
- )
14
- @fast.agent(
15
- "post_author",
16
- """
17
- Write a 280 character social media post for any given text.
18
- Respond only with the post, never use hashtags.
19
- """,
20
- )
21
- @fast.agent("translate_fr", "Translate the text to French.")
22
- @fast.agent("translate_de", "Translate the text to German.")
23
- @fast.agent(
24
- "review",
25
- """
26
- Cleanly format the original content and translations for review by a Social Media manager.
27
- Highlight any cultural sensitivities.
28
- """,
29
- model="sonnet",
30
- )
31
- @fast.parallel(
32
- "translated_plan",
33
- fan_out=["translate_fr", "translate_de"],
34
- )
35
- @fast.agent(
36
- "human_review_and_post",
37
- """
38
- - You can send a social media post by saving it to a file name 'post-<lang>.md'.
39
- - NEVER POST TO SOCIAL MEDIA UNLESS THE HUMAN HAS REVIEWED AND APPROVED.
40
-
41
- Present the Social Media report to the Human, and then provide direct actionable questions to assist
42
- the Human in posting the content.
43
-
44
- You are being connected to a Human now, the first message you receive will be a
45
- Social Media report ready to review with the Human.
46
-
47
- """,
48
- human_input=True,
49
- servers=["filesystem"],
50
- )
51
- @fast.chain(
52
- "post_writer",
53
- sequence=[
54
- "url_fetcher",
55
- "post_author",
56
- "translated_plan",
57
- "human_review_and_post",
58
- ],
59
- )
60
- async def main() -> None:
61
- async with fast.run() as agent:
62
- # using chain workflow
63
- await agent.post_writer.prompt()
64
-
65
-
66
- if __name__ == "__main__":
67
- asyncio.run(main())
@@ -1,3 +0,0 @@
1
- """
2
- Prompting examples package for MCP Agent.
3
- """
@@ -1,14 +0,0 @@
1
- ---USER
2
- I want to learn about {{topic}}.
3
-
4
- Can you tell me about it in detail?
5
-
6
- ---ASSISTANT
7
- I'd be happy to tell you about {{topic}}!
8
-
9
- Here are some key facts about {{topic}}:
10
- 1. It's very interesting
11
- 2. It has a rich history
12
- 3. Many people study it
13
-
14
- Would you like me to elaborate on any specific aspect?
@@ -1,43 +0,0 @@
1
- # FastAgent Configuration File
2
-
3
- # Default Model Configuration:
4
- #
5
- # Takes format:
6
- # <provider>.<model_string>.<reasoning_effort?> (e.g. anthropic.claude-3-5-sonnet-20241022 or openai.o3-mini.low)
7
- # Accepts aliases for Anthropic Models: haiku, haiku3, sonnet, sonnet35, opus, opus3
8
- # and OpenAI Models: gpt-4.1-mini, gpt-4.1, o1, o1-mini, o3-mini
9
- #
10
- # If not specified, defaults to "haiku".
11
- # Can be overriden with a command line switch --model=<model>, or within the Agent constructor.
12
-
13
- default_model: haiku
14
-
15
- # Logging and Console Configuration:
16
- logger:
17
- # level: "debug" | "info" | "warning" | "error"
18
- # type: "none" | "console" | "file" | "http"
19
- # path: "/path/to/logfile.jsonl"
20
- type: file
21
- level: error
22
- # Switch the progress display on or off
23
- progress_display: true
24
-
25
- # Show chat User/Assistant messages on the console
26
- show_chat: true
27
- # Show tool calls on the console
28
- show_tools: true
29
- # Truncate long tool responses on the console
30
- truncate_tools: true
31
-
32
- # MCP Servers
33
- mcp:
34
- servers:
35
- prompts:
36
- command: "prompt-server"
37
- args: ["sizing.md", "resource.md", "resource-exe.md", "pdf_prompt.md"]
38
- hfspace:
39
- command: "npx"
40
- args: ["@llmindset/mcp-hfspace"]
41
- image:
42
- command: "uv"
43
- args: ["run", "image_server.py"]