rx-shortage-mcp
This server helps pharmacists and clinical teams find alternative drugs during a shortage, and re-checks each alternative against live FDA data to detect cascade shortages — preventing the trap of recommending an alternative that is also in short supply.
Tools available:
rx_health— Confirm the server is running and reachable.rx_normalize_drug— Convert messy drug names, brand names, abbreviations, or typos into standardized RxNorm RxCUI identifiers.rx_get_drug_class— Look up a drug's ATC-4 pharmacologic class(es) from RxClass (single-ingredient and combination), so the right class can be selected for finding alternatives.rx_find_alternatives— List sibling drugs within a given ATC-4 class as candidates for clinical evaluation (class membership does not imply clinical interchangeability).rx_check_shortage— Query live openFDA data to determine a drug's current U.S. shortage status, including reasons, therapeutic categories, and last updated date.Cascade shortage check — By chaining the tools (normalize → get class → find alternatives → check shortage for each alternative), the server surfaces which same-class options are also in shortage before any substitution decision is made.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@rx-shortage-mcp Atorvastatin is on backorder — what could I consider instead, and are any of those also short?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Rx Shortage Alternative Finder (MCP)
A pharmacist gets the alert that metformin is on backorder, opens the drug class, and picks the next agent down the list. Two days later that order bounces too, because the alternative was on the FDA shortage list the whole time. That second shortage is the one nobody thinks to check, and it is the one this server catches.
Rx Shortage Alternative Finder is an MCP server that takes a drug in shortage, finds its same-class alternatives, and re-checks each one against live FDA data, so an LLM can answer "what else could work, and is any of it also short?" in a single pass.
Status: v1, working and tested. Five read-only tools, 22 automated tests plus a live eval, validated end to end in Claude Desktop.
Try it
Connect the server (Quickstart is right below, about two minutes), then ask Claude:
Furosemide is on backorder. What same-class options could we consider, and are any of those also short?
Watch it work the chain live. It normalizes the name through RxNorm, confirms the shortage in openFDA, pulls the loop-diuretic class from RxClass, then checks each sibling in turn. The payoff is the part no single database gives you: as of this writing it flags that bumetanide, the obvious switch, is also in shortage, while torsemide is not. Don't take that on faith. Swap in whatever drug is on your own backorder list and check it yourself.
Related MCP server: DrugWise
Quickstart
You need uv and an MCP client, either Claude Desktop or Claude Code. No API key, no database, nothing else.
git clone https://github.com/Travis-Clement-Dev/rx-shortage-mcp.git
cd rx-shortage-mcp
uv run python -m rx_shortage_mcpThe first run builds the environment and pulls dependencies on its own. The server speaks MCP over stdio, so you normally launch it through a client rather than by hand.
Connect it to Claude Desktop
Add this to claude_desktop_config.json (on macOS, ~/Library/Application Support/Claude/claude_desktop_config.json), then restart Claude Desktop:
{
"mcpServers": {
"rx-shortage": {
"command": "uv",
"args": ["--directory", "/ABSOLUTE/PATH/TO/rx-shortage-mcp", "run", "python", "-m", "rx_shortage_mcp"]
}
}
}An optional openFDA key
Everything runs keyless at roughly 240 requests a minute, plenty for interactive use. If you plan to hammer it, a free openFDA key raises the daily ceiling: copy .env.example to .env and set OPENFDA_API_KEY.
How the chain works
Four read-only tools, called in sequence: normalize, classify, find siblings, re-check each. The orchestration lives in the model's reasoning, which is the reason this ships as an MCP server instead of a script.
normalize_drug turns a messy name, brand, or typo into an RxNorm RxCUI.
get_drug_class returns the drug's candidate ATC-4 pharmacologic classes.
find_alternatives lists the same-class siblings.
check_shortage returns the openFDA shortage status for the original and every alternative.
The fan-out in step four is the whole point. Listing same-class drugs is easy. Re-checking each one against the shortage list is the part that turns a list into a decision.
What a full answer looks like
Ask about furosemide and the model returns a ranked, flagged shortlist:
Same-class option (ATC C03CA) | FDA status | Presentations affected | Updated |
furosemide (the one you asked about) | Current shortage | 33 | 06/25/2026 |
bumetanide | Current shortage | 12 | 06/25/2026 |
torsemide | No shortage reported | 0 | — |
piretanide | No shortage reported | 0 | — |
The reflexive switch from furosemide is bumetanide, and bumetanide is short too. Torsemide is the same-class option that is not. That gap is the cascade, and surfacing it before you place the order is the entire job.
(Live national data. Your numbers will differ as shortages change.)
Why this exists
FDA and ASHP tell you a drug is short. Orange Book and the vendor catalogs tell you who else makes the same molecule. Neither one tells you whether the different drug you would actually reach for is short as well. That blind spot, sitting in plain sight between three public data sources, is the reason this exists.
It is built for informatics pharmacists and clinical-data teams, the people who maintain formulary alternatives and build clinical decision support. They care how an answer was assembled as much as what it says, so every drug it names traces to a real RxNorm or RxClass identifier, and the reasoning runs in the open, one tool call at a time.
What it will not do
This is decision support, not a substitution order, and the line matters. RxClass returns every member of a class, including drugs that are the wrong route, the wrong indication, contraindicated, or pulled from the market years ago. The server cannot tell which is which, so it does not pretend to.
Every alternatives response carries a disclaimer that says exactly that. Same pharmacologic class does not mean clinically interchangeable. Route, indication, dosing, and contraindications are never checked here, and the shortage data is national, not your local shelf. A licensed professional weighs the shortlist. The tool only makes sure the shortlist is honest about supply.
Testing
uv run --extra dev pytest # offline unit, safety, and protocol tests
uv run --extra dev pytest -m live # the live eval: the full chain across 15 drugs
npx @modelcontextprotocol/inspector uv run python -m rx_shortage_mcp # poke the tools by handThe safety rule is enforced, not hoped for. A test fails the build if any tool ever frames its output as a substitution instruction or drops the disclaimer. If an import ever fails, the editable install has drifted; reset it with rm -rf .venv uv.lock && uv sync.
Built on public data
RxNorm and RxClass come from the U.S. National Library of Medicine. Shortage data comes from the FDA's openFDA.
This product uses publicly available data from the U.S. National Library of Medicine (NLM), National Institutes of Health, Department of Health and Human Services; NLM is not responsible for the product and does not endorse or recommend this or any other product.
openFDA shortage data is not intended for making decisions about medical care.
License
MIT, © 2026 Travis Clement.
Available Tools
5 toolsrx_check_shortageARead-onlyIdempotent
Check the current U.S. FDA (openFDA) shortage status of a drug.
Queries the openFDA Drug Shortages dataset by generic name and aggregates the
NDC/package-level records into a single status summary. National-level data only —
it does NOT reflect a specific pharmacy's local/regional stock.
Use this twice in the workflow: (1) to confirm the original drug is short, and
(2) to re-check EACH candidate alternative — an alternative may itself be in
shortage (the "cascade" check that is the point of this server).
Args:
drug_name: Generic/ingredient name (e.g. 'furosemide').
Returns:
ShortageResult — drug, in_shortage (bool), overall_status ('Current' /
'To Be Discontinued' / 'Resolved' / 'no_record'), statuses (list of
{status, count}), record_count, last_updated (MM/DD/YYYY or null),
therapeutic_categories, reasons, and next_step guidance.
Inputs: drug_name (required). Returns: Aggregated shortage summary for one drug (token-efficient — not raw records).
rx_find_alternativesARead-onlyIdempotent
List the sibling drugs in an ATC-4 pharmacologic class (RxClass members).
These are CANDIDATE alternatives for a licensed professional to evaluate — NOT a
substitution instruction. Same-class membership does NOT imply clinical
interchangeability (route, indication, contraindications, dosing, and equivalence are
not checked; some members may be withdrawn or combination products). Every response
carries a `disclaimer` that you MUST surface to the user.
After calling this, re-check EACH member's supply with rx_check_shortage to flag the
ones that are also short (the cascade check).
Args:
class_id: ATC-4 class id (e.g. 'C03CA').
Returns:
AlternativesResult — class_id, members (list of {rxcui, name, is_combination}),
count, capped (bool), disclaimer (mandatory), and next_step guidance.
Inputs: class_id (required). Returns: count, capped, members, class_id, +2 more
rx_get_drug_classARead-onlyIdempotent
Resolve a drug to its candidate ATC-4 pharmacologic classes (RxClass).
A drug commonly maps to SEVERAL ATC-4 classes (a pure single-ingredient class plus
combination-product classes). This tool returns them ALL, each flagged
`is_combination`, sorted single-ingredient-first. YOU choose the class: normally the
single-ingredient class matching the drug's main therapeutic use. Pass its `class_id`
to rx_find_alternatives.
Args:
drug_name: Drug/brand name (e.g. 'furosemide', 'Lipitor').
Returns:
DrugClassResult — drug, classes (list of {class_id, class_name, class_type,
is_combination}), count, and next_step guidance.
Inputs: drug_name (required). Returns: drug, count, classes, next_step
rx_healthARead-onlyIdempotent
Confirm the rx_shortage_mcp server is running and reachable.
A zero-argument connectivity check. Use it to verify the server is live
before running the shortage → alternatives → cascade-check chain.
Returns:
HealthStatus: {
"status": str, # "ok" when healthy
"server": str, # "rx_shortage_mcp"
"version": str, # package version, e.g. "0.1.0"
"next_step": str # what to call next
}
Inputs: no named parameters. Returns: server, status, version, next_step
rx_normalize_drugARead-onlyIdempotent
Normalize a messy drug name/brand/typo to an RxNorm RxCUI and clean name.
This is the FIRST step of the workflow. It uses RxNorm's prescribable search
(exact-then-normalized), falling back to approximate matching for typos.
IMPORTANT: if `match_type` is 'approximate', the result is a best guess — present
the `candidates` to the user and confirm the intended drug before proceeding. Do
not silently assume the top candidate is correct.
Args:
name: The drug name as the user typed it.
Returns:
NormalizeResult — found (bool), rxcui, name (resolved RxNorm name), match_type
('exact' / 'approximate' / 'none'), candidates (ranked, for approximate matches),
and next_step guidance.
Inputs: name (required). Returns: name, found, rxcui, next_step, +2 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: name normalization, class resolution, alternative listing, shortage checking, and health verification. No overlap exists, and the workflow is well-defined.
All tools use the 'rx_' prefix and verb_noun pattern (e.g., check_shortage, find_alternatives). The exception is 'rx_health', which lacks a verb, but it is still clear and follows the overall naming scheme.
With 5 tools, the server is well-scoped for a focused domain. Each tool serves a necessary step in the shortage-checking workflow without redundancy or bloat.
The tools cover the full intended workflow: normalize drug name, get ATC class, find alternatives, check shortage, and verify server health. No obvious gaps for the stated purpose.
Maintenance
Related MCP Connectors
Hosted MCP server exposing US hospital procedure cost data to AI assistants
Drug-drug interaction checker for clinical LLMs using RxNorm and DailyMed.
MCP server for US nursing facility search and ownership lookup (NursingHomeDatabase).
MCP-Native LLM Orchestration Agent
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that brings AI-powered search and conversation to your FHIR clinical documents.21 PyPI1MIT
- FlicenseBqualityDmaintenanceAn MCP server that provides AI-assisted clinical decision support for medication safety, integrating trusted biomedical sources to detect drug interactions and suggest therapeutic alternatives.51-
- AlicenseAqualityDmaintenanceAn MCP server that enables AI assistants to query U.S. FDA public datasets, including drug adverse events, labeling, recalls, approvals, shortages, NDC directory, and medical device regulatory information.10MIT
- FlicenseNot gradedqualityDmaintenanceAn educational healthcare assistant MCP server that provides medication information, interaction checks, symptom guidance, and health topic searches using local data and a local LLM.-