Multi-MCP Agent System with Google Calendar & Google Tasks

Multi-MCP Agent System with Google Calendar & Google Tasks

A system integrating two independent MCP servers for Google Calendar and Google Tasks APIs, orchestrated by an LLM agent loop with a web dashboard.

Category
访问服务器

README

🌐 Multi-MCP Agent System with Google Calendar & Google Tasks

A production-style implementation of the Model Context Protocol (MCP), featuring two independent Python-based MCP servers integrated with the real Google Calendar API and Google Tasks API.

The system leverages a local LLM (Ollama/Groq) inside an agentic orchestration loop and displays the entire tool execution timeline on a premium, dark-neon glassmorphic web dashboard.


🏗️ System Architecture & Data Flow

Below is the horizontal architecture mapping out the data flow from the User Interface, through the MCP Host, down to the LLM, the MCP servers, and the Google Cloud APIs:

graph LR
    %% Styling
    classDef main fill:#0f111a,stroke:#a259ff,stroke-width:2px,color:#fff;
    classDef orange fill:#221b1b,stroke:#ff6f43,stroke-width:1px,color:#fff;
    classDef blue fill:#18202b,stroke:#00e5ff,stroke-width:1px,color:#fff;
    classDef green fill:#0d1c16,stroke:#00e676,stroke-width:1px,color:#fff;

    Input([User Prompt Input]) -->|1. Submit text| Host

    subgraph Host ["MCP Host (Orchestrator - Port 3000)"]
        direction TB
        ServerStatus[Status Checker]
        LoopController[Agent Execution Loop]
        JSONLogger[(run_logs.json)]
    end
    class Host main;

    subgraph LLM ["LLM (Ollama / Groq)"]
        direction TB
        Reasoning[1. Understand request]
        ToolSelect[2. Select Tool & parameters]
    end
    class LLM main;

    Host <-->|2. Reasoning & Tool Selection| LLM

    subgraph CalServer ["Calendar MCP Server (Port 3001)"]
        direction TB
        c1["<b>create_event</b><br/>Args: title, start_time, end_time, auto_create_task<br/>Returns: Event JSON & HTML Card"]
        c2["<b>update_event</b><br/>Args: id, title, start_time, end_time, auto_update_task<br/>Returns: Updated Event JSON & HTML Card"]
        c3["<b>delete_event</b><br/>Args: id, auto_delete_task<br/>Returns: Confirmation JSON & HTML Card"]
        c4["<b>get_events</b><br/>Args: date, query<br/>Returns: Events List JSON & HTML"]
        c5["<b>set_reminder</b><br/>Args: event_id, minutes_before<br/>Returns: Event JSON & HTML Card"]
    end
    class CalServer orange;

    subgraph TaskServer ["Task MCP Server (Port 3002)"]
        direction TB
        t1["<b>create_task</b><br/>Args: title, due_date, description, related_event_id<br/>Returns: Task JSON & HTML Card"]
        t2["<b>update_task</b><br/>Args: id, title, due_date, description, status<br/>Returns: Updated Task JSON & HTML Card"]
        t3["<b>delete_task</b><br/>Args: id<br/>Returns: Deletion JSON & HTML Card"]
        t4["<b>list_tasks</b><br/>Args: status, related_event_id<br/>Returns: Tasks List JSON & HTML"]
        t5["<b>mark_task_complete</b><br/>Args: id<br/>Returns: Completed Task JSON & HTML Card"]
    end
    class TaskServer blue;

    Host -->|3a. Call Calendar Tool| CalServer
    Host -->|3b. Call Task Tool| TaskServer

    %% Server to Server SSE connection (Calendar server acting as Client to Task server)
    CalServer -.->|4. Server-to-Server Client Link - Calls create_task, update_task, delete_task| TaskServer

    subgraph Google ["Google Cloud APIs"]
        direction TB
        CalAPI[Google Calendar API]
        TasksAPI[Google Tasks API]
    end
    class Google green;

    c1 & c2 & c3 & c4 & c5 --->|Sync| CalAPI
    t1 & t2 & t3 & t4 & t5 --->|Sync| TasksAPI

    CalServer & TaskServer -->|5. Return JSON + HTML Card| Host
    Host -->|6. Render Timeline & Cards| DashboardOutput([Dashboard Output])

⚡ Key Features

  • Headless Google Authentication: An standalone auth_setup.py script executes the OAuth 2.0 flow once, storing config/token.json for all servers.
  • Mock Mode Fallback: If Google API credentials are not yet configured, the system transparently falls back to a mock in-memory database (shared/mock_db.json), making the system immediately runnable out of the box.
  • Server-to-Server Link (S2S): Over an internal SSE transport client, the Calendar MCP Server makes direct, programmatic client calls to the Task MCP Server to create preparation tasks for meetings.
  • Local Ollama Tool Calling: Integrates with local llama3.2 or Groq endpoints to dynamically parse prompt tasks and invoke target tools.
  • HTML/CSS Timeline UI: Beautiful frontend serving status displays, tool runs, collapsible JSON payloads, and formatted HTML widgets.

🔑 Google Cloud Setup

To sync with your Google Account, configure OAuth credentials:

  1. Go to the Google Cloud Console.
  2. Create a new project and enable the Google Calendar API and Google Tasks API.
  3. Configure the OAuth Consent Screen (Choose External, and add your Google email address under Test Users).
  4. Go to Credentials $\rightarrow$ Create Credentials $\rightarrow$ OAuth Client ID.
  5. Select Desktop Application as the application type, download the credentials JSON file.
  6. Rename this file to credentials.json and save it to the config/ directory:
    config/credentials.json
    

🚀 Installation & Running

1. Install Requirements

pip install -r requirements.txt

2. Run OAuth Authentication

python auth_setup.py

This will open your default browser. Authorize the permissions requested, which will save the authorization token to config/token.json.

3. Start the Servers

python start.py

The launcher script will coordinate Task MCP, Calendar MCP, and the Orchestrator FastAPI process, printing unified, color-coded console logs.

4. Open the Web Dashboard

Navigate your browser to:

http://localhost:3000

Submit prompts! Tasks will appear inside a task list called MCP Tasks in your Google Tasks, and meetings will be set on your primary Google Calendar.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选