
Google Calendar
STDIOGoogle Calendar integration MCP server for AI assistants with event management and scheduling capabilities.
Google Calendar integration MCP server for AI assistants with event management and scheduling capabilities.
This is a Model Context Protocol (MCP) server that provides integration with Google Calendar. It allows LLMs to read, create, update and search for calendar events through a standardized interface.
Along with the normal capabilities you would expect for a calendar integration you can also do really dynamic, multi-step processes like:
Cross-calendar availability:
Please provide availability looking at both my personal and work calendar for this upcoming week.
Choose times that work well for normal working hours on the East Coast. Meeting time is 1 hour
Add events from screenshots, images and other data sources:
Add this event to my calendar based on the attached screenshot.
Supported image formats: PNG, JPEG, GIF Images can contain event details like date, time, location, and description
Calendar analysis:
What events do I have coming up this week that aren't part of my usual routine?
Check attendance:
Which events tomorrow have attendees who have not accepted the invitation?
Auto coordinate events:
Here's some available that was provided to me by someone.
Take a look at the available times and create an event that is free on my work calendar.
https://www.googleapis.com/auth/calendar.events
(or broader https://www.googleapis.com/auth/calendar
if needed)npm run auth
.Add to Claude Desktop: Close Claude Desktop, then edit your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "google-calendar": { "command": "npx", "args": ["@cocal/google-calendar-mcp"], "env": { "GOOGLE_OAUTH_CREDENTIALS": "/path/to/your/gcp-oauth.keys.json" } } } }
Start Claude Desktop - it will open the google sign-in dialogue in a browser window
Clone the repository
Install dependencies (this also builds the js via postinstall):
git clone https://github.com/nspady/google-calendar-mcp.git cd google-calendar-mcp npm install
Configure OAuth credentials using one of these methods: Option A: Custom file location (recommended)
GOOGLE_OAUTH_CREDENTIALS
environment variable to specify the pathOption B: In project file location (legacy)
gcp-oauth.keys.json
and place it in the root directory of the project.cp gcp-oauth.keys.example.json gcp-oauth.keys.json
and populate it with your credentials from the Google Cloud Console.Add configuration to your Claude Desktop config file:
Using default credentials file location:
{ "mcpServers": { "google-calendar": { "command": "node", "args": ["<absolute-path-to-project-folder>/build/index.js"] } } }
Using environment variable:
{ "mcpServers": { "google-calendar": { "command": "node", "args": ["<absolute-path-to-project-folder>/build/index.js"], "env": { "GOOGLE_OAUTH_CREDENTIALS": "/path/to/your/credentials.json" } } } }
Note: Replace <absolute-path-to-project-folder>
with the actual path to your project directory.
Restart Claude Desktop
npm run build
- Build the TypeScript code (compiles src
to build
)npm run typecheck
- Run TypeScript type checking without compilingnpm run start
- Start the compiled MCP server (using node build/index.js
)npm run auth
- Manually run the Google OAuth authentication flow.npm test
- Run the unit/integration test suite using Vitestnpm run test:watch
- Run tests in watch modenpm run coverage
- Run tests and generate a coverage reportThe server supports multiple methods for providing OAuth credentials, with a priority-based loading system:
The server searches for OAuth credentials in the following order:
GOOGLE_OAUTH_CREDENTIALS
environment variablegcp-oauth.keys.json
in the current working directorySet the GOOGLE_OAUTH_CREDENTIALS
environment variable:
# Set environment variable export GOOGLE_OAUTH_CREDENTIALS="/path/to/your/credentials.json" # Then run normally npx @cocal/google-calendar-mcp start
Place your OAuth credentials file as gcp-oauth.keys.json
in the current working directory (traditional method).
Choose one of these configuration methods based on your preference:
{ "mcpServers": { "google-calendar": { "command": "npx", "args": ["@cocal/google-calendar-mcp"], "env": { "GOOGLE_OAUTH_CREDENTIALS": "/Users/yourname/Documents/my-google-credentials.json" } } } }
⚠️ Important Note for npx Users: When using npx, you must specify the credentials file path using the GOOGLE_OAUTH_CREDENTIALS
environment variable. The default file location method is not reliable with npx installations due to package caching behavior.
The server handles Google OAuth 2.0 authentication to access your calendar data.
Ensure OAuth credentials are available using one of the supported methods:
GOOGLE_OAUTH_CREDENTIALS=/path/to/credentials.json
gcp-oauth.keys.json
in the working directoryStart the MCP server using your chosen method from the installation section above.
Authentication process:
.gcp-saved-tokens.json
.http://localhost:3000/oauth2callback
)..gcp-saved-tokens.json
(and show the exact file path).If you need to re-authenticate or prefer to handle authentication separately:
For npx installations:
# Set environment variable and authenticate export GOOGLE_OAUTH_CREDENTIALS="/path/to/your/credentials.json" npx @cocal/google-calendar-mcp auth
For local installations:
# Using default credentials file location npm run auth # The CLI parameter and environment variable methods also work for local installations
Authentication Process:
~/.config/google-calendar-mcp/tokens.json
following the XDG Base Directory Specification (a cross-platform standard for organizing user configuration files)~/.config/google-calendar-mcp/tokens.json
GOOGLE_CALENDAR_MCP_TOKEN_PATH
environment variable to use a different locationnpm run auth
commandGOOGLE_CALENDAR_MCP_TOKEN_PATH
environment variable (highest priority)$XDG_CONFIG_HOME/google-calendar-mcp/tokens.json
if XDG_CONFIG_HOME is set~/.config/google-calendar-mcp/tokens.json
(lowest priority)Unit and integration tests are implemented using Vitest.
npm test
npm run test:watch
npm run coverage
Tests mock external dependencies (Google API, filesystem) to ensure isolated testing of server logic and handlers.
gcp-oauth.keys.json
) and saved tokens (.gcp-saved-tokens.json
) should never be committed to version control. Ensure they are added to your .gitignore
file.OAuth Credentials File Not Found (ENOENT Error):
If you see an error like ENOENT: no such file or directory, open 'gcp-oauth.keys.json'
, the server cannot find your OAuth credentials file.
⚠️ For npx users: You must specify the credentials file path - the default file location method is not reliable with npx. Use one of these options:
{ "mcpServers": { "google-calendar": { "command": "npx", "args": ["@cocal/google-calendar-mcp"], "env": { "GOOGLE_OAUTH_CREDENTIALS": "/path/to/your/credentials.json" } } } }
For local installations only: You can place gcp-oauth.keys.json
in the project root directory.
Authentication Errors / Connection Reset on Callback:
.gcp-saved-tokens.json
and re-authenticating with your preferred credential loading method.Credential Loading Priority Issues:
Tokens Expire Weekly:
Build Errors:
npm install
again.build/
directory and run npm run build
.If you are a developer want to contribute this repository, please kindly take a look at Architecture Overview before contributing
MIT