from upsonic import Task, Agent
# Define SSE-based MCP servers
class FetchMCP:
url = "https://your-mcp-server.com/sse"
class SearchMCP:
url = "https://search-mcp-server.com/sse"
# Create task with MCP tools
task = Task(
description="Search for the latest technology news in Europe using the SearchMCP tool, then use FetchMCP to retrieve the full content of the top 3 articles.",
tools=[FetchMCP, SearchMCP]
)
# Create agent
agent = Agent(
name="News Agent",
model="openai/gpt-4o"
)
# Execute
result = agent.do(task)
print(result)