diff --git a/examples/mcp_example/mock_math_server.py b/examples/mcp_example/mock_math_server.py index f8d85e3c..3d54f21e 100644 --- a/examples/mcp_example/mock_math_server.py +++ b/examples/mcp_example/mock_math_server.py @@ -22,4 +22,4 @@ def divide(a: int, b: int) -> float: if __name__ == "__main__": print("Starting Mock Math Server on port 8000...") - mcp.run(transport="sse", transport_kwargs={"port": 8000, "host": "0.0.0.0"}) + mcp.run(transport="sse", port=8000, host="0.0.0.0") diff --git a/swarms/structs/agent.py b/swarms/structs/agent.py index 7a723f9b..a10af6e0 100644 --- a/swarms/structs/agent.py +++ b/swarms/structs/agent.py @@ -47,12 +47,6 @@ from swarms.structs.safe_loading import ( ) from swarms.telemetry.main import log_agent_data from swarms.tools.base_tool import BaseTool - -# from swarms.tools.mcp_integration import ( -# MCPServerSseParams, -# batch_mcp_flow, -# mcp_flow_get_tool_schema, -# ) from swarms.tools.tool_parse_exec import parse_and_execute_json from swarms.utils.any_to_str import any_to_str from swarms.utils.data_to_text import data_to_text @@ -838,7 +832,7 @@ class Agent: # If no components available, fall back to task if not components and task: logger.warning( - "No agent details found. Using task as fallback for prompt generation." + "No agent details found. Usingtask as fallback for prompt generation." ) self.system_prompt = auto_generate_prompt( task, self.llm @@ -1869,7 +1863,7 @@ class Agent: # Response Filtering def add_response_filter(self, filter_word: str) -> None: """ - Add a response filter to filter out certain words from the response + Add a response filter tofilter out certain words from the response Example: agent.add_response_filter("Trump") diff --git a/swarms/tools/mcp_integration.py b/swarms/tools/mcp_integration.py index dad88d75..e1fa6679 100644 --- a/swarms/tools/mcp_integration.py +++ b/swarms/tools/mcp_integration.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Any, Dict, List, Optional from typing_extensions import NotRequired, TypedDict from contextlib import AbstractAsyncContextManager -from fastmcp import FastClientSession as ClientSession +from fastmcp import Client as ClientSession from fastmcp.servers import fast_sse_client as sse_client from loguru import logger