A Model Context Protocol (MCP) server for the DrChrono healthcare API, providing tools for patient management, appointments, clinical notes, billing, and FHIR R4 interoperability.
- OAuth 2.0 Authentication - Secure authorization flow with automatic token refresh
- Patient Management - Search, create, and update patient records
- Appointments - Schedule, update, and query appointments
- Clinical Notes - Read and update clinical documentation
- Health Records - Access medications, allergies, problems, and immunizations
- Billing - Check eligibility, view charges and transactions
- Lab & Imaging - Retrieve lab results and uploaded documents
- FHIR R4 - Standardized healthcare data access via ConnectEHR
- Clinical Inbox Autopilot - Build a local physician voice graph from sent messages and draft voice-grounded inbox replies
- DrChrono Account with API access
- Python 3.11+
- uv (recommended) or pip
# Clone the repository
git clone https://github.com/yourusername/dr-chrono-mcp.git
cd dr-chrono-mcp
# Install with uv (recommended)
uv sync
# Or with pip
pip install -e .- Log in to DrChrono
- Go to Account > API
- Click New Application
- Set:
- Name: Your app name
- Redirect URI:
http://localhost:8765/callback
- Save and copy your Client ID and Client Secret
Copy the example file and add your credentials:
cp .env.example .envEdit .env:
DRCHRONO_CLIENT_ID=your_client_id
DRCHRONO_CLIENT_SECRET=your_client_secret
DRCHRONO_REDIRECT_URI=http://localhost:8765/callbackFor FHIR R4 tools, set up ConnectEHR:
- Go to Account > API > ConnectEHR Setup for FHIR
- Complete the setup form
- Add to
.env:
DRCHRONO_FHIR_BASE_URL=https://your-practice.dynamicfhir.com/fhir/r4
DRCHRONO_FHIR_CLIENT_ID=fhir_client_id
DRCHRONO_FHIR_CLIENT_SECRET=fhir_client_secretAdd to your claude_desktop_config.json:
{
"mcpServers": {
"drchrono": {
"command": "uv",
"args": ["--directory", "/path/to/dr-chrono-mcp", "run", "drchrono-mcp"],
"env": {
"DRCHRONO_CLIENT_ID": "your_client_id",
"DRCHRONO_CLIENT_SECRET": "your_client_secret"
}
}
}
}# Run the server directly
uv run drchrono-mcp
# Or with environment variables
DRCHRONO_CLIENT_ID=xxx DRCHRONO_CLIENT_SECRET=yyy uv run drchrono-mcp- Use the
drchrono_auth_statustool to check authentication - If not authenticated, visit the provided
auth_urlin a browser - Log in to DrChrono and authorize the application
- Tokens are automatically saved and refreshed
| Tool | Description |
|---|---|
drchrono_auth_status |
Check OAuth status, get auth URL |
drchrono_start_auth |
Start browser-based authorization |
drchrono_logout |
Clear stored credentials |
| Tool | Description |
|---|---|
drchrono_get_patient_summary |
Get patient with demographics, insurance, appointments |
drchrono_search_patients |
Search by name, DOB, email |
drchrono_create_patient |
Create new patient |
drchrono_update_patient |
Update demographics |
drchrono_get_appointments |
List appointments with filters |
drchrono_create_appointment |
Schedule appointment |
drchrono_update_appointment |
Update/cancel appointment |
drchrono_get_clinical_note |
Get note for appointment |
drchrono_add_clinical_note |
Update clinical note |
drchrono_get_patient_health_record |
Get meds, allergies, problems, vaccines |
| Tool | Description |
|---|---|
drchrono_check_eligibility |
Verify insurance coverage |
drchrono_get_billing_summary |
Charges, payments, balance |
drchrono_list_transactions |
Payment transactions |
| Tool | Description |
|---|---|
drchrono_get_lab_results |
Patient lab results |
drchrono_list_documents |
Uploaded documents |
drchrono_get_ccda |
Export CCDA XML |
| Tool | Description |
|---|---|
drchrono_fhir_get_patient |
FHIR Patient resource |
drchrono_fhir_search |
Search any FHIR resource |
drchrono_fhir_get_capability_statement |
Server capabilities |
drchrono_fhir_patient_everything |
All patient data |
| Tool | Description |
|---|---|
drchrono_inbox_status |
Check whether the inbox corpus and voice graph are ready |
drchrono_inbox_build_voice_graph |
Build/rebuild the response graph from synthetic or live sent messages |
drchrono_inbox_draft_reply |
Retrieve voice exemplars and likely next action for an incoming inbox item |
The inbox tools are synthetic-first and run without live credentials by default. Live corpus builds
require DrChrono OAuth credentials and local authorization. Message bodies are PHI; keep generated
.inbox_data/ artifacts local and never commit them. See
docs/clinical-inbox-endpoint-inventory.md for the
message-center endpoint map and next implementation steps.
Use drchrono_get_appointments with date="2024-01-15"
1. drchrono_search_patients with last_name="Smith"
2. drchrono_update_patient with patient_id and new email
1. drchrono_search_patients to find patient
2. drchrono_check_eligibility with patient_id
drchrono_fhir_patient_everything with patient_id
# Synthetic corpus, no credentials required
uv run python -m drchrono_mcp.inbox.cli synth --n 60
uv run python -m drchrono_mcp.inbox.cli build-graph
uv run python -m drchrono_mcp.inbox.cli retrieve- Tokens are stored in
~/.drchrono/tokens.jsonwith restricted permissions (600) - Never commit
.envor token files to version control - HIPAA: Access only data you're authorized to view
- Token refresh happens automatically before expiry
Run drchrono_auth_status and follow the authorization flow.
The server handles 429 responses automatically with backoff. For bulk operations, use appropriate date ranges.
FHIR requires separate ConnectEHR setup. See Configuration section.
Delete ~/.drchrono/tokens.json and re-authenticate.
# Install dev dependencies
uv sync --dev
# Run linting
uv run ruff check src/
# Format code
uv run ruff format src/MIT