supreetbhat/mcp-google-calender
If you are the rightful owner of mcp-google-calender and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This project is a Python-based MCP server that integrates with Google Calendar API, providing CRUD operations for calendar management.
Google Calendar MCP Server
This project is a persistent, Python-based MCP (Model Context Protocol) server that acts as a bridge between an MCP client (like Claude Desktop) and your Google Calendar API.
It exposes your calendar as a set of tools (Create, Read, Update, Delete) that an LLM can use. Thanks to a local SQLite database that securely stores your Google refresh_token, you only need to go through the browser-based authentication flow one time. After that, the server can run in the background and will always be ready for Claude.
✨ Features
- Full CRUD:
get_events(Read)create_event(Create)update_event(Update)delete_event(Delete)
- Persistent Auth: Uses a local SQLite database (
sql_app.db) to securely store your Google OAuthrefresh_token. - Simple One-Time Setup: A built-in
--authflag starts a temporary web server to easily get your token from Google. stdioTransport: Designed to be launched and managed automatically by Claude Desktop.- Secure: No API keys are needed in the client. The server handles all token refreshes in the background.
🔧 Installation & Setup
You will need to get Google credentials, set up the project, and authenticate once.
Step 1: Get Google Credentials
Before you start, you must get your own API credentials from Google.
- Go to the Google Cloud Console.
- Create a new project.
- Go to "APIs & Services" -> "Library" and enable the "Google Calendar API".
- Go to "APIs & Services" -> "OAuth consent screen".
- Choose "External" and fill in the required fields (app name, user support email).
- On the "Scopes" page, add the
.../auth/calendarand.../auth/userinfo.emailscopes. - On the "Test users" page, add the Google email account you plan to use (e.g.,
you@gmail.com).
- Go to "APIs & Services" -> "Credentials".
- Click "+ Create Credentials" -> "OAuth client ID".
- Select "Web application" for the application type.
- Under "Authorized redirect URIs," click "+ Add URI" and add:
http://127.0.0.1:8000/auth/google/callback
- Click "Create". Google will give you a Client ID and a Client Secret. Copy these.
Step 2: Clone and Install
- Clone the repository:
git clone [https://github.com/supreetbhat/mcp-google-calender.git](https://github.com/supreetbhat/mcp-google-calender.git) cd mcp-google-calender - Create a virtual environment and activate it:
# On macOS/Linux python3 -m venv .venv source .venv/bin/activate # On Windows python -m venv .venv .\.venv\Scripts\activate - Install the required packages:
pip install -r requirements.txt - Create a
.envfile in the root of the project and add the credentials you got from Google:# .env GOOGLE_CLIENT_ID=YOUR_CLIENT_ID_HERE.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=YOUR_CLIENT_SECRET_HERE
Step 3: Authorize with Google (One-Time Only)
You must run this step once to create your database and get your refresh_token.
- Run the auth server:
python main.py --auth - Your terminal will show:
Starting one-time auth server on http://127.0.0.1:8000Please open http://127.0.0.1:8000/auth/google in your browser. - Open that URL in your browser, log in to your Google account, and grant the permissions.
- You'll be redirected to a success page. You can now stop the server in your terminal (
Ctrl+C). - A new database file,
sql_app.db, will now be in your project's~/Library/Application Support/mcp-google-calender/directory. Your token is safely stored.
Step 4: Connect to Claude Desktop
This is the final step to tell Claude how to run your server.
-
Find the absolute path to your project's Python executable. With your venv active, run:
# On macOS/Linux which python # Example output: /Users/yourname/Code/mcp-google-calender/.venv/bin/python # On Windows where python # Example output: C:\Users\yourname\Code\mcp-google-calender\.venv\Scripts\python.exe -
Find the absolute path to your
main.pyfile. In your project folder, run:# On macOS/Linux pwd # Example output: /Users/yourname/Code/mcp-google-calender # (So your script path is /Users/yourname/Code/mcp-google-calender/main.py) # On Windows cd # Example output: C:\Users\yourname\Code\mcp-google-calender # (So your script path is C:\Users\yourname\Code\mcp-google-calender\main.py) -
Open Claude Desktop, go to Settings -> Developer -> Edit Config.
-
Add the following to the
mcpServersobject, using the absolute paths you just found.{ "mcpServers": { "google_calendar": { "command": "/ABSOLUTE/PATH/TO/YOUR/.venv/bin/python", "args": [ "/ABSOLUTE/PATH/TO/YOUR/main.py" ], "cwd": "/ABSOLUTE/PATH/TO/YOUR/PROJECT/FOLDER" } } }command: The full path to your Python executable (from step 4.1).args: A list containing the full path to yourmain.pyscript.cwd: The full path to the folder containingmain.pyand.env(from step 4.2). This is critical for the server to find your.envfile.- (Windows users: Remember to use double backslashes
\\for your paths in the JSON file.)
🚀 Usage
- Fully quit and restart Claude Desktop for the changes to take effect.
- Open a new chat. You should see the "Search and tools" (slider) icon in the chat bar.
- If you click it, you will see the
google_calendarserver and its four tools:get_eventscreate_eventupdate_eventdelete_event
- You can now ask Claude to manage your calendar!
Example Prompts:
- "What's on my calendar tomorrow?"
- "Create an event called 'Doctor's Appointment' for this Friday at 3 PM."
- "Find the event 'Doctor's Appointment' and change its time to 4 PM."
- "Delete the event 'Doctor's Appointment'."
📄 License
This project is open-sourced under the MIT License.