Google Calendar MCP server for Claude Desktop integration
🔔 VERSION UPDATE NOTICE 🔔
Version 1.0.2 includes a fix for theupdateEvent
function to preserve existing event data when performing partial updates. Version 1.0.1 includes a fix for Node.js v20.9.0+ compatibility with the 'open' package, which is now ESM-only in version 10+. Version 1.0.0 marks our first production-ready release with comprehensive code refactoring and internationalization.
Google Calendar MCP Server is an MCP (Model Context Protocol) server implementation that enables integration between Google Calendar and Claude Desktop. This project enables Claude to interact with the user's Google Calendar, providing the ability to display, create, update, and delete calendar events through natural language interaction.
This project uses:
@modelcontextprotocol/sdk
for integration with Claude Desktopgoogleapis
for Google Calendar API accessThis MCP server provides the following tools for interacting with Google Calendar:
Retrieves calendar events with various filtering options.
Parameters:
calendarId
(optional): Calendar ID (uses primary calendar if omitted)timeMin
(optional): Start time for event retrieval (ISO 8601 format, e.g., "2025-03-01T00:00:00Z")timeMax
(optional): End time for event retrieval (ISO 8601 format)maxResults
(optional): Maximum number of events to retrieve (default: 10)orderBy
(optional): Sort order ("startTime" or "updated")Creates a new calendar event.
Parameters:
calendarId
(optional): Calendar ID (uses primary calendar if omitted)event
: Event details object containing:
summary
(required): Event titledescription
(optional): Event descriptionlocation
(optional): Event locationstart
: Start time object with:
dateTime
(optional): ISO 8601 format (e.g., "2025-03-15T09:00:00+09:00")date
(optional): YYYY-MM-DD format for all-day eventstimeZone
(optional): Time zone (e.g., "Asia/Tokyo")end
: End time object (same format as start)attendees
(optional): Array of attendees with email and optional displayNamecolorId
(optional): Event color ID (1-11)Updates an existing calendar event. The function fetches the existing event data first and merges it with the update data, preserving fields that are not included in the update request.
Parameters:
calendarId
(optional): Calendar ID (uses primary calendar if omitted)eventId
(required): ID of the event to updateevent
: Event details object containing fields to update (same structure as createEvent, all fields optional)
Deletes a calendar event.
Parameters:
calendarId
(optional): Calendar ID (uses primary calendar if omitted)eventId
(required): ID of the event to deleteWhen adding new functions, modifying code, or fixing bugs, please semantically increase the version for each change using npm version
command.
Also, please make sure that your coding is clear and follows all the necessary coding rules, such as OOP.
The version script will automatically run npm install
when the version is updated, but you should still build, run lint, and test your code before submitting it.
This package is published on npm as @takumi0706/google-calendar-mcp
:
npx @takumi0706/[email protected]
# Create a .env file with your Google OAuth credentials
GOOGLE_CLIENT_ID=your_client_id
GOOGLE_CLIENT_SECRET=your_client_secret
GOOGLE_REDIRECT_URI=http://localhost:4153/oauth2callback
# Optional: Token encryption key (auto-generated if not provided)
TOKEN_ENCRYPTION_KEY=32-byte-hex-key
# Optional: Auth server port and host (default port: 4153, host: localhost)
AUTH_PORT=4153
AUTH_HOST=localhost
# Optional: MCP server port and host (default port: 3000, host: localhost)
PORT=3000
HOST=localhost
Add the server to your claude_desktop_config.json
:
{
"mcpServers": {
"google-calendar": {
"command": "npx",
"args": [
"-y",
"@takumi0706/google-calendar-mcp"
],
"env": {
"GOOGLE_CLIENT_ID": "your_client_id",
"GOOGLE_CLIENT_SECRET": "your_client_secret",
"GOOGLE_REDIRECT_URI": "http://localhost:4153/oauth2callback"
}
}
}
}
For more details, see SECURITY.md.
~/.google-calendar-mcp/logs/
If you encounter any issues:
~/.google-calendar-mcp/logs/
Unexpected non-whitespace character after JSON at position 4 (line 1 column 5)
, it's typically due to malformed JSON-RPC messages. This issue has been fixed in version 0.6.7 and later. If you're still experiencing these errors, please update to the latest version.updateEvent
function to preserve existing event data when performing partial updatesgetEvent
function to fetch existing event data before updatingupdateEvent
to merge update data with existing data to prevent data lossupdateEvent
functionprompt: 'consent'
parameter to force Google to show the consent screen and provide a new refresh tokenTo contribute to this project:
# Clone the repository
git clone https://github.com/takumi0706/google-calendar-mcp.git
cd google-calendar-mcp
# Install dependencies
npm install
# Run in development mode
npm run dev
To run the tests:
# Run all tests
npm test
# Run tests with coverage report
npm test -- --coverage
MIT