Provides appointment scheduling functionality with PostgreSQL database storage, enabling creation and management of appointments with validation for names, identification numbers, phone numbers, and dates.
Appointment Scheduler MCP Server
A Model Context Protocol (MCP) server that connects to a PostgreSQL database to manage appointment scheduling. Built with FastMCP, SQLAlchemy, and Alembic for database migrations.
š Features
Database Integration: PostgreSQL database with SQLAlchemy ORM
MCP Protocol: Supports both stdio and HTTP transport modes
Database Migrations: Alembic for schema management and migrations
Appointment Management: Schedule appointments with validation
Docker Support: Containerized deployment with Docker Compose
Environment Configuration: Secure credential management with .env files
š Prerequisites
Python 3.13+
PostgreSQL database
uv package manager (recommended) or pip
š ļø Installation
Using uv (Recommended)
Using pip
āļø Configuration
Environment Variables
Create a .env file in the project root:
Database Setup
Using Docker Compose (Recommended):
docker-compose up -d postgresManual PostgreSQL Setup:
Install PostgreSQL
Create a database
Update
.envwith your database credentials
Database Migrations
Run database migrations to create the appointments table:
š Running the Server
Development Mode (stdio)
HTTP Mode
Set MCP_TRANSPORT=http in your .env file:
The server will be available at http://localhost:8000
Docker Deployment
š API Usage
MCP Tool: schedule_appointment
Schedules a new appointment in the database.
Parameters:
name(string): Full name of the person scheduling the appointmentidentification_number(string): Identification number (ID card, passport, etc.)phone(string): Phone numberdate(string): Appointment date and time in ISO format (YYYY-MM-DDTHH:MM:SS)
Example:
Response:
šļø Project Structure
š§ Development
Running Tests
Database Schema
The appointments table structure:
Adding New Features
Define new MCP tools in
main.pyUpdate database models if needed
Create Alembic migrations for schema changes
Update this README
š¤ Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
š License
This project is licensed under the MIT License - see the LICENSE file for details.
š Troubleshooting
Common Issues
Database Connection Error
Check your
.envfile configurationEnsure PostgreSQL is running
Verify database credentials
Migration Errors
Run
alembic currentto check migration statusRun
alembic upgrade headto apply pending migrations
MCP Transport Issues
For stdio mode: Ensure the MCP client supports stdio transport
For HTTP mode: Check that the port is not in use
Getting Help
Check the FastMCP documentation
Review SQLAlchemy documentation
Check Alembic documentation
š Version History
v1.0.0: Initial release with basic appointment scheduling functionality
Database integration with PostgreSQL
Docker containerization
MCP protocol support (stdio and HTTP)
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables scheduling and managing appointments through a PostgreSQL database, allowing users to create appointments with name, identification, phone number, and date information via natural language interactions.