google-calendar-mcp
Allows AI assistants to interact with personal Google Calendar, providing tools for listing calendars, listing, searching, creating, updating, deleting events, and querying free/busy information.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@google-calendar-mcpwhat events do I have tomorrow?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
google-calendar-mcp
A production-ready Model Context Protocol (MCP) server that lets AI assistants interact with your personal Google Calendar using the Google Calendar API and OAuth 2.0.
Connect it to Cursor, Claude Desktop, VS Code, or any MCP client that supports stdio transport. Each user runs a local copy with their own Google credentials.
Security: Never commit
.envor real OAuth tokens. See SECURITY.md.
Features
7 MCP tools — list calendars, list / search / create / update / delete events, and free/busy queries
OAuth 2.0 with refresh tokens — access tokens refresh automatically; you never paste a short-lived access token
Zod validation on every tool input
Structured logging to stderr (tool name, duration, API errors)
Graceful errors — 401, 403, 404, 429, network failures, and expired refresh tokens return readable MCP errors without crashing
stdio transport — works with local MCP hosts out of the box
Related MCP server: calendar-mcp
Architecture overview
┌─────────────────────┐ stdio (JSON-RPC) ┌──────────────────────────┐
│ MCP Client │ ◄───────────────────────► │ google-calendar-mcp │
│ Cursor / Claude / │ │ McpServer + tools │
│ VS Code │ │ auth.ts → OAuth2 │
└─────────────────────┘ │ calendar.ts → API calls │
└────────────┬─────────────┘
│
▼
┌──────────────────────────┐
│ Google Calendar API v3 │
│ (googleapis + refresh) │
└──────────────────────────┘The MCP client spawns this server as a child process.
Credentials are loaded from
.env(or the clientenvblock).googleapisrefreshes access tokens using your refresh token as needed.Tools in
src/tools/call shared helpers insrc/calendar.ts(no duplicated API logic).
This is a single-user, local server—not a multi-tenant cloud service.
Screenshots
Place screenshots under
docs/images/after publishing if desired.
Cursor MCP connected | Example tool result |
|
|
(Image paths are placeholders until you add screenshots.)
Tech stack
Technology | Role |
TypeScript | Strict-mode application language |
Node.js 18+ | Runtime |
MCP server ( | |
Official Google Calendar client | |
Tool input schemas | |
Local environment loading | |
tsx | Development runner |
Docker is not provided. This server uses stdio; MCP clients typically start a local Node process. Packaging it in Docker is unnecessary for the supported setup.
Requirements
Node.js 18 or later
A Google Cloud project
Google Calendar API enabled
OAuth 2.0 client ID and secret
A refresh token with Calendar access
An MCP-compatible client (Cursor, Claude Desktop, VS Code, etc.)
Installation
git clone https://github.com/[your-org]/google-calendar-mcp.git
cd google-calendar-mcp
npm installCopy the environment template:
cp .env.example .envFill in your credentials (see Google Cloud OAuth setup below). Never commit .env.
Environment variables
Variable | Required | Description |
| Yes | OAuth 2.0 client ID from Google Cloud Console |
| Yes | OAuth 2.0 client secret |
| Yes | Long-lived refresh token from the OAuth consent flow |
| No | Default calendar when a tool omits |
Example .env (placeholders only):
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REFRESH_TOKEN=your-refresh-token
DEFAULT_CALENDAR_ID=primaryGoogle Cloud OAuth setup
Follow these steps if you have never used Google Cloud. Screens and labels change occasionally; use the current Console navigation that matches each step.
1. Create a Google Cloud project
Open Google Cloud Console.
Click the project selector at the top → New Project.
Enter a name (for example
google-calendar-mcp) → Create.Select the new project.
2. Enable the Google Calendar API
Go to APIs & Services → Library.
Search for Google Calendar API.
Open it → click Enable.
3. Configure the OAuth consent screen
Go to APIs & Services → OAuth consent screen.
Choose External (unless you use Google Workspace Internal) → Create.
Fill in App name, User support email, and Developer contact.
Save and continue through Scopes / Test users as prompted.
Under Test users (while the app is in Testing), add the Google account whose calendar you will use.
Important: In Testing mode, refresh tokens may expire after 7 days. For personal long-term use, keep yourself as a test user or publish the app when eligible. Revoking access or resetting the OAuth client also invalidates tokens.
4. Create an OAuth client ID
Go to APIs & Services → Credentials.
Click Create credentials → OAuth client ID.
Application type:
Web application is easiest with the OAuth Playground (recommended below), or
Desktop app if you prefer another flow later.
Name the client (for example
calendar-mcp-local).If using Web application, under Authorized redirect URIs add:
https://developers.google.com/oauthplaygroundClick Create. Copy the Client ID and Client secret into your
.envfile.
5. Required OAuth scope
This server needs:
https://www.googleapis.com/auth/calendarThat scope allows reading and writing calendar data for the authorized account.
6. Obtain a refresh token (OAuth 2.0 Playground)
Click the gear icon (top right).
Check Use your own OAuth credentials.
Paste your Client ID and Client secret → close the dialog.
In the left list, expand Calendar API v3 and select
https://www.googleapis.com/auth/calendar
(or paste that scope in the custom scope box).Click Authorize APIs and sign in with your test user account. Grant the permissions.
Click Exchange authorization code for tokens.
Copy the
refresh_tokenvalue (not the access token) into.envasGOOGLE_REFRESH_TOKEN.
If you do not see a refresh token, revoke the app at Google Account permissions and repeat with your own credentials and “offline” access (Playground does this when configured as above).
7. First-time authentication check
From the project root:
npm run build
npm run devOn success, stderr should include structured logs such as:
OAuth2 client initializedAuthentication validated successfullygoogle-calendar-mcp server connected and ready
Then stop with Ctrl+C. For day-to-day use, configure an MCP client so it starts the server for you (next sections). You do not need to keep a terminal open after the client is configured.
Running locally
Build and start
npm run build
npm startDevelopment (no build step)
npm run devType-check only
npm run typecheckThe process listens on stdio. Running it alone in a terminal will look idle after startup—that is expected. Use an MCP client or the MCP Inspector:
npx @modelcontextprotocol/inspector node dist/index.jsConfiguration
Use absolute paths. Prefer built dist/index.js after npm run build. Secrets can live in .env (loaded by the server) and/or in the client env block.
Cursor
Project file: .cursor/mcp.json (or Cursor global MCP settings). See also examples/mcp-cursor.json.
{
"mcpServers": {
"google-calendar": {
"command": "node",
"args": ["/absolute/path/to/google-calendar-mcp/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_REFRESH_TOKEN": "your-refresh-token",
"DEFAULT_CALENDAR_ID": "primary"
}
}
}
}Restart Cursor and confirm the server is connected under Settings → MCP.
Claude Desktop
Config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"google-calendar": {
"command": "node",
"args": ["/absolute/path/to/google-calendar-mcp/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_REFRESH_TOKEN": "your-refresh-token",
"DEFAULT_CALENDAR_ID": "primary"
}
}
}
}VS Code
Add under your MCP / Copilot MCP server settings (exact key may vary by extension):
{
"mcp": {
"servers": {
"google-calendar": {
"command": "node",
"args": ["/absolute/path/to/google-calendar-mcp/dist/index.js"],
"env": {
"GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
"GOOGLE_CLIENT_SECRET": "your-client-secret",
"GOOGLE_REFRESH_TOKEN": "your-refresh-token"
}
}
}
}
}Available MCP tools
Tool | Description |
| Returns every calendar available to the authenticated user |
| Lists events in a time range (optional filters) |
| Free-text search via Google’s |
| Creates an event; returns created event details including id |
| Partially updates an event (only supplied fields) |
| Deletes an event |
| Returns busy periods for one or more calendars |
Example prompts
Ask your AI client natural language such as:
“List my calendars.”
“What meetings do I have tomorrow?”
“Search my calendar for dentist.”
“Create a 1-hour event called Team Sync tomorrow at 10am.”
“Am I free Friday afternoon?”
See examples/prompts.md for more.
Sample tool request
{
"name": "list_events",
"arguments": {
"timeMin": "2026-07-14T00:00:00Z",
"timeMax": "2026-07-21T00:00:00Z",
"maxResults": 5,
"orderBy": "startTime"
}
}Sample tool response (illustrative only)
[
{
"id": "abc123example",
"summary": "Team Sync",
"start": { "dateTime": "2026-07-15T10:00:00-07:00" },
"end": { "dateTime": "2026-07-15T11:00:00-07:00" },
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=example"
}
]More samples: examples/sample-responses.md.
Project structure
google-calendar-mcp/
├── src/
│ ├── index.ts # Entry — stdio transport
│ ├── server.ts # McpServer factory and tool registration
│ ├── auth.ts # OAuth2 client and token refresh
│ ├── calendar.ts # Google Calendar API wrapper
│ ├── types.ts # Shared TypeScript types
│ ├── utils.ts # Logging, error handling, helpers
│ └── tools/
│ ├── listCalendars.ts
│ ├── listEvents.ts
│ ├── searchEvents.ts
│ ├── createEvent.ts
│ ├── updateEvent.ts
│ ├── deleteEvent.ts
│ └── freeBusy.ts
├── examples/ # Sample configs and prompts (no secrets)
├── .env.example
├── package.json
├── tsconfig.json
├── LICENSE
├── CONTRIBUTING.md
├── SECURITY.md
├── CODE_OF_CONDUCT.md
├── CHANGELOG.md
└── README.mdDevelopment workflow
npm install
cp .env.example .env # add your credentials
npm run typecheck
npm run build
npm run dev # or connect via MCP Inspector / CursorContributions welcome—see CONTRIBUTING.md.
Troubleshooting
Problem | What to try |
Missing environment variables | Copy |
Authentication failed (401) / invalid refresh token | Re-run OAuth Playground; ensure Client ID matches the token; revoke and re-authorize if needed |
Permission denied (403) | Enable Google Calendar API; confirm scope includes calendar; ensure you are a consent screen test user |
Rate limit (429) | Wait and retry; lower |
| Add |
MCP client cannot connect | Use absolute paths; run |
Server seems frozen after start | Normal for stdio—clients must spawn and speak the protocol |
Refresh token stops working after ~7 days | App is in Testing mode—see OAuth consent screen notes above |
Logs are written as JSON lines to stderr. Do not log secrets.
FAQ
Do I need to keep a terminal open for Cursor?
No. Once MCP is configured, Cursor starts and stops the server automatically.
Is this multi-user?
No. One process uses one set of credentials and one Google account.
Can I publish my .env?
Never. Treat client secret and refresh token like passwords.
Can I use a service account?
This project is built for user OAuth with a refresh token, not service accounts.
Why no Docker?
MCP stdio clients spawn a local command. Running Node directly is the supported path.
Contributing
See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
License
This project is licensed under the MIT License.
Acknowledgements
Model Context Protocol and the TypeScript SDK
Google Calendar API and the googleapis Node.js client
Contributor Covenant for the Code of Conduct template
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Naim-Howlader/google-calendar-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server

