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.
- {fast_agent_mcp-0.2.35.dist-info → fast_agent_mcp-0.2.37.dist-info}/METADATA +15 -12
- {fast_agent_mcp-0.2.35.dist-info → fast_agent_mcp-0.2.37.dist-info}/RECORD +55 -56
- {fast_agent_mcp-0.2.35.dist-info → fast_agent_mcp-0.2.37.dist-info}/licenses/LICENSE +1 -1
- mcp_agent/agents/base_agent.py +2 -2
- mcp_agent/agents/workflow/router_agent.py +1 -1
- mcp_agent/cli/commands/quickstart.py +59 -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/enhanced_prompt.py +73 -13
- mcp_agent/core/fastagent.py +23 -2
- mcp_agent/core/interactive_prompt.py +118 -8
- 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/augmented_llm.py +31 -0
- mcp_agent/llm/providers/augmented_llm_anthropic.py +11 -23
- mcp_agent/llm/providers/augmented_llm_azure.py +4 -4
- mcp_agent/llm/providers/augmented_llm_google_native.py +4 -2
- mcp_agent/llm/providers/augmented_llm_openai.py +195 -12
- mcp_agent/llm/providers/multipart_converter_openai.py +4 -3
- 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/interfaces.py +1 -1
- 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/README.md +157 -0
- 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.35.dist-info → fast_agent_mcp-0.2.37.dist-info}/WHEEL +0 -0
- {fast_agent_mcp-0.2.35.dist-info → fast_agent_mcp-0.2.37.dist-info}/entry_points.txt +0 -0
|
@@ -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
|