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
Visit Server

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.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured