This project connects OpenAI GPT with Google Calendar API through a lightweight MCP server.
It enables natural language scheduling, so you can simply type commands like:
"Schedule a meeting for tomorrow at 4 PM to discuss the project launch for an hour."
The agent parses the intent → calls the MCP server → schedules it on Google Calendar.
- 🤖 AI Agent that understands natural language and extracts event details
- 📅 Google Calendar Integration using OAuth2
- ⚡ FastAPI MCP Server for event scheduling
- 🔑 Secure authentication flow (
/login
&/oauth2callback
) - 📂 Minimal, extensible project structure
Layer | Technologies | Purpose |
---|---|---|
Agent | OpenAI GPT-4 Turbo | Natural language → structured event data |
Server | FastAPI | REST API for scheduling |
Calendar API | Google Calendar | Event creation & management |
Auth | OAuth2.0 | Secure login with Google |
- Authenticate with Google using
/login
→/oauth2callback
. - Store credentials in
credentials.json
. - Agent (
agent.py
) sends structured scheduling requests to MCP server. - Server (
mcp_server.py
) creates events in Google Calendar. - ✅ Done! Your event is live in the calendar.
AI-Calendar-Scheduler/
├── agent.py # AI scheduling agent (OpenAI tool call → MCP server)
├── mcp_server.py # FastAPI server (Google Calendar integration)
├── credentials.json # Generated after login (OAuth tokens)
└── .gitignore
git clone https://github.com/kartik0905/ai-calendar-scheduler.git
cd ai-calendar-scheduler
pip install -r requirements.txt
- Download
client_secret.json
from Google Cloud Console. - Place it in the project root.
uvicorn mcp_server:app --reload
Visit:
http://localhost:8000/login
Copy the credentials printed in the terminal into credentials.json
.
python agent.py
Example prompt:
"Schedule a meeting for tomorrow at 4 PM to discuss the project launch for an hour"
- Add recurring event support
- Support multiple calendars
- Natural language event modifications
- Web dashboard for event management
Built with ❤️ by Kartik Garg