grep_recordLABSCO SUMMARY
Three ways into one patient record: search, SQL, code.
Structured FHIR and free-text notes end up in the same searchable pile, which is the part most FHIR tooling leaves out. Choose by precision: grep to find a mention, SQL when you know the resource shape, JavaScript when the answer has to be computed from several places at once.
What it is
A server that connects to an EHR through the SMART App Launch framework, extracts the patient record including structured FHIR resources and the text of clinical notes and attachments, and exposes that copy through three tools.
What you get
- Text and regular-expression search across the whole fetched record, structured data and note text alike (grep_record)
- Read-only SQL SELECT queries against the structured FHIR data, for precise lookups such as a lab result by LOINC code (query_record)
- Custom JavaScript run over the fetched resources and attachments, for calculations that combine several sources (eval_record)
- A standalone SMART on FHIR web client for the extraction step
- The model works against the extracted record, not against the EHR itself
Requirements
An EHR that supports SMART on FHIR and an authorised launch against it. The record is fetched first; the tools then run over that copy.
Setup effort
Build from source — git clone https://github.com/jmandel/health-record-mcp.git
USE CASES
Finding every mention of a condition or a drug
Search the whole record, notes included, for the keyword or pattern.
Pulling a lab result you know the code for
Run a SELECT against the structured FHIR data instead of reading through resources.
Reading what the notes say, not just what the codes say
Attachment and note text is searchable alongside the coded data.
Working out something the record does not store directly
Run JavaScript over the resources and attachments to compute it.
Getting a picture of a history before an appointment
Query the structured data for the timeline, then search the notes for what sits behind it.
3 tools
Listed in project docs. Your client may show a different list.
query_recordeval_recordBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation.
Requires
- Bun
- A patient-portal login at an EHR that supports SMART on FHIR
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/jmandel/health-record-mcp.git
cd health-record-mcp
bun install
bun run src/cli.ts --create-db --db ./data/my_record.sqliteFollow the prompts (opening a link in your browser) to connect to your EHR.
MCP Clients
Cursor, Any MCP client
{
"mcpServers": {
"local-ehr": {
"name": "Local EHR Search",
"command": "bun",
"args": [
"/home/<YOUR_USERNAME>/projects/smart-mcp/src/cli.ts",
"--db",
"/home/<YOUR_USERNAME>/projects/smart-mcp/data/my_record.sqlite"
]
}
}
}The …/projects/smart-mcp folder in the two paths is the README author's own; yours is the absolute path of your health-record-mcp clone, so they point at src/cli.ts and at the data/my_record.sqlite file the --create-db step wrote. The project asks for absolute paths for both.