GCal-mcp

GCal-mcp

A stateless Google Calendar MCP proxy that uses Baserow for OAuth management, enabling multi-tenant calendar operations via SSE transport.

Category
Visit Server

README

Stateless Google Calendar MCP Proxy

This is a heavily streamlined, stateless implementation of the Google Calendar Model Context Protocol (MCP) server, designed exclusively for headless integration with orchestrators like n8n.

By aggressively adhering to the "ponytail rule" (lazy senior dev: extreme simplicity, YAGNI, no speculative complexity), all stateful components—such as SQLite databases, embedded web interfaces, complex local multi-tenancy mappings, and internal token refreshing background jobs—have been stripped out.

Instead, this server acts as a thin, highly reliable proxy between the MCP standard and the Google Calendar API, leveraging an external Baserow database as the single source of truth for Google OAuth credentials.

Architecture

  • Stateless by Design: This application does not persist any local state.
  • HTTP/SSE Transport: Instead of using standard stdio (which lacks the ability to pass per-request metadata like headers in a multi-tenant environment), this server implements the MCP StreamableHTTPServerTransport. It listens on a specified port (default 3000) for standard HTTP-based MCP connections (e.g. /sse endpoint).
  • Context Injection: When n8n makes a request to execute a tool, it MUST inject the X-Baserow-Row-Id header (and optionally X-Timezone).
  • Async Context: The Node AsyncLocalStorage safely isolates the authentication context for each incoming request, preventing race conditions.
  • Baserow Auth Engine: Before a tool accesses Google Calendar, the handler fetches the X-Baserow-Row-Id from the context, securely pulls the Google OAuth credentials directly from Baserow via the REST API, instantiates a headless Google OAuth2Client, and performs the requested operation.

Prerequisites

  1. Baserow Database: A Baserow table configured with fields to store client_id, client_secret, access_token, refresh_token, and expiry_date.
  2. Environment Variables: Create a .env file containing the connection details for your Baserow instance:
    BASEROW_URL=https://api.baserow.io
    BASEROW_DATABASE_TOKEN=your_database_token_here
    BASEROW_TABLE_ID=your_table_id_here
    PORT=3000
    

Installation and Execution

# Install dependencies
npm ci

# Build the project
npm run build

# Start the server (runs on port 3000 by default)
npm start

Alternatively, use the provided Dockerfile to build and deploy to any container platform:

docker build -t gcal-mcp-stateless .
docker run -p 3000:3000 --env-file .env gcal-mcp-stateless

Integrating with n8n

When configuring the MCP node or the HTTP Client in your n8n workflow, you must connect to this server using the Server-Sent Events (SSE) / HTTP URL (e.g., http://localhost:3000/sse) and supply the following HTTP headers:

Header Required? Description
X-Baserow-Row-Id Yes The exact Row ID in your Baserow table containing the user's Google OAuth credentials.
X-Timezone No A standard IANA Timezone string (e.g., America/Los_Angeles). Defaults to UTC. Used for relative datetime calculations.

Because n8n will dynamically inject these headers for each execution based on the user running the workflow, this server seamlessly supports infinite users without requiring multi-tenancy logic.

Tools Available

This MCP server exposes the following Google Calendar tools. Note that account mapping parameters have been entirely removed; calendarId is directly passed as-is to the Google API.

  • list-calendars: Fetch calendars the authenticated user has access to.
  • list-events: Fetch events from a calendar.
  • search-events: Free-text search across a calendar.
  • get-event: Retrieve a specific event by ID.
  • create-event: Insert a new event.
  • create-events: Bulk insert multiple events.
  • update-event: Patch an existing event.
  • delete-event: Remove an event.
  • get-freebusy: Check free/busy availability.
  • get-current-time: Helpful for LLMs to understand the relative local time.
  • respond-to-event: Accept, decline, or mark tentative for invitations.

Developer Note (Ponytail Architecture)

If you are extending this server:

  1. Do not add state.
  2. Do not add caching layers for tokens; let Baserow handle the data persistence. If performance becomes an issue, implement caching at the n8n layer.
  3. Keep handlers simple. Extract data from this.getClient(), use googleapis, format the response, and return.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured