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
|
@@ -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,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,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,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())
|
|
File without changes
|
|
File without changes
|