About Booking System (Fixed)
Booking System (Fixed) is a booking application for Andriana Delcheva, designed to run on Cloudflare Workers. It combines Google Calendar availability checks and event creation with email confirmations and optional MCP-backed processing.
Key features
- 01Multi-step booking flow
- 02Check Google Calendar availability
- 03Create Google Calendar events
- 04Send booking confirmation emails
- 05Responsive mobile and desktop design
- 06Report events and errors through MCP
Use cases
- 01Check open slots before booking
- 02Create a calendar event after a booking
- 03Send customers appointment details
- 04Forward booking events and errors to MCP
MCP support
The application can send availability, booking, email, calendar, and error events to an MCP server. When configured, it can also delegate the booking process to MCP.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEBooking System (Fixed)
This repository contains the fixed version of the booking system for Andriana Delcheva, addressing several critical issues with the previous implementation. The system is designed to run on Cloudflare Workers and integrates with Google Calendar and MCP Servers.
🛠️ Fixed Issues
This implementation resolves the following issues that were present in the original system:
- Fixed Booking Completion - Users can now successfully select a date and complete bookings.
- Fixed Confirmation Emails - Email confirmations are now sent after successful bookings.
- Fixed Google Calendar Integration - Bookings now create events in Google Calendar.
- Implemented Availability Checking - The system checks for available slots before confirming bookings.
- Implemented MCP Server Integration - Backend processing uses MCP Servers for enhanced functionality.
🌟 Key Features
- Multi-step Booking Process - Intuitive step-by-step booking flow for better UX
- Real-time Availability Checking - Checks Google Calendar for conflicts
- Automated Email Confirmations - Sends details to the customer
- Google Calendar Integration - Creates calendar events with service details
- MCP Server Integration - Tracks booking events and provides enhanced processing
- Comprehensive Error Handling - Provides meaningful feedback to users
- Responsive Design - Works on mobile and desktop devices
🚀 Deployment
Prerequisites
- Cloudflare Workers account
- Google Cloud project with Calendar API enabled
- Google service account with access to the Calendar
- MCP Server for backend processing
Setup Instructions
- Clone the repository
git clone https://github.com/Konstrex/booking-system-fixed.git
cd booking-system-fixed
- Install dependencies
npm install
- Configure environment variables
The following environment variables need to be set either in the wrangler.toml file or using Cloudflare's secrets:
-
Google Calendar Integration
GOOGLE_CLIENT_EMAIL- Already configured to "[email protected]"GOOGLE_PRIVATE_KEY- Your service account private keyGOOGLE_CALENDAR_ID- The ID of the calendar to use
-
Email Configuration
EMAIL_FROM- Email address to send confirmations fromBUSINESS_NAME- Name of the business (already set to "Andriana Delcheva")BUSINESS_EMAIL- Business email for reply-to
-
MCP Server Integration
MCP_ENABLED- Set to "true" to enable MCP integrationMCP_SERVER_URL- URL of the MCP serverMCP_API_KEY- API key for authenticating with the MCP server
- Set secrets using Wrangler
For sensitive information, use Wrangler's secret management:
wrangler secret put GOOGLE_PRIVATE_KEY
wrangler secret put GOOGLE_CALENDAR_ID
wrangler secret put MCP_SERVER_URL
wrangler secret put MCP_API_KEY
- Deploy to Cloudflare Workers
npm run deploy:prod
📝 Google Calendar Setup
To ensure the Google Calendar integration works properly:
-
Ensure the service account has appropriate permissions by adding it to your Google Calendar:
- Open Google Calendar
- Go to Calendar Settings
- Under "Share with specific people," add the service account email:
[email protected] - Set permissions to "Make changes and manage sharing"
-
The JWT authentication is configured to use the correct token_uri:
https://oauth2.googleapis.com/token
📧 Email Configuration
The system uses MCP Servers for handling email notifications. After a successful booking, an email is sent containing:
- Subject: "Booking Confirmation"
- Appointment details (date, time, service)
- Google Calendar link
- Booking reference number
🤖 MCP Server Integration
MCP Servers are used for enhanced functionality:
-
Event Notifications - MCP is notified about key events:
- Availability checks
- Booking creations
- Email confirmations
- Calendar event creations
-
Error Handling - MCP receives detailed error information for monitoring and debugging.
-
Booking Processing - The system can offload the entire booking process to MCP if configured.
🧪 Testing
To test the system locally:
npm run dev:local
For end-to-end testing:
- Select a date and service
- Check available time slots
- Enter customer details
- Complete the booking
- Verify the appointment appears in Google Calendar
- Confirm the confirmation email is received
📚 Technical Implementation Details
Fixed Booking Flow
The booking flow has been completely reworked to ensure a single API request is made when booking. Key improvements:
- Multi-step form with validation at each step
- Single API call for the final booking request
- Clear error messages for failed bookings
- Loading indicators during API calls
Fixed Google Calendar Integration
The Google Calendar integration now:
- Uses proper JWT authentication with the service account
- Checks for existing events before booking
- Creates detailed calendar events with all booking information
- Properly formats dates and times
- Includes attendees and reminders
Enhanced Error Handling
Comprehensive error handling has been implemented:
- Validation errors with specific messages
- Network error handling with retry options
- Server error logging with MCP integration
- User-friendly error messages
📋 API Endpoints
Check Availability
POST /api/availability
Request body:
{
"date": "2025-03-15",
"duration": 60
}
Response:
{
"success": true,
"availableSlots": [
{ "startTime": "09:00", "endTime": "10:00" },
{ "startTime": "10:00", "endTime": "11:00" },
/* ... */
]
}
Book Appointment
POST /api/book
Request body:
{
"name": "John Doe",
"email": "[email protected]",
"phone": "+1234567890",
"date": "2025-03-15",
"time": "10:00",
"services": [
{
"name": "Massage",
"duration": 60,
"price": 80
}
],
"notes": "Optional notes",
"agreed": true
}
Response:
{
"success": true,
"message": "Booking created successfully",
"bookingId": "BK-JOHNDO-123456",
"eventId": "calendar_event_id"
}
🔄 Continuous Improvement
Future improvements could include:
- Adding a dashboard for managing bookings
- Implementing booking cancellation/rescheduling
- Adding payment integration
- Creating a customer account system
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.