> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Pipedream Google Calendar

> 此示例展示了如何将 Agno Agents 与 Pipedream Google Calendar MCP 服务器结合使用。

## 代码

```python theme={null}
"""
🗓️ Pipedream Google Calendar MCP

此示例展示了如何将 Pipedream MCP 服务器（在本例中为 Google Calendar）与 Agno Agents 结合使用。

1. 连接您的 Pipedream 和 Google Calendar 账户：https://mcp.pipedream.com/app/google-calendar
2. 获取您的 Pipedream MCP 服务器 url：https://mcp.pipedream.com/app/google-calendar
3. 将 MCP_SERVER_URL 环境变量设置为上面获取的 MCP 服务器 url
4. 安装依赖项：pip install agno mcp-sdk
"""

import asyncio
import os

from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.mcp import MCPTools
from agno.utils.log import log_exception

mcp_server_url = os.getenv("MCP_SERVER_URL")


async def run_agent(task: str) -> None:
    try:
        async with MCPTools(
            url=mcp_server_url, transport="sse", timeout_seconds=20
        ) as mcp:
            agent = Agent(
                model=OpenAIChat(id="gpt-4o-mini"),
                tools=[mcp],
                markdown=True,
            )
            await agent.aprint_response(
                message=task,
                stream=True,
            )
    except Exception as e:
        log_exception(f"Unexpected error: {e}")


if __name__ == "__main__":
    asyncio.run(
        run_agent("告诉我明天日历上所有计划的事件")
    )
```
