musarratChowdhury/nodejs-mcp-server
If you are the rightful owner of nodejs-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server that integrates with Google Calendar to check for meetings scheduled this week.
Google Calendar MCP Server
A Model Context Protocol (MCP) server that integrates with Google Calendar to check for meetings scheduled this week.
Features
- Check Meetings: Quickly determine if you have any meetings this week
- List Meetings: Get detailed information about all meetings scheduled for the current week
- Google Calendar Integration: Secure OAuth2 authentication with Google Calendar API
- Smart Filtering: Automatically filters out busy blocks and focus time events
Prerequisites
- Node.js: Version 18.0.0 or higher
- Google Cloud Project: You'll need to create a Google Cloud project and enable the Calendar API
- OAuth2 Credentials: Set up OAuth2 credentials in the Google Cloud Console
Setup
1. Install Dependencies
npm install
2. Google Cloud Setup
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Google Calendar API:
- Go to "APIs & Services" > "Library"
- Search for "Google Calendar API"
- Click "Enable"
- Create OAuth2 credentials:
- Go to "APIs & Services" > "Credentials"
- Click "Create Credentials" > "OAuth 2.0 Client IDs"
- Choose "Desktop application"
- Download the credentials JSON file
3. Environment Configuration
-
Copy the example environment file:
cp env.example .env -
Edit
.envand add your Google OAuth2 credentials:GOOGLE_CLIENT_ID=your_client_id_here GOOGLE_CLIENT_SECRET=your_client_secret_here GOOGLE_REDIRECT_URI=http://localhost:3000/oauth2callback
4. Authentication
-
Start the server:
npm start -
The server will display an authentication URL. Visit this URL in your browser.
-
After granting permissions, you'll receive an authorization code.
-
Authenticate using the code:
node index.js auth YOUR_AUTHORIZATION_CODE -
The token will be saved and you can now use the server normally.
Usage
Available Tools
- check_meetings_this_week: Returns a simple yes/no answer about whether you have meetings this week
- list_meetings_this_week: Provides detailed information about all meetings scheduled for the current week
- authenticate_google_calendar: Authenticate with Google Calendar using an authorization code
Running the Server
npm start
Or for development with auto-restart:
npm run dev
How It Works
- Week Definition: The server considers a week from Sunday to Saturday
- Meeting Detection: Filters out all-day events, busy blocks, and focus time events
- Time Zone: Uses your system's local time zone for date calculations
- Authentication: Uses OAuth2 with offline access to maintain authentication across sessions
Security
- OAuth2 tokens are stored locally in
token.json - Only read-only access to your calendar is requested
- No calendar data is stored or transmitted outside of Google's servers
Troubleshooting
Authentication Issues
- Ensure your OAuth2 credentials are correctly configured
- Check that the redirect URI matches what's configured in Google Cloud Console
- Verify that the Google Calendar API is enabled in your project
No Meetings Found
- Check that you have meetings scheduled in your primary calendar
- Verify the time zone settings
- Ensure meetings are not marked as all-day events
Permission Errors
- Make sure you granted the necessary permissions during OAuth flow
- Check that the Calendar API is enabled in your Google Cloud project
License
MIT