Rule-based drug interactions, dose check, and allergy MCP server (RxNav backend)
Project description
mcp-clinical-reasoner
Part of fhir-mcp-suite — v1.0.0
An MCP server providing four clinical pharmacology tools backed by the free NLM RxNav REST API and a built-in rule-based reference table. No API key required. No PHI processed.
Tools
| Tool | Transport | Description |
|---|---|---|
lookup_drug |
RxNav API | Resolve drug name or RxNorm CUI → canonical name, RxCUI, drug-class membership, dose reference |
check_drug_interactions |
RxNav API | Detect drug-drug interactions (DDIs) for 2–10 RxNorm CUIs, sorted by severity |
check_dose |
Rule-based | Validate a proposed single dose (mg) against a built-in table of ~20 common drugs |
check_allergy_conflicts |
Rule-based | Cross-reactivity check against 12 allergen classes using built-in table |
Architecture
Claude Desktop / LangGraph agent
│ MCP (stdio or SSE)
▼
mcp-clinical-reasoner (:8002 in SSE mode)
├── lookup_drug ────────────────► rxnav.nlm.nih.gov/REST
├── check_drug_interactions ────► rxnav.nlm.nih.gov/REST
├── check_dose ─────────────────► built-in DOSE_TABLE (20 drugs)
└── check_allergy_conflicts ────► built-in ALLERGEN_CLASSES (12 classes)
All tool calls traced via LangFuse (session-scoped, latency + response bytes).
Built-in Dose Table
Covers 20 common drugs: acetaminophen, ibuprofen, aspirin, naproxen, metformin, lisinopril, atorvastatin, metoprolol, amlodipine, omeprazole, amoxicillin, azithromycin, warfarin, furosemide, sertraline, gabapentin, clopidogrel, hydrochlorothiazide, prednisone, albuterol.
Brand aliases are resolved automatically (e.g. "Tylenol" → acetaminophen,
"Advil" → ibuprofen).
Built-in Allergen Classes
12 classes: penicillin, cephalosporin, sulfonamide, nsaid, macrolide, fluoroquinolone, statin, ace_inhibitor, angiotensin_receptor_blocker, beta_blocker, thiazide_diuretic, tetracycline.
Quick start
# Install (uv workspace from repo root)
uv sync --all-packages
# Run (stdio, default)
uv run mcp-clinical-reasoner
# Run (SSE on port 8002)
MCP_TRANSPORT=sse uv run mcp-clinical-reasoner
Environment variables
| Variable | Default | Description |
|---|---|---|
RXNAV_BASE_URL |
https://rxnav.nlm.nih.gov/REST |
RxNav API base URL |
RXNAV_TIMEOUT_S |
30.0 |
HTTP timeout (seconds) |
MCP_TRANSPORT |
stdio |
stdio or sse |
MCP_HOST |
0.0.0.0 |
SSE bind host |
MCP_PORT |
8002 |
SSE port |
LANGFUSE_PUBLIC_KEY |
(optional) | LangFuse tracing |
LANGFUSE_SECRET_KEY |
(optional) | LangFuse tracing |
LANGFUSE_HOST |
(optional) | LangFuse host |
LOG_LEVEL |
INFO |
Logging level |
Claude Desktop configuration
{
"mcpServers": {
"clinical-reasoner": {
"command": "uv",
"args": [
"--directory", "/path/to/fhir-mcp-suite",
"run", "--package", "mcp-clinical-reasoner",
"mcp-clinical-reasoner"
]
}
}
}
Tests
# Unit tests (36 tests, no network required)
uv run pytest packages/mcp-clinical-reasoner/tests/ -v -m "not integration and not eval"
# Offline eval (dose + allergy + error validation)
uv run python evals/mcp-clinical-reasoner/run_eval.py --tags dose allergy error
# Full eval suite (requires rxnav.nlm.nih.gov)
uv run python evals/mcp-clinical-reasoner/run_eval.py
Eval results (offline, no network)
| Tag set | Cases | Pass rate |
|---|---|---|
| error | 6 | 100% |
| dose + allergy | 12 | 100% |
Disclaimer
This server is for research and educational purposes only. It does not replace clinical judgement, pharmacist review, or professional medical advice. All dose limits and cross-reactivity rules are from general adult references and must be individualised for each patient.
License
Apache-2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_clinical_reasoner-1.0.0.tar.gz.
File metadata
- Download URL: mcp_clinical_reasoner-1.0.0.tar.gz
- Upload date:
- Size: 18.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcafdecb22b0afdd9c5fc40f68359b832085610559cec86905e9d5daadbe9b23
|
|
| MD5 |
c944f7da59793b78b557842b6000faa2
|
|
| BLAKE2b-256 |
9cda7aa001cf710e1c638b30a0c6903a279fd7c34e444c0ffb4eaaed6339c4b9
|
Provenance
The following attestation bundles were made for mcp_clinical_reasoner-1.0.0.tar.gz:
Publisher:
release.yml on pcmedsinge/fhir-mcp-suite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_clinical_reasoner-1.0.0.tar.gz -
Subject digest:
fcafdecb22b0afdd9c5fc40f68359b832085610559cec86905e9d5daadbe9b23 - Sigstore transparency entry: 1882043616
- Sigstore integration time:
-
Permalink:
pcmedsinge/fhir-mcp-suite@48627872d41e2d16b344bcd4d702ea7f688bc513 -
Branch / Tag:
refs/tags/mcp-clinical-reasoner-v1.0.0 - Owner: https://github.com/pcmedsinge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48627872d41e2d16b344bcd4d702ea7f688bc513 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mcp_clinical_reasoner-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mcp_clinical_reasoner-1.0.0-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffafa5a1678f2ab1395e67ae6e51ed619dc45cf79d42149a378780ce0eadc1fe
|
|
| MD5 |
c391f341d697ec414af962246e2f7fc7
|
|
| BLAKE2b-256 |
5811cdb79ff2016dbb1c42badc57a3d08f42ff9fde1b6afe5e652dcfe5c99a16
|
Provenance
The following attestation bundles were made for mcp_clinical_reasoner-1.0.0-py3-none-any.whl:
Publisher:
release.yml on pcmedsinge/fhir-mcp-suite
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_clinical_reasoner-1.0.0-py3-none-any.whl -
Subject digest:
ffafa5a1678f2ab1395e67ae6e51ed619dc45cf79d42149a378780ce0eadc1fe - Sigstore transparency entry: 1882043755
- Sigstore integration time:
-
Permalink:
pcmedsinge/fhir-mcp-suite@48627872d41e2d16b344bcd4d702ea7f688bc513 -
Branch / Tag:
refs/tags/mcp-clinical-reasoner-v1.0.0 - Owner: https://github.com/pcmedsinge
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@48627872d41e2d16b344bcd4d702ea7f688bc513 -
Trigger Event:
push
-
Statement type: