Athena Health MCP Server
Enables interaction with Athena Health's API for comprehensive healthcare practice management. Supports appointment scheduling, provider and department management, patient search, and available slot discovery through natural language.
README
Athena Health MCP Server
A Model Context Protocol (MCP) server for integrating with Athena Health's API to manage appointments, providers, departments, and patient data.
Overview
This MCP server provides tools for:
- Appointment management (create, update, cancel, view)
- Provider and department information
- Patient search functionality
- Available appointment slot discovery
Setup
Prerequisites
- Python 3.8+
- Required environment variables:
ATHENA_CLIENT_ID: Your Athena Health API client IDATHENA_CLIENT_SECRET: Your Athena Health API client secretATHENA_PRACTICE_ID: Your practice IDATHENA_BASE_URL: (Optional) API base URL (defaults to production)
Installation
- Install dependencies:
pip install aiohttp python-dotenv mcp
- Set environment variables:
export ATHENA_CLIENT_ID='your_client_id'
export ATHENA_CLIENT_SECRET='your_client_secret'
export ATHENA_PRACTICE_ID='your_practice_id'
export ATHENA_BASE_URL='https://api.athenahealth.com' # Optional
- Run the server:
python main.py
Available Tools
1. get_appointments
Retrieve appointments for a specific date range with optional filtering.
Parameters:
start_date(required): Start date in YYYY-MM-DD formatend_date(required): End date in YYYY-MM-DD formatprovider_id(optional): Provider ID to filter appointmentsdepartment_id(optional): Department ID to filter appointments
Example:
{
"start_date": "2024-01-01",
"end_date": "2024-01-31",
"provider_id": "12345"
}
2. get_available_slots
Get available appointment slots for scheduling.
Parameters:
provider_id(required): Provider IDdepartment_id(required): Department IDappointment_type_id(required): Appointment type IDstart_date(required): Start date in YYYY-MM-DD formatend_date(required): End date in YYYY-MM-DD format
Example:
{
"provider_id": "12345",
"department_id": "67890",
"appointment_type_id": "11111",
"start_date": "2024-01-01",
"end_date": "2024-01-31"
}
3. create_appointment
Create a new appointment.
Parameters:
patient_id(required): Patient IDprovider_id(required): Provider IDdepartment_id(required): Department IDappointment_type_id(required): Appointment type IDappointment_date(required): Appointment date in YYYY-MM-DD formatappointment_time(required): Appointment time in HH:MM formatreason_for_visit(optional): Reason for the visit
Example:
{
"patient_id": "99999",
"provider_id": "12345",
"department_id": "67890",
"appointment_type_id": "11111",
"appointment_date": "2024-01-15",
"appointment_time": "14:30",
"reason_for_visit": "Annual checkup"
}
4. update_appointment
Update an existing appointment.
Parameters:
appointment_id(required): Appointment ID to updateappointment_date(optional): New appointment date in YYYY-MM-DD formatappointment_time(optional): New appointment time in HH:MM formatreason_for_visit(optional): Updated reason for the visitnotes(optional): Additional notes
Example:
{
"appointment_id": "55555",
"appointment_date": "2024-01-16",
"appointment_time": "15:00",
"reason_for_visit": "Follow-up appointment",
"notes": "Patient requested time change"
}
5. cancel_appointment
Cancel an appointment.
Parameters:
appointment_id(required): Appointment ID to cancelcancellation_reason(optional): Reason for cancellation
Example:
{
"appointment_id": "55555",
"cancellation_reason": "Patient requested cancellation"
}
6. get_providers
Get list of providers with optional filtering.
Parameters:
department_id(optional): Department ID to filter providersspecialty(optional): Specialty to filter providers
Example:
{
"department_id": "67890",
"specialty": "Cardiology"
}
7. get_departments
Get list of all departments.
Parameters: None
Example:
{}
8. get_appointment_types
Get available appointment types with optional filtering.
Parameters:
department_id(optional): Department ID to filter appointment typesprovider_id(optional): Provider ID to filter appointment types
Example:
{
"department_id": "67890",
"provider_id": "12345"
}
9. search_patients
Search for patients by various criteria.
Parameters:
first_name(optional): Patient first namelast_name(optional): Patient last namedate_of_birth(optional): Date of birth in YYYY-MM-DD formatphone(optional): Phone numberemail(optional): Email address
Example:
{
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1990-01-01"
}
API Endpoints
The server interacts with the following Athena Health API endpoints:
POST /oauth2/v1/token- AuthenticationGET /v1/{practice_id}/appointments- Get appointmentsGET /v1/{practice_id}/appointments/open- Get available slotsPOST /v1/{practice_id}/appointments- Create appointmentPUT /v1/{practice_id}/appointments/{id}- Update appointmentGET /v1/{practice_id}/providers- Get providersGET /v1/{practice_id}/departments- Get departmentsGET /v1/{practice_id}/appointmenttypes- Get appointment typesGET /v1/{practice_id}/patients- Search patients
Authentication
The server automatically handles OAuth2 authentication using client credentials flow. Tokens are cached and refreshed as needed.
Error Handling
The server includes comprehensive error handling for:
- Authentication failures
- API request failures
- Invalid parameters
- Network errors
All errors are logged and returned as part of the tool response.
Usage Examples
Complete Workflow Example
- Get departments:
{"tool": "get_departments", "arguments": {}}
- Get providers in a department:
{"tool": "get_providers", "arguments": {"department_id": "67890"}}
- Get appointment types:
{"tool": "get_appointment_types", "arguments": {"department_id": "67890"}}
- Search for available slots:
{
"tool": "get_available_slots",
"arguments": {
"provider_id": "12345",
"department_id": "67890",
"appointment_type_id": "11111",
"start_date": "2024-01-01",
"end_date": "2024-01-31"
}
}
- Search for a patient:
{
"tool": "search_patients",
"arguments": {
"first_name": "John",
"last_name": "Doe"
}
}
- Create an appointment:
{
"tool": "create_appointment",
"arguments": {
"patient_id": "99999",
"provider_id": "12345",
"department_id": "67890",
"appointment_type_id": "11111",
"appointment_date": "2024-01-15",
"appointment_time": "14:30",
"reason_for_visit": "Annual checkup"
}
}
Response Format
All tool responses are returned as JSON strings containing the API response data. For example:
{
"appointments": [
{
"appointmentid": "55555",
"patientid": "99999",
"providerid": "12345",
"departmentid": "67890",
"appointmentdate": "2024-01-15",
"appointmenttime": "14:30",
"appointmenttype": "Annual Checkup",
"status": "scheduled"
}
]
}
Troubleshooting
Common Issues
-
Authentication Errors:
- Verify your
ATHENA_CLIENT_IDandATHENA_CLIENT_SECRETare correct - Ensure your API credentials have the necessary permissions
- Verify your
-
Missing Environment Variables:
- The server will exit with an error message listing missing variables
- Set all required environment variables before running
-
API Request Failures:
- Check that your
ATHENA_PRACTICE_IDis correct - Verify the API endpoints are accessible from your network
- Review the error response for specific API error messages
- Check that your
Logging
The server logs all operations at INFO level. Check the console output for detailed information about:
- Authentication attempts
- API requests and responses
- Error details
Security Considerations
- Never commit API credentials to version control
- Use environment variables for all sensitive configuration
- The server automatically handles token refresh and secure storage
- All API communication uses HTTPS
Support
For issues with the MCP server implementation, check the logs for detailed error messages. For Athena Health API-specific issues, refer to the official Athena Health API documentation. # athenahealth-mcp
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。