medical-codes-mcp-server
medcode_map_codesCrosswalk a US medical code or drug across systems and within a hierarchy. Hierarchy directions: parents and children walk a code's prefix hierarchy one level per call — immediate parent/children only (depth-1); call iteratively for the full ancestor or descendant path (ICD-10-CM/HCPCS; ICD-10-PCS codes have no prefix parent). A resolvable source with no edge in the requested direction is a successful empty result with a notice, not an error. A source code string that also exists in another bundled system carries alsoInSystems naming it, since only the resolved system's hierarchy was walked. Drug directions (RxNorm): name_to_rxcui (drug name → RXCUI), ndc_to_rxcui and rxcui_to_ndc (NDC ↔ RXCUI; NDCs accepted hyphenated in an FDA segment configuration — 4-4-2, 5-3-2, 5-4-1, or the 11-digit 5-4-2 — or as bare 10/11 digits; ndc_to_rxcui names the product it decoded to), rxcui_to_ingredients and rxcui_to_brands (RXCUI → ingredient/brand RXCUIs, each with the target's RxNorm name and its conceptType — read that before counting a combination product's ingredients). Every result carries source provenance (which system or edge answered) so a chained call (e.g. into openfda with a resolved NDC) uses the right identifier. The children, name_to_rxcui, and rxcui_to_ndc directions can return large sets and paginate: a nextCursor in the response is passed back as cursor (with an optional limit page size) to walk the full set; the point directions ignore both.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | Yes | The source value: a code (for parents/children), a drug name, an NDC, or an RXCUI. Must not be blank or whitespace-only. | |
| limit | No | Max results per page for the paginated directions (children, name_to_rxcui, rxcui_to_ndc). Defaults to MEDCODE_MAX_RESULTS (50), ceiling 200. Ignored by the point directions. | |
| cursor | No | Opaque continuation token from a previous response's `nextCursor`, for the paginated directions (children, name_to_rxcui, rxcui_to_ndc). Omit for the first page. | |
| system | No | For parents/children, force the source code into this system. Omit to auto-detect. | |
| direction | Yes | What to map to. parents/children return the immediate parent or children only (depth-1) — call iteratively to walk a full path; the rxcui/ndc/name directions are RxNorm drug crosswalks. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | Paginated directions only: the page size that was applied. | |
| from | No | The source value, echoed back. | |
| hits | No | Crosswalk results, each tagged with the edge that produced it. | |
| error | No | Present when the call failed. Absent on success. | |
| shown | No | Paginated directions only: number of hits returned on this page. | |
| notice | No | Guidance whenever a resolvable source returns no hits, naming which of the two causes applies: it has no edge in the requested direction (a top-level code has no parent; a leaf has no children; ICD-10-PCS codes have no prefix parent), or the `cursor` starts past the last page of a direction that does have results. | |
| direction | No | The mapping direction that was applied. | |
| truncated | No | Paginated directions (children, name_to_rxcui, rxcui_to_ndc) only: true when more results exist beyond this page. | |
| nextCursor | No | Paginated directions only: opaque token to pass back as `cursor` for the next page. Present only when more results exist beyond this page. | |
| alsoInSystems | No | Other bundled systems holding the same `from` code string, present only when there is at least one (hierarchy directions only — a drug name, NDC, or RXCUI is not system-scoped). The hits above were walked in `resolvedSystem` alone; the code is a DIFFERENT code with a different hierarchy in each system listed here — "B00" is the ICD-10-CM category "Herpesviral [herpes simplex] infections" and also the ICD-10-PCS table row "Imaging, Central Nervous System, Plain Radiography". Re-call with `system` set to one of these values to walk it there. | |
| resolvedSystem | No | The system the source resolved in, or null when not system-scoped. |