Customer-focused MCP Server for appointment management with comprehensive service discovery, availability checking, and booking capabilities
npm install appointment-mcp-serverA comprehensive Model Context Protocol (MCP) server for managing appointments, staff, and business operations, built with Node.js and TypeScript.
- Node.js version 16 or higher
- npm or yarn package manager
- PostgreSQL database (local or cloud)
1. Install dependencies:
``bash`
npm install
2. Build the project:
`bash`
npm run build
This server is designed to be configured through MCP client settings. Environment variables are passed through the MCP configuration rather than using a .env file.
Required environment variables:
- DATABASE_URL: Your PostgreSQL connection stringBUSINESS_ID
- : Default business ID (can be overridden per tool call)
Note: Business IDs are passed dynamically as parameters to each tool call, allowing the server to handle multiple businesses without hardcoded configuration.
`bash`
npm start
Or for development:
`bash`
npm run dev
To use this server with Claude Desktop or other MCP clients, add the following configuration to your MCP settings:
`json`
{
"mcpServers": {
"appointment-mcp": {
"command": "node",
"args": [
"/path/to/appointment_mcp/build/index.js"
],
"env": {
"DATABASE_URL": "postgresql://username:password@localhost:5432/database",
"BUSINESS_ID": "your-default-business-id"
}
}
}
}
Or using npx (recommended for published packages):
`json`
{
"mcpServers": {
"appointment-mcp": {
"command": "npx",
"args": [
"-y",
"appointment-mcp-server@latest"
],
"env": {
"DATABASE_URL": "postgresql://username:password@localhost:5432/database",
"BUSINESS_ID": "your-default-business-id"
}
}
}
}
For local development, you can run the server directly:
`bash`
npm start
Or for development with auto-rebuild:
`bash`
npm run dev
Note: When running locally for development, you'll need to set environment variables manually or use a .env file.
#### 1. create_appointment
Create a new appointment for a specific business.
Parameters:
- business_id (string, optional): The ID of the businesstitle
- (string, required): The title of the appointmentdate
- (string, required): The date in YYYY-MM-DD formattime
- (string, required): The time in HH:MM formatdescription
- (string, optional): Optional descriptioncustomer_id
- (string, optional): Customer IDservice_id
- (string, optional): Service IDstaff_id
- (string, optional): Staff member ID
#### 2. list_appointments
List all appointments for a specific business.
Parameters:
- business_id (string, optional): The ID of the businessstatus
- (string, optional): Filter by status (confirmed, pending, completed, cancelled)date
- (string, optional): Filter by date (YYYY-MM-DD)
#### 3. get_appointment
Get details of a specific appointment for a business.
Parameters:
- business_id (string, optional): The ID of the businessid
- (string, required): The ID of the appointment
#### 4. delete_appointment
Delete an appointment for a specific business.
Parameters:
- business_id (string, optional): The ID of the businessid
- (string, required): The ID of the appointment to delete
#### 5. get_staff_availability
Get staff availability for a specific date.
Parameters:
- business_id (string, optional): The ID of the businessdate
- (string, required): The date to check availability (YYYY-MM-DD format)
Returns: Staff members with their working hours, availability status, and time off information.
#### 6. get_all_staff_info
Get detailed information about all staff members.
Parameters:
- business_id (string, optional): The ID of the business
Returns: Comprehensive staff information including services provided, working hours, and appointment counts.
#### 7. get_staff_member
Get detailed information about a specific staff member.
Parameters:
- business_id (string, optional): The ID of the businessstaff_id
- (string, required): The staff member ID
Returns: Detailed staff information including services, working hours, and appointment history.
#### 8. get_staff_time_off
Get staff time off for a specific date range.
Parameters:
- business_id (string, optional): The ID of the businessstart_date
- (string, optional): Start date for time off (YYYY-MM-DD format)end_date
- (string, optional): End date for time off (YYYY-MM-DD format)
#### 9. get_available_time_slots
Get available time slots for a specific service on a date.
Parameters:
- business_id (string, optional): The ID of the businessservice_id
- (string, required): The service IDdate
- (string, required): The date to check availability (YYYY-MM-DD format)
Returns: Available time slots with staff information and booking capacity.
#### 10. create_customer
Create a new customer profile.
Parameters:
- business_id (string, optional): The ID of the businessfirst_name
- (string, required): Customer's first namelast_name
- (string, required): Customer's last nameemail
- (string, required): Customer's email addressphone_number
- (string, optional): Customer's phone number
#### 11. get_customer
Get customer details by ID.
Parameters:
- business_id (string, optional): The ID of the businesscustomer_id
- (string, required): The customer ID
#### 12. search_customers
Search customers by name, email, or phone.
Parameters:
- business_id (string, optional): The ID of the businessquery
- (string, required): Search query
#### 13. update_customer
Update customer information.
Parameters:
- business_id (string, optional): The ID of the businesscustomer_id
- (string, required): The customer IDfirst_name
- (string, optional): Updated first namelast_name
- (string, optional): Updated last nameemail
- (string, optional): Updated emailphone_number
- (string, optional): Updated phone number
#### 14. get_customer_appointments
Get all appointments for a specific customer.
Parameters:
- business_id (string, optional): The ID of the businesscustomer_id
- (string, required): The customer ID
#### 15. get_customer_reviews
Get reviews submitted by a customer.
Parameters:
- business_id (string, optional): The ID of the businesscustomer_id
- (string, required): The customer ID
#### 16. create_review
Create a new review for an appointment.
Parameters:
- business_id (string, optional): The ID of the businessappointment_id
- (string, required): The appointment IDrating
- (number, required): Rating (1-5)comment
- (string, optional): Review comment
#### 17. get_business_details
Get details of a specific business by business ID.
Parameters:
- business_id (string, required): The business ID to retrieve details for
#### 18. get_business_hours
Get business operating hours.
Parameters:
- business_id (string, optional): The ID of the business
#### 19. get_services
Get all services offered by a business.
Parameters:
- business_id (string, optional): The ID of the business
#### 20. get_service
Get details of a specific service.
Parameters:
- business_id (string, optional): The ID of the businessservice_id
- (string, required): The service ID
The server uses a comprehensive PostgreSQL schema that includes:
- businesses: Business information and configuration
- staff: Staff member profiles and details
- customers: Customer profiles and contact information
- services: Service offerings with pricing and duration
- appointments: Appointment bookings and scheduling
- staff_working_hours: Staff availability schedules
- staff_time_off: Staff time off and vacation tracking
- staff_services: Staff service assignments
- reviews: Customer reviews and ratings
See database_schema.sql for the complete schema definition.
``
appointment_mcp/
├── src/
│ ├── index.ts # Main server implementation and tool definitions
│ └── database.ts # Database operations and queries
├── build/ # Compiled JavaScript output
├── database_schema.sql # Complete database schema
├── customer_inquiry_prompt.md # Customer service prompts
├── customer_inquiry_resources.md # Customer service resources
├── mcp-config-example.json # Example MCP configuration
├── test-availability-tools.js # Test script for new tools
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This file
`bash`
npm run build
Run the test script to verify the new availability tools:
`bash`
node test-availability-tools.js
- This server uses STDIO transport, so avoid using console.log() in the code as it will corrupt JSON-RPC messagesconsole.error()` for logging instead
- Use
- All data is stored persistently in PostgreSQL database
- Date format must be YYYY-MM-DD
- Time format must be HH:MM (24-hour format)
- Environment variables must be configured through MCP client settings
- Business IDs are scoped to ensure multi-tenant security
MIT License - see LICENSE file for details.
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request
For issues and questions:
- GitHub Issues: https://github.com/arimunandar/appointment-mcp-server/issues
- NPM Package: https://www.npmjs.com/package/appointment-mcp-server