google-calendar-mcp-server
This document provides a comprehensive guide to setting up a Google Calendar MCP server using the Google Calendar API.
Google Calendar MCP Server
This document explains the steps to set up the environment to use the Google Calendar API to search calendar contents as an MCP server.
Prerequisites
- uv must be installed.
- A Google account.
Steps
1. Create a Google Cloud Project
Enable the Google Calendar API in the Google Cloud Console or via the link below.
2. Set Up the OAuth 2.0 Consent Screen
Navigate to the branding page in the Google Cloud Console menu or via the link below.
- Set the application name.
- Set the user support email.
- Set the developer contact information.
3. Set Up Desktop Application Credentials
Navigate to the client page in the Google Cloud Console menu or via the link below.
- Click Create Credentials.
- Click Desktop app under Application type.
- Enter a name for the credentials in the Name field.
- Click Create.
- Save the downloaded JSON file as
credentials.json
and move the file to your working directory.
4. Set Up the Python Environment
Create a Virtual Environment
-
Open a terminal or command prompt.
-
Navigate to your project directory.
-
Set up the virtual environment and download the required libraries.
uv sync
Generate token.json
-
Run the following command to generate the
token.json
file:uv run generate_token.py
-
A browser will open requesting permission to access your Google account. Grant the permission.
-
After the authentication is completed, the
token.json
file will be created in your project directory.
5. Configure calendar_settings.json
- Edit the
calendar_settings.json.sample
file in the project directory.
For example, configure it as follows:
{
"calendar_ids": {
"primary": "primary",
"work": "example_work_schedule_id"
}
}
primary
: The ID of your Google account's primary calendar (usually "primary").work
: The ID of your work calendar.
Set the necessary calendar IDs, then rename the file to calendar_settings.json
and save it.
6. Configure MCP
-
Navigate to the
.vscode
directory within your project directory and edit themcp.json.sample
file. -
Edit the
mcp.json.sample
file as follows:{ "servers": { "google-calendar-mcp-server": { "type": "stdio", "command": "/home/<username>/<dir>/.venv/bin/python", "args": [ "/home/<username>/<dir>/google_calendar_mcp_server.py" ] } } }
- Replace
<username>
with your username. - Replace
<dir>
with your project directory name.
For example, if your username is
tatsuya
and your project directory name isgoogle-calendar-mcp-server
, the configuration would be:{ "servers": { "google-calendar-mcp-server": { "type": "stdio", "command": "/home/tatsuya/google-calendar-mcp-server/.venv/bin/python", "args": [ "/home/tatsuya/google-calendar-mcp-server/google_calendar_mcp_server.py" ] } } }
- Replace
-
After editing, rename the file to
mcp.json
and save it.
7. Configure Agent Mode
Follow the steps below to set up Agent Mode for GitHub Copilot Chat in Visual Studio Code.
- Open Visual Studio Code and navigate to the Extensions view.
- Search for and install the "GitHub Copilot Chat" extension.
- Once installed, the "Copilot Chat" icon will appear in the sidebar. Click it to open the Copilot Chat panel.
- Click the gear icon at the top of the Copilot Chat panel to open the settings.
- Enable "Agent Mode" in the settings.
8. Use MCP
- Open the Copilot Chat panel.
- For example, enter a chat such as "List the events for April 8th."
- A tool execution confirmation will be displayed, click the Continue button to execute.
- On first use, a browser will open requesting permission to access your Google account. Grant the permission.
- The result will be displayed.
Troubleshooting
- If an error occurs: Check the error message and, if necessary, reinstall dependencies or check the settings in the Google Cloud Console.
Related MCP Servers
View all calendar_management servers →apple-mcp
by supermemoryai
This is a collection of Apple-native tools for the Model Context Protocol (MCP) that integrates with various Apple applications to automate tasks and manage communications.
iMCP
by loopwork-ai
iMCP is a macOS app that connects your digital life with AI, supporting the Model Context Protocol (MCP) for seamless integration with various clients.
google-calendar-mcp
by nspady
This is a Model Context Protocol (MCP) server that provides integration with Google Calendar, allowing LLMs to interact with calendar events through a standardized interface.
mcp-gsuite
by MarkusPfundstein
MCP server to interact with Google products, specifically Gmail and Calendar.
applescript-mcp
by joshrutkowski
A Model Context Protocol server that enables LLM applications to interact with macOS through AppleScript, providing a standardized interface for AI applications to control system functions, manage files, handle notifications, and more.
mcp-ical
by Omar-V2
MCP iCal Server is a natural language calendar management tool for macOS, leveraging the Model Context Protocol (MCP) to enhance user interaction with calendar events.
google-workspace-mcp
by aaronsb
The Google Workspace MCP Server is a Model Context Protocol server that allows users to manage their Google Workspace, including Gmail, Calendar, and Drive, through a secure and efficient interface.