by v-3
Interact with Google Calendar to list, create, update, delete events and find free time slots via Claude.
A server that enables Claude to access a user's Google Calendar, allowing natural‑language queries and commands such as viewing upcoming events, scheduling meetings, adjusting times, and discovering open slots.
getToken.js
script.google-calendar
MCP entry with the required environment variables (client ID, secret, redirect URI, refresh token).npm run build
; Claude will start the server automatically when it launches.Q: Do I need to run the server manually? A: No. After building, Claude Desktop launches the server automatically when it starts.
Q: Where are my credentials stored?
A: In environment variables defined in Claude’s claude_desktop_config.json
. Keep them out of version control.
Q: What if tools don’t appear in Claude?
A: Verify the log files (~/Library/Logs/Claude/mcp*.log
on macOS/Linux or the equivalent on Windows), ensure all env variables are set, and confirm the absolute path to build/index.js
is correct.
Q: Can I change the OAuth scopes?
A: The required scopes are https://www.googleapis.com/auth/calendar
and https://www.googleapis.com/auth/calendar.events
. Adding others may be possible but is not required for core functionality.
Q: How do I rotate the refresh token?
A: Re‑run getToken.js
after revoking the old token in the Google Cloud console; update the GOOGLE_REFRESH_TOKEN
env variable.
This MCP server allows Claude to interact with your Google Calendar, enabling capabilities like listing events, creating meetings, and finding free time slots.
https://www.googleapis.com/auth/calendar
https://www.googleapis.com/auth/calendar.events
getToken.js
:const { google } = require('googleapis');
const http = require('http');
const url = require('url');
// Replace these with your OAuth 2.0 credentials
const CLIENT_ID = 'your-client-id';
const CLIENT_SECRET = 'your-client-secret';
const REDIRECT_URI = 'http://localhost:3000/oauth2callback';
// Configure OAuth2 client
const oauth2Client = new google.auth.OAuth2(
CLIENT_ID,
CLIENT_SECRET,
REDIRECT_URI
);
// Define scopes
const scopes = [
'https://www.googleapis.com/auth/calendar',
'https://www.googleapis.com/auth/calendar.events'
];
async function getRefreshToken() {
return new Promise((resolve, reject) => {
try {
// Create server to handle OAuth callback
const server = http.createServer(async (req, res) => {
try {
const queryParams = url.parse(req.url, true).query;
if (queryParams.code) {
// Get tokens from code
const { tokens } = await oauth2Client.getToken(queryParams.code);
console.log('\n=================');
console.log('Refresh Token:', tokens.refresh_token);
console.log('=================\n');
console.log('Save this refresh token in your configuration!');
// Send success response
res.end('Authentication successful! You can close this window.');
// Close server
server.close();
resolve(tokens);
}
} catch (error) {
console.error('Error getting tokens:', error);
res.end('Authentication failed! Please check console for errors.');
reject(error);
}
}).listen(3000, () => {
// Generate auth url
const authUrl = oauth2Client.generateAuthUrl({
access_type: 'offline',
scope: scopes,
prompt: 'consent' // Force consent screen to ensure refresh token
});
console.log('1. Copy this URL and paste it in your browser:');
console.log('\n', authUrl, '\n');
console.log('2. Follow the Google authentication process');
console.log('3. Wait for the refresh token to appear here');
});
} catch (error) {
console.error('Server creation error:', error);
reject(error);
}
});
}
// Run the token retrieval
getRefreshToken().catch(console.error);
npm install googleapis
Update the script with your OAuth credentials:
your-client-id
with your actual client IDyour-client-secret
with your actual client secretRun the script:
node getToken.js
For MacOS:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
For Windows:
code %AppData%\Claude\claude_desktop_config.json
{
"mcpServers": {
"google-calendar": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/YOUR/build/index.js"
],
"env": {
"GOOGLE_CLIENT_ID": "your_client_id_here",
"GOOGLE_CLIENT_SECRET": "your_client_secret_here",
"GOOGLE_REDIRECT_URI": "http://localhost",
"GOOGLE_REFRESH_TOKEN": "your_refresh_token_here"
}
}
}
}
mkdir google-calendar-mcp
cd google-calendar-mcp
npm init -y
npm install @modelcontextprotocol/sdk googleapis google-auth-library zod
npm install -D @types/node typescript
{
"compilerOptions": {
"target": "ES2022",
"module": "Node16",
"moduleResolution": "Node16",
"outDir": "./build",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}
{
"type": "module",
"scripts": {
"build": "tsc && node -e \"require('fs').chmodSync('build/index.js', '755')\""
}
}
mkdir src
GOOGLE_CLIENT_ID=your_client_id_here
GOOGLE_CLIENT_SECRET=your_client_secret_here
GOOGLE_REDIRECT_URI=http://localhost
GOOGLE_REFRESH_TOKEN=your_refresh_token_here
npm run build
The server provides the following tools:
list_events
: List calendar events within a specified time rangecreate_event
: Create a new calendar eventupdate_event
: Update an existing calendar eventdelete_event
: Delete a calendar eventfind_free_time
: Find available time slots in the calendarAfter setup, you can use commands like:
Tools not appearing in Claude:
tail -f ~/Library/Logs/Claude/mcp*.log
Authentication Errors:
Server Connection Issues:
node /path/to/build/index.js
To view server logs:
# For MacOS/Linux:
tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
# For Windows:
Get-Content -Path "$env:AppData\Claude\Logs\mcp*.log" -Wait -Tail 20
If you're getting environment variable errors, verify each one:
MIT License - See LICENSE file for details.
If you encounter any issues:
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "google-calendar": { "command": "node", "args": [ "/ABSOLUTE/PATH/TO/YOUR/build/index.js" ], "env": { "GOOGLE_CLIENT_ID": "<YOUR_CLIENT_ID>", "GOOGLE_CLIENT_SECRET": "<YOUR_CLIENT_SECRET>", "GOOGLE_REDIRECT_URI": "http://localhost", "GOOGLE_REFRESH_TOKEN": "<YOUR_REFRESH_TOKEN>" } } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by mattt
Enables AI assistants to retrieve and manage personal macOS data such as calendar events, contacts, messages, reminders, location, maps, and weather through a local MCP server, allowing personalized AI interactions without sending data off‑device.
by nspady
Provides Google Calendar integration for AI assistants, enabling event listing, creation, updating, deletion, free/busy queries, recurring event handling, and smart scheduling via natural language.
by baidu-maps
Offers a comprehensive suite of geospatial APIs and tools for developers and AI agents, enabling geocoding, reverse geocoding, POI search, route planning, weather, traffic, IP location, and real‑time traffic queries via standardized MCP interfaces.
by Omar-V2
Interact with the macOS Calendar through natural‑language commands, enabling creation, querying, and updating of events in a conversational way.
by GongRzhe
Enables LLMs to perform travel-related tasks such as location search, place details lookup, route calculation, and timezone retrieval using Google Maps services.
by zcaceres
Integrates with Google Tasks to list, read, search, create, update, and delete tasks via MCP tools.
by r-huijts
Provides real-time Dutch railway travel information—including departures, arrivals, journey planning, pricing, and station facilities—through an MCP server that Claude can query.
by TimLukaHorstmann
Provides hourly and daily weather forecasts via the AccuWeather API for Model Context Protocol (MCP) integration with language models.
by isdaniel
Provides current weather, historical weather ranges, and timezone‑aware current datetime for specified cities using the free Open‑Meteo API.