Google Calendar MCP Server
Enables management of dental appointments through Google Calendar integration. Supports booking, canceling, rescheduling appointments, checking availability, and finding next available slots through natural language.
README
Google Calendar MCP Server
A Model Context Protocol (MCP) server for managing dental appointments through Google Calendar. Built specifically for Railway deployment with clean, production-ready code.
Features
- Appointment Management: Book, cancel, and reschedule dental appointments
- Availability Checking: Check available time slots for specific dates
- Calendar Integration: Full Google Calendar API integration
- MCP Protocol: Compatible with MCP clients and AI assistants
- Railway Ready: Optimized for Railway deployment
Available Tools
- check_availability - Check available appointment slots for a specific date and time range
- book_appointment - Book a new dental appointment
- cancel_appointment - Cancel an existing appointment
- reschedule_appointment - Reschedule an existing appointment
- get_appointments - Get appointments for a specific date range
- find_next_available - Find the next available appointment slot
Setup
Prerequisites
- Google Cloud Console project with Calendar API enabled
- OAuth 2.0 credentials configured
- Python 3.11+ (for local development)
Google Cloud Setup
- Go to Google Cloud Console
- Create a new project or select existing one
- Enable the Google Calendar API
- Go to "Credentials" and create OAuth 2.0 Client ID
- Configure OAuth consent screen
- Download the credentials JSON file
Environment Variables
Copy env.example to .env and fill in your credentials:
cp env.example .env
Required environment variables:
GOOGLE_CLIENT_ID- Your Google OAuth client IDGOOGLE_CLIENT_SECRET- Your Google OAuth client secretGOOGLE_ACCESS_TOKEN- OAuth access token (obtained through OAuth flow)GOOGLE_REFRESH_TOKEN- OAuth refresh token (obtained through OAuth flow)GOOGLE_CALENDAR_ID- Calendar ID (use 'primary' for main calendar)PORT- Server port (default: 8000)
OAuth Token Generation
To get the access and refresh tokens, you'll need to run the OAuth flow. Here's a simple script to help:
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import pickle
import os
SCOPES = ['https://www.googleapis.com/auth/calendar']
def get_credentials():
creds = None
if os.path.exists('token.pickle'):
with open('token.pickle', 'rb') as token:
creds = pickle.load(token)
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(
'credentials.json', SCOPES)
creds = flow.run_local_server(port=0)
with open('token.pickle', 'wb') as token:
pickle.dump(creds, token)
print(f"Access Token: {creds.token}")
print(f"Refresh Token: {creds.refresh_token}")
print(f"Client ID: {creds.client_id}")
print(f"Client Secret: {creds.client_secret}")
if __name__ == '__main__':
get_credentials()
Local Development
- Install dependencies:
pip install -r requirements.txt
-
Set up environment variables (see above)
-
Run the server:
python main.py
The server will be available at http://localhost:8000
Railway Deployment
- Connect your GitHub repository to Railway
- Set the environment variables in Railway dashboard
- Railway will automatically build and deploy using the Dockerfile
Railway Environment Variables
Set these in your Railway project dashboard:
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGOOGLE_ACCESS_TOKENGOOGLE_REFRESH_TOKENGOOGLE_CALENDAR_ID(optional, defaults to 'primary')
API Endpoints
Health Check
GET /health- Simple health checkGET /status- Detailed status with service availability
MCP Tools
GET /tools- List available toolsPOST /tools- Execute tool calls
Example Tool Call
curl -X POST "https://your-railway-app.railway.app/tools" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "check_availability",
"params": {
"date": "2024-01-15",
"start_time": "09:00",
"end_time": "17:00",
"duration": 60
}
}'
Project Structure
dental-calendar-mcp-clean/
├── main.py # Main FastAPI application
├── requirements.txt # Python dependencies
├── Dockerfile # Docker configuration
├── railway.json # Railway deployment config
├── env.example # Environment variables template
└── README.md # This file
Error Handling
The server includes comprehensive error handling:
- OAuth credential validation
- Google Calendar API error handling
- Input validation for all tool parameters
- Proper HTTP status codes and error messages
Security Notes
- Never commit OAuth credentials to version control
- Use environment variables for all sensitive data
- The server includes CORS middleware for web integration
- All API endpoints are properly validated
License
This project is open source and available under the MIT License.
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.