creamy-byte-34126
09/13/2025, 12:43 AMclass AppointmentRemainderAssistant(Agent):
def __init__(self, system_prompt: str, call_tracker: dict) -> None:
super().__init__(
instructions=system_prompt,
mcp_servers=[
mcp.MCPServerHTTP(
url="<http://localhost:8080/sse>"
)
]
)
self.call_tracker = call_tracker
tall-airline-16756
09/13/2025, 12:43 AMtall-airline-16756
09/13/2025, 12:44 AMcreamy-byte-34126
09/13/2025, 12:44 AMtall-airline-16756
09/13/2025, 12:45 AMfrom mcp_client.agent_tools import MCPToolsIntegration
from mcp_client.server import MCPServerSse
# Create MCP server instance
mcp_server = MCPServerSse(
params={"url": os.environ.get("MCP_SERVER_URL")},
name="SSE MCP Server"
)
# Prepare and register tools dynamically
prepared_tools = await MCPToolsIntegration.prepare_dynamic_tools([mcp_server])
2. Register Tools with Agent:
await MCPToolsIntegration.register_with_agent(agent, [mcp_server])
3. Create Agent with Selected Tools:
agent = await MCPToolsIntegration.create_agent_with_tools(
agent_class=FunctionAgent,
mcp_servers=[mcp_server]
)
Using these steps, you can easily pick and attach just the tools you need from the MCP server to your agent. If you have any questions or need a hand with this, please don’t hesitate to ask—I’m here to help!
Sources: README.md | Tool definition and use | LiveKit Docs | Tool definition and use | LiveKit Docs | mcp/agent.py