Doctor Appointment MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Doctor Appointment MCP ServerSchedule a doctor appointment for Sarah Lee with Dr. Smith on May 12 at 3 PM."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Doctor Appointment MCP Server
A Python-based Model Context Protocol (MCP) server for managing doctor appointments through an external appointment REST API.
The server exposes appointment-management operations as MCP tools so an MCP-compatible AI agent or client can create, find, retrieve, cancel, and reschedule appointments.
What It Does
The server provides five MCP tools:
Tool | Description |
| Creates a new doctor appointment. |
| Finds appointments by patient name, doctor name, and/or appointment date. |
| Retrieves appointment details and status by appointment ID. |
| Cancels an appointment by changing its status to |
| Changes the date and time of an existing appointment. |
The server also includes:
Streamable HTTP MCP endpoint at
/mcpHealth endpoints at
/and/healthOptional custom HTTP-header authentication
An external REST API backend configured through
APPOINTMENTS_APIAsync HTTP requests using
httpx
Related MCP server: MCP Appointment Booking Server
Architecture
AI Agent / MCP Client
|
| Model Context Protocol
v
/mcp endpoint
|
v
Uvicorn
|
v
Starlette
|
v
FastMCP
|
+------+------+------+------+------+
| | | | |
v v v v v
Create Find Check Cancel Reschedule
| | | | |
+------+------+------+------+------+
|
v
HTTPX Client
|
| REST API
v
Appointment Backend
(MockAPI by default)Project Structure
doctor-appointment-mcp/
├── server.py
├── requirements.txt
├── start.sh
├── run.sh
├── README.md
├── .gitignore
└── .gitattributesRequirements
Python 3.11 or newer recommended
pipAn appointment REST API endpoint
Python dependencies are defined in requirements.txt:
fastmcp>=3.0
uvicorn[standard]>=0.30
httpx>=0.27Local Setup
1. Clone the repository
git clone https://github.com/josh747jr/doctor-appointment-mcp.git
cd doctor-appointment-mcp2. Create a virtual environment
Windows PowerShell:
python -m venv .venv
.\.venv\Scripts\Activate.ps1Linux/macOS/WSL:
python3 -m venv .venv
source .venv/bin/activate3. Install dependencies
pip install -r requirements.txt4. Configure the appointment API
Set APPOINTMENTS_API to the REST endpoint that stores appointment records.
Windows PowerShell:
$env:APPOINTMENTS_API="https://YOUR-API-ENDPOINT/appointments"Linux/macOS/WSL:
export APPOINTMENTS_API="https://YOUR-API-ENDPOINT/appointments"If APPOINTMENTS_API is not set, the current server.py uses its configured MockAPI endpoint.
Do not commit API keys, credentials, or other secrets to the repository.
Run the Server Locally
Start Uvicorn:
python -m uvicorn server:app --host 127.0.0.1 --port 8000The MCP endpoint will be:
http://127.0.0.1:8000/mcpThe health endpoint will be:
http://127.0.0.1:8000/healthA successful health check returns:
okMCP Tools
1. create_appointment
Creates a new doctor appointment.
Inputs:
patient_namedoctor_nameappointment_dateappointment_timereason— optional
Example tool arguments:
{
"patient_name": "John Doe",
"doctor_name": "Dr. Mike",
"appointment_date": "2026-09-18",
"appointment_time": "2:00 PM",
"reason": "Annual physical"
}New appointments are stored with a status of scheduled.
Example user request:
Schedule an appointment for John Doe with Dr. Mike on September 18, 2026
at 2:00 PM for an annual physical.2. find_appointments
Finds one or more existing appointments when the appointment ID is not known.
Search inputs:
patient_name— optionaldoctor_name— optionalappointment_date— optionalinclude_cancelled— optional boolean, defaults tofalse
At least one of patient_name, doctor_name, or appointment_date must be provided.
Find appointments for a patient:
{
"patient_name": "John Doe"
}Find appointments for a patient and doctor:
{
"patient_name": "John Doe",
"doctor_name": "Dr. Mike"
}Find appointments on a particular date:
{
"appointment_date": "2026-09-18"
}The tool sends the supplied search fields as query parameters to the appointment REST API and returns the matching appointment records.
A successful result includes:
{
"success": true,
"message": "Found 1 matching appointment(s).",
"count": 1,
"appointments": [
{
"id": "12",
"patientName": "John Doe",
"doctorName": "Dr. Mike",
"appointmentDate": "2026-09-18",
"appointmentTime": "2:00 PM",
"reason": "Annual physical",
"status": "scheduled"
}
]
}If no records match, the tool returns a successful response with count set to 0 and an empty appointments array.
Example user requests:
Find my appointment with Dr. Mike.What appointments does John Doe have?Find John Doe's appointment on September 18, 2026.3. check_appointment_status
Retrieves an appointment by its ID.
Input:
appointment_id
Example:
{
"appointment_id": "12"
}A successful response includes the patient, doctor, appointment date, appointment time, reason, and status.
Example user request:
What is the status of appointment 12?4. cancel_appointment
Cancels an existing appointment.
Input:
appointment_id
Example:
{
"appointment_id": "12"
}Cancellation does not delete the appointment record. The server changes its status to:
cancelledKeeping the record preserves appointment history.
Example user request:
Cancel appointment 12.5. reschedule_appointment
Changes the date and time of an existing appointment.
Inputs:
appointment_idnew_appointment_datenew_appointment_time
Example:
{
"appointment_id": "12",
"new_appointment_date": "2026-09-21",
"new_appointment_time": "10:00 AM"
}Cancelled appointments cannot be rescheduled by the current implementation.
Example user request:
Move appointment 12 to September 21, 2026 at 10:00 AM.Appointment Data Model
The REST backend is expected to store records similar to:
{
"id": "12",
"patientName": "John Doe",
"doctorName": "Dr. Mike",
"appointmentDate": "2026-09-18",
"appointmentTime": "2:00 PM",
"reason": "Annual physical",
"status": "scheduled"
}The server uses REST operations equivalent to:
POST /appointments
GET /appointments
GET /appointments/{id}
PUT /appointments/{id}find_appointments uses GET /appointments with query parameters such as:
patientName
doctorName
appointmentDateExample Agent Workflow
A user may first ask:
Find my appointment with Dr. Mike.The MCP client can invoke:
find_appointments(patient_name="John Doe", doctor_name="Dr. Mike")After the matching record and appointment ID are found, the user can say:
Move that appointment to September 21 at 10 AM.The MCP client can then invoke:
reschedule_appointment(
appointment_id="12",
new_appointment_date="2026-09-21",
new_appointment_time="10:00 AM"
)This allows an AI agent to locate an appointment first instead of requiring the user to know the appointment ID.
Optional MCP Header Authentication
The server supports optional custom-header authentication through the MCP_REQUEST_HEADERS environment variable.
If the variable is not configured, custom-header authentication is disabled.
Simple header
Windows PowerShell:
$env:MCP_REQUEST_HEADERS="my-secret"Linux/macOS/WSL:
export MCP_REQUEST_HEADERS="my-secret"This configuration expects MCP requests to include a header named:
MCP_REQUEST_HEADERSwith the configured value.
Custom header name
The variable can also contain JSON:
export MCP_REQUEST_HEADERS='{"X-API-Key":"my-secret"}'The MCP client must then send:
X-API-Key: my-secretThe / and /health endpoints remain available without this custom authentication.
Security note: This project is a demonstration/learning implementation. A real healthcare application requires substantially stronger authentication, authorization, privacy controls, audit logging, secret management, data protection, and regulatory review before storing real patient information.
Deployment
The repository contains:
start.sh
run.shThese scripts can be used for a Linux-based deployment.
start.sh installs the required Python packages into the deployment dependency directory.
run.sh starts the application with Uvicorn and listens on the PORT environment variable, defaulting to port 8080.
Required deployment environment variable:
APPOINTMENTS_API=https://YOUR-API-ENDPOINT/appointmentsOptional authentication:
MCP_REQUEST_HEADERS=your-secretAfter deployment, the MCP endpoint will typically be:
https://YOUR-SERVER/mcpand the health endpoint:
https://YOUR-SERVER/healthTesting the Server
Start the application:
python -m uvicorn server:app --host 127.0.0.1 --port 8000Test the health endpoint:
curl http://127.0.0.1:8000/healthExpected response:
okThen configure an MCP-compatible client to connect to:
http://127.0.0.1:8000/mcpThe client should discover these five tools:
create_appointment
find_appointments
check_appointment_status
cancel_appointment
reschedule_appointmentPlanned Improvements
Useful next steps include:
Add doctor availability and time-slot lookup
Prevent conflicting or double-booked appointments
Add stronger date and time validation
Add a production database
Add OAuth or another production-grade authentication mechanism
Add automated tests
Add structured audit logging
Integrate with a real calendar or scheduling provider
Add production-grade patient identity and authorization controls
Development Status
This project is intended as an MCP development and learning project. The current appointment backend can later be replaced with a production scheduling service or database while preserving the MCP-facing tool interface.
Security and Healthcare Data
Do not use real patient information or protected health information (PHI) with an unsecured demonstration backend.
A production healthcare application may be subject to privacy, security, compliance, and data-retention requirements such as HIPAA in the United States.
Repository
https://github.com/josh747jr/doctor-appointment-mcp
License
No license has been specified for this repository yet. Add a LICENSE file before distributing or reusing the project under specific licensing terms.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with OnSched's consumer-facing appointment scheduling API through natural language, allowing users to manage bookings, appointments, and scheduling operations.
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables users to book, cancel, reschedule, and list appointments through natural language interactions. It uses YAML configurations for agent behavior and function logic to manage appointment data and availability.MIT
- AlicenseNot gradedqualityDmaintenanceEnables users to manage medical appointments by searching for doctors, checking availability, and booking sessions through a natural language interface. It serves as a reference implementation for advanced MCP features like symptom-based specialist recommendations and multi-step scheduling workflows.15MIT
- FlicenseNot gradedqualityCmaintenanceSimulates a third-party appointment booking agent, enabling your AI platform to check availability and book appointments via MCP interoperability.
Related MCP Connectors
Hosted Google Calendar MCP server for AI agents. No self-hosting or Google Cloud setup.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
An AI concierge that turns static forms into adaptive AI conversations. From any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/josh747jr/doctor-appointment-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server