Skip to main content
Glama
README.md
# Google Meet Scheduler Agent (FastMCP + LangGraph + LangChain)

An AI scheduling assistant built with **LangGraph**, **LangChain**, and a custom **FastMCP Server** to manage Google Calendar events and generate **Google Meet** video conferencing links.

---

## 🌟 Key Features

1. **Custom FastMCP Server (`mcp_server.py`)**:
   - `list_upcoming_events`: Browse calendar schedule.
   - `check_availability`: Query Google Calendar `freebusy` for user & attendees.
   - `create_meeting`: Create calendar events with auto-generated Google Meet (`hangoutsMeet`) links (`conferenceDataVersion=1`).
   - `update_meeting`: Reschedule or update event details.
   - `delete_meeting`: Cancel events and auto-notify participants.
   - `get_meeting_details`: Inspect meeting details, RSVP statuses, and Meet URLs.

2. **LangGraph Agent (`agent.py`)**:
   - Contextual date/time parsing (converts relative times like "tomorrow 3 PM" to exact ISO-8601 strings in user timezone).
   - Multi-turn conversation state checkpointing via `MemorySaver`.
   - Tool calling integration using LangChain.

---

## šŸ“ Project Structure

```
google-meet-scheduler/
ā”œā”€ā”€ auth.py              # Google OAuth 2.0 & Calendar API v3 service helper
ā”œā”€ā”€ mcp_server.py        # FastMCP Server registering Google Meet/Calendar tools
ā”œā”€ā”€ agent_state.py       # LangGraph state schema (SchedulerState)
ā”œā”€ā”€ agent.py             # LangGraph state graph, system prompt, and tools node
ā”œā”€ā”€ main.py              # Interactive CLI Chat interface
ā”œā”€ā”€ .env.example         # Template for environment variables
ā”œā”€ā”€ requirements.txt     # Python dependencies
└── README.md            # Documentation & setup guide
```

---

## šŸš€ Quick Start Guide

### 1. Install Dependencies
```bash
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

pip install -r requirements.txt
```

### 2. Set Up Google Cloud Credentials
1. Go to [Google Cloud Console](https://console.cloud.google.com/).
2. Create a new project (e.g. `Google Meet MCP`).
3. Enable **Google Calendar API**.
4. Go to **APIs & Services > Credentials** -> Create Credentials -> **OAuth client ID**.
5. Select Application type: **Desktop app**.
6. Download the JSON file, rename it to `credentials.json`, and place it in the project root directory.

### 3. Configure Environment Variables
Copy `.env.example` to `.env`:
```bash
cp .env.example .env
```
Fill in your API keys in `.env`:
```env
DEFAULT_TIMEZONE=Asia/Kolkata
GEMINI_API_KEY=your_gemini_api_key
# or
OPENAI_API_KEY=your_openai_api_key
```

### 4. Run the Agent
```bash
python main.py
```

*Note: On your first run, a browser window will open asking you to log into your Google account and authorize Calendar access. Once approved, a `token.json` file will be created for seamless subsequent authentication.*

---

## šŸ› ļø Testing the FastMCP Server Standalone

You can inspect or test the FastMCP tools using the FastMCP CLI:
```bash
fastmcp dev mcp_server.py
```

---

## šŸ’¬ Example Prompt Interactions

- *"List my upcoming meetings for the week."*
- *"Check if I am free tomorrow between 2 PM and 5 PM."*
- *"Schedule a Google Meet with john@example.com tomorrow at 4 PM for 45 minutes titled 'Q3 Sprint Planning'."*
- *"Reschedule meeting ID `abc123xyz` to Friday 11 AM."*
- *"Cancel meeting `abc123xyz`."*