fast-agent-mcp 0.2.36__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 (64) hide show
  1. {fast_agent_mcp-0.2.36.dist-info → fast_agent_mcp-0.2.37.dist-info}/METADATA +10 -7
  2. {fast_agent_mcp-0.2.36.dist-info → fast_agent_mcp-0.2.37.dist-info}/RECORD +46 -47
  3. {fast_agent_mcp-0.2.36.dist-info → fast_agent_mcp-0.2.37.dist-info}/licenses/LICENSE +1 -1
  4. mcp_agent/cli/commands/quickstart.py +59 -5
  5. mcp_agent/config.py +10 -0
  6. mcp_agent/context.py +1 -4
  7. mcp_agent/core/agent_types.py +7 -6
  8. mcp_agent/core/direct_decorators.py +14 -0
  9. mcp_agent/core/direct_factory.py +1 -0
  10. mcp_agent/core/fastagent.py +23 -2
  11. mcp_agent/human_input/elicitation_form.py +723 -0
  12. mcp_agent/human_input/elicitation_forms.py +59 -0
  13. mcp_agent/human_input/elicitation_handler.py +88 -0
  14. mcp_agent/human_input/elicitation_state.py +34 -0
  15. mcp_agent/llm/providers/augmented_llm_google_native.py +4 -2
  16. mcp_agent/llm/providers/augmented_llm_openai.py +1 -1
  17. mcp_agent/mcp/elicitation_factory.py +84 -0
  18. mcp_agent/mcp/elicitation_handlers.py +155 -0
  19. mcp_agent/mcp/helpers/content_helpers.py +27 -0
  20. mcp_agent/mcp/helpers/server_config_helpers.py +10 -8
  21. mcp_agent/mcp/mcp_agent_client_session.py +44 -1
  22. mcp_agent/mcp/mcp_aggregator.py +56 -11
  23. mcp_agent/mcp/mcp_connection_manager.py +30 -18
  24. mcp_agent/mcp_server/agent_server.py +2 -0
  25. mcp_agent/mcp_server_registry.py +16 -8
  26. mcp_agent/resources/examples/data-analysis/analysis.py +1 -2
  27. mcp_agent/resources/examples/mcp/elicitations/README.md +157 -0
  28. mcp_agent/resources/examples/mcp/elicitations/elicitation_account_server.py +88 -0
  29. mcp_agent/resources/examples/mcp/elicitations/elicitation_forms_server.py +232 -0
  30. mcp_agent/resources/examples/mcp/elicitations/elicitation_game_server.py +164 -0
  31. mcp_agent/resources/examples/mcp/elicitations/fastagent.config.yaml +35 -0
  32. mcp_agent/resources/examples/mcp/elicitations/fastagent.secrets.yaml.example +17 -0
  33. mcp_agent/resources/examples/mcp/elicitations/forms_demo.py +111 -0
  34. mcp_agent/resources/examples/mcp/elicitations/game_character.py +65 -0
  35. mcp_agent/resources/examples/mcp/elicitations/game_character_handler.py +256 -0
  36. mcp_agent/resources/examples/{prompting/agent.py → mcp/elicitations/tool_call.py} +4 -5
  37. mcp_agent/resources/examples/mcp/state-transfer/agent_two.py +1 -1
  38. mcp_agent/resources/examples/mcp/state-transfer/fastagent.config.yaml +1 -1
  39. mcp_agent/resources/examples/mcp/state-transfer/fastagent.secrets.yaml.example +1 -0
  40. mcp_agent/resources/examples/workflows/evaluator.py +1 -1
  41. mcp_agent/resources/examples/workflows/graded_report.md +89 -0
  42. mcp_agent/resources/examples/workflows/orchestrator.py +7 -9
  43. mcp_agent/resources/examples/workflows/parallel.py +0 -2
  44. mcp_agent/resources/examples/workflows/short_story.md +13 -0
  45. mcp_agent/resources/examples/in_dev/agent_build.py +0 -84
  46. mcp_agent/resources/examples/in_dev/css-LICENSE.txt +0 -21
  47. mcp_agent/resources/examples/in_dev/slides.py +0 -110
  48. mcp_agent/resources/examples/internal/agent.py +0 -20
  49. mcp_agent/resources/examples/internal/fastagent.config.yaml +0 -66
  50. mcp_agent/resources/examples/internal/history_transfer.py +0 -35
  51. mcp_agent/resources/examples/internal/job.py +0 -84
  52. mcp_agent/resources/examples/internal/prompt_category.py +0 -21
  53. mcp_agent/resources/examples/internal/prompt_sizing.py +0 -51
  54. mcp_agent/resources/examples/internal/simple.txt +0 -2
  55. mcp_agent/resources/examples/internal/sizer.py +0 -20
  56. mcp_agent/resources/examples/internal/social.py +0 -67
  57. mcp_agent/resources/examples/prompting/__init__.py +0 -3
  58. mcp_agent/resources/examples/prompting/delimited_prompt.txt +0 -14
  59. mcp_agent/resources/examples/prompting/fastagent.config.yaml +0 -43
  60. mcp_agent/resources/examples/prompting/image_server.py +0 -52
  61. mcp_agent/resources/examples/prompting/prompt1.txt +0 -6
  62. mcp_agent/resources/examples/prompting/work_with_image.py +0 -19
  63. {fast_agent_mcp-0.2.36.dist-info → fast_agent_mcp-0.2.37.dist-info}/WHEEL +0 -0
  64. {fast_agent_mcp-0.2.36.dist-info → fast_agent_mcp-0.2.37.dist-info}/entry_points.txt +0 -0
@@ -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"]
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Simple MCP server that responds to tool calls with text and image content.
4
- """
5
-
6
- import logging
7
- from pathlib import Path
8
-
9
- from mcp.server.fastmcp import Context, FastMCP, Image
10
- from mcp.types import ImageContent, TextContent
11
-
12
- # Configure logging
13
- logging.basicConfig(level=logging.INFO)
14
- logger = logging.getLogger(__name__)
15
-
16
- # Create the FastMCP server
17
- app = FastMCP(name="ImageToolServer", debug=True)
18
-
19
-
20
- @app.tool(name="get_image", description="Returns an image with a descriptive text")
21
- async def get_image(
22
- image_name: str = "default", ctx: Context = None
23
- ) -> list[TextContent | ImageContent]:
24
- """
25
- Returns an image file along with a descriptive text.
26
-
27
- Args:
28
- image_name: Name of the image to return (default just returns image.jpg)
29
-
30
- Returns:
31
- A list containing a text message and the requested image
32
- """
33
- try:
34
- # Read the image file and convert to base64
35
- # Create the response with text and image
36
- return [
37
- TextContent(type="text", text="Here's your image:"),
38
- Image(path="image.jpg").to_image_content(),
39
- ]
40
- except Exception as e:
41
- logger.exception(f"Error processing image: {e}")
42
- return [TextContent(type="text", text=f"Error processing image: {str(e)}")]
43
-
44
-
45
- if __name__ == "__main__":
46
- # Check if the default image exists
47
- if not Path("image.jpg").exists():
48
- logger.warning("Default image file 'image.jpg' not found in the current directory")
49
- logger.warning("Please add an image file named 'image.jpg' to the current directory")
50
-
51
- # Run the server using stdio transport
52
- app.run(transport="stdio")
@@ -1,6 +0,0 @@
1
- Hello, World.
2
-
3
- This is {{blah}} foo
4
-
5
- This is {{terrible}} etc.
6
-
@@ -1,19 +0,0 @@
1
- import asyncio
2
- from pathlib import Path
3
-
4
- from mcp_agent.core.fastagent import FastAgent
5
- from mcp_agent.core.prompt import Prompt
6
-
7
- # Create the application
8
- fast = FastAgent("FastAgent Example")
9
-
10
-
11
- # Define the agent
12
- @fast.agent("agent", instruction="You are a helpful AI Agent", servers=["prompts"])
13
- async def main() -> None:
14
- async with fast.run() as agent:
15
- await agent.agent.generate([Prompt.user("What's in this image?", Path("image.png"))])
16
-
17
-
18
- if __name__ == "__main__":
19
- asyncio.run(main())