MCP server for Google Calendar
Credentials
The credentials.json file is needed to authenticate againts the Google services.
To generate the file, the following steps must be performed:
- Visit the Google Cloud Platform website
- Crete a new project (or use an existant one)
- Into the APIs & Services section, enable the Google Calendar API service
- Go to Credentials and generate a new credential as Service Account
- Copy the service account's email generated. It will be needed to share the calendar with it
- After the credential is created, a JSON file will be able to download. Place it into the root of this project and name it as
credentials.json
Calendar sharing
To interact with a calendar, it needs to be shared with the service account previously created to access it following these steps:
- Visit the Google Calendar website
- Into the sidebar, place on the target calendar, click the three dots (...) and then go to Settings and sharing
- Go the Shared with and add the email address for the service account copied previously when the credential was created
- Go to Integrate calendar and copy the Calendar ID value
Inspector
While developing, you can use the inspector to debug the server. To do this:
npm run inspector
Build MCP Server
Before adding the MCP server to the configuration file, you need to build it. The build process will create a Docker image that can be run in WSL.
npm run build
docker build -t mcpserver-googlecalendar .
Add MCP Server
To add the MCP server, add to the configuration file and paste the Calendar ID copied previously:
{
"mcpServers": {
"google-calendar": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"GOOGLE_CALENDAR_ID",
"mcpserver-googlecalendar"
],
"env": {
"GOOGLE_CALENDAR_ID": "[CALENDAR_ID_HERE]"
}
}
}
}