Pipedream Google Calendar
This example shows how to use the Google Calendar Pipedream MCP server with Kern Agents.
Code
1"""2��️ Pipedream Google Calendar MCP34This example shows how to use Pipedream MCP servers (in this case the Google Calendar one) with Kern Agents.561. Connect your Pipedream and Google Calendar accounts: https://mcp.pipedream.com/app/google-calendar72. Get your Pipedream MCP server url: https://mcp.pipedream.com/app/google-calendar83. Set the MCP_SERVER_URL environment variable to the MCP server url you got above94. Install dependencies: uv pip install kern-ai mcp-sdk10"""1112import asyncio13import os1415from kern.agent import Agent16from kern.models.openai import OpenAIResponses17from kern.tools.mcp import MCPTools18from kern.utils.log import log_exception1920mcp_server_url = os.getenv("MCP_SERVER_URL")212223async def run_agent(task: str) -> None:24 try:25 async with MCPTools(26 url=mcp_server_url, transport="sse", timeout_seconds=2027 ) as mcp:28 agent = Agent(29 model=OpenAIResponses(id="gpt-5.2"),30 tools=[mcp],31 markdown=True,32 )33 await agent.aprint_response(34 message=task,35 stream=True,36 )37 except Exception as e:38 log_exception(f"Unexpected error: {e}")394041if __name__ == "__main__":42 asyncio.run(43 run_agent("Tell me about all events I have in my calendar for tomorrow")44 )