Model Context Protocol (MCP) server for viewing and analyzing EIR (Electronic health Information Record) files in AI conversations.
This MCP server allows users to load .eir healthcare files directly into any MCP-compatible AI application (Claude Desktop, ChatGPT, etc.) and have natural conversations about their health data.
.eir file into AI contextnpm install -g eir-mcp-server
# or
pip install eir-mcp-server
Add to your MCP client (Claude Desktop, etc.):
{
"mcpServers": {
"eir-healthcare": {
"command": "eir-mcp-server",
"args": []
}
}
}
load_eir_fileLoad an EIR healthcare file into the conversation context.
Parameters:
file_path (string): Path to the .eir fileprivacy_check (boolean): Verify privacy level before loadingReturns:
query_medicationsGet current medications and treatment details.
Parameters:
active_only (boolean): Show only active medicationsinclude_history (boolean): Include medication historyquery_lab_resultsRetrieve lab results with filtering options.
Parameters:
test_name (string, optional): Filter by specific testdays_back (number): How many days back to includeinclude_trends (boolean): Calculate trends and changesquery_conditionsGet medical conditions and diagnoses.
Parameters:
status (enum): active, resolved, chronic, allinclude_icd_codes (boolean): Include ICD-10/SNOMED codesanalyze_timelineGenerate clinical timeline and care journey analysis.
Parameters:
days_back (number): Time period to analyzeevent_types (array): Filter by visit typesinclude_outcomes (boolean): Include treatment outcomesvalidate_eir_fileValidate EIR file format and content.
Parameters:
file_path (string): Path to file to validatestrict_mode (boolean): Enable strict validation rulesgenerate_summaryCreate comprehensive health summary for AI analysis.
Parameters:
summary_type (enum): brief, detailed, clinical, patient_friendlyfocus_areas (array): Specific areas to emphasizeUser: Load my healthcare data from ~/health/birger-2024.eir
AI: I've loaded your healthcare data (privacy level: pseudonymized). I can see:
- 2 active medical conditions (Type 2 Diabetes, Hypertension)
- 2 current medications (Metformin, Lisinopril)
- Recent lab results showing excellent diabetes control (HbA1c: 6.8%)
- 15 clinical events over the past year
What would you like to know about your health data?
User: How is my diabetes management going?
AI: Your diabetes management is going exceptionally well! Here's what I see:
**Blood Sugar Control:**
- HbA1c improved dramatically: 8.2% โ 6.8% (now at target <7%)
- Latest fasting glucose: 118 mg/dL (near normal range)
- Trend: Consistently decreasing since starting metformin
**Treatment Response:**
- Metformin 500mg twice daily - excellent adherence (90%+)
- No reported side effects
- 7kg weight loss since diagnosis (78kg current)
**Key Achievements:**
โ
Met HbA1c target in just 4 weeks
โ
Sustainable weight loss
โ
No hypoglycemic episodes
โ
Good blood pressure control
Your endocrinologist Dr. Smith noted "excellent response to lifestyle and metformin" at your last visit. Keep up the great work!
User: Show me how my lab values have changed over time
AI: Here's your lab trend analysis:
**Hemoglobin A1C (Diabetes Control):**
๐ Dec 2023: 8.2% (diagnostic)
๐ Jan 2024: 7.4% (improving)
๐ Feb 2024: 6.8% (target achieved!)
Trend: -1.4% in 2 months (excellent improvement)
**Blood Pressure:**
๐ Aug 2023: 158/96 (high, pre-treatment)
๐ Dec 2023: 145/88 (improving)
๐ Feb 2024: 126/78 (well controlled)
Trend: 32/18 mmHg reduction (great response to lisinopril)
**Weight Management:**
๐ Oct 2023: 85kg (BMI 31.2)
๐ Feb 2024: 78kg (BMI 28.7)
Trend: -7kg in 4 months (sustainable pace)
**Clinical Insight:** Your multi-faceted approach (medication + lifestyle) is working excellently. All major health metrics trending in the right direction!
User: What should I be watching out for health-wise?
AI: Based on your health data, here are key areas to monitor:
**Immediate Priorities:**
1. **Cardiovascular Risk** - You have diabetes + controlled hypertension
- Current LDL: 128 mg/dL (target <100 for diabetics)
- Consider statin discussion with your doctor
- Keep up excellent BP control (current: 126/78)
2. **Diabetes Complications Prevention**
- Annual diabetic eye exam (scheduled โ
)
- Foot exams (last exam normal โ
)
- Kidney function monitoring (current eGFR >60 โ
)
**Positive Factors:**
โ
Excellent diabetes control (HbA1c 6.8%)
โ
No medication side effects
โ
Strong healthcare team (endocrinologist + primary care)
โ
Good medication adherence
**Recommended Actions:**
- Continue current diabetes management
- Discuss cholesterol treatment at next visit
- Maintain weight loss momentum (goal BMI <25)
- Keep up regular monitoring schedule
**Red Flags to Watch For:**
- Frequent hypoglycemia episodes
- Rapid weight gain/loss
- Vision changes
- Foot injuries or numbness
Your proactive approach and excellent clinical response suggest low risk for complications. Keep doing what you're doing!
git clone https://github.com/BirgerMoell/eir-mcp-server
cd eir-mcp-server
npm install
npm run dev
# Run tests
npm test
# Test with sample EIR file
npm run test:sample
# Validate EIR files
npm run validate examples/*.eir
Full API documentation available at: https://docs.eir.space/mcp-server
EIR MCP Server - Healthcare data that actually works with AI. ๐ฅ๐ค๐