I’ve defined the agent with following code using the MCP Server
import asyncio
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.mcp import MCPTools
# This is the URL of the MCP server we want to use.
server_url = "http://<IP:PORT>/sse"
async def run_agent(message: str) -> None:
async with MCPTools(transport="sse", url=server_url) as mcp_tools:
agent = Agent(
model=OpenAIChat(id="gpt-4.1-nano"),
tools=[mcp_tools],
markdown=True,
instructions=[
"You are a helpful assistant that can retrieve and analyze documents using the LightRAG system.",
"When asked a question, use the available tools to find relevant information.",
"Always cite your sources when providing information from the documents.",
"If you don't know the answer, say so rather than making up information.",
"Be concise and accurate in your responses.",
"When using tools, make sure to provide clear and specific queries to get the best results.",
"Use the mode=mix and top_k = 1"
],
)
await agent.aprint_response(message=message, stream=True, markdown=True)
if __name__ == "__main__":
asyncio.run(run_agent("who is john"))
I want to create the agent and integrate in the playground code
How can I do that ?