medical-terminologies-mcp 2.1.2 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE.md CHANGED
@@ -104,8 +104,8 @@ channel as well.
104
104
 
105
105
  MeSH content is a U.S. government work served under the
106
106
  [NLM Terms and Conditions](https://www.nlm.nih.gov/databases/download/terms_and_conditions.html),
107
- free of charge. Credit: **Courtesy of the U.S. National Library of
108
- Medicine.** No endorsement by NLM is implied.
107
+ free of charge. The NLM statement in section 5 applies to this channel as
108
+ well; no endorsement by NLM is implied.
109
109
 
110
110
  ## 8. SNOMED CT (SNOMED International) — retired in 2.0.0
111
111
 
package/README.md CHANGED
@@ -466,7 +466,7 @@ ATC classification © WHO Collaborating Centre for Drug Statistics Methodology (
466
466
 
467
467
  ### MeSH
468
468
 
469
- MeSH is a U.S. government work served under the [NLM Terms and Conditions](https://www.nlm.nih.gov/databases/download/terms_and_conditions.html). Courtesy of the U.S. National Library of Medicine.
469
+ MeSH is a U.S. government work served free of charge under the [NLM Terms and Conditions](https://www.nlm.nih.gov/databases/download/terms_and_conditions.html). The NLM statement above (RxNorm) applies to this channel as well.
470
470
 
471
471
  ## Surface fingerprint, checkable from the registry
472
472
 
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ function unknownCursorError(message) {
30
30
  var package_default = {
31
31
  name: "medical-terminologies-mcp",
32
32
  mcpName: "io.github.SidneyBissoli/medical-terminologies-mcp",
33
- version: "2.1.2",
33
+ version: "2.3.0",
34
34
  description: "Unified MCP server for six medical terminologies (ICD-11, LOINC, RxNorm, MeSH, ATC, CID-10) with authoritative WHO ICD-10\u2192ICD-11 mapping. 33 tools, hosted endpoint available, MIT.",
35
35
  author: "Sidney da Silva Pereira Bissoli",
36
36
  license: "MIT",
@@ -88,19 +88,19 @@ var package_default = {
88
88
  },
89
89
  dependencies: {
90
90
  "@modelcontextprotocol/server": "^2.0.0",
91
- "@sbissoli/mcp-provenance": "^0.3.0",
91
+ "@sbissoli/mcp-provenance": "^0.4.0",
92
92
  "@sbissoli/mcp-search": "^0.9.0",
93
- "@sbissoli/mcp-upstream": "^0.4.0",
93
+ "@sbissoli/mcp-upstream": "^0.4.2",
94
94
  pino: "^10.2.1",
95
95
  zod: "^4.5.4"
96
96
  },
97
97
  devDependencies: {
98
98
  "@modelcontextprotocol/client": "^2.0.0",
99
99
  "@sbissoli/mcp-evals": "^0.2.1",
100
- "@sbissoli/mcp-surface": "^0.5.0",
100
+ "@sbissoli/mcp-surface": "^0.6.0",
101
101
  "@types/node": "^26.5.1",
102
102
  esbuild: "^0.28.2",
103
- nock: "^14.0.15",
103
+ nock: "^15.0.1",
104
104
  "pino-pretty": "^13.1.3",
105
105
  tsx: "^4.23.13",
106
106
  typescript: "^7.0.2",
@@ -1339,9 +1339,8 @@ var HttpError = class extends Error {
1339
1339
  this.data = opts.data;
1340
1340
  }
1341
1341
  };
1342
- async function parseBody(response) {
1343
- const text = await response.text();
1344
- if (text.length === 0) {
1342
+ function parseBody(text) {
1343
+ if (text === void 0 || text.length === 0) {
1345
1344
  return void 0;
1346
1345
  }
1347
1346
  try {
@@ -1378,7 +1377,7 @@ async function translateUpstreamError(error, timeoutMs) {
1378
1377
  return new HttpError(`malformed upstream response${after}`, { status: error.status });
1379
1378
  default: {
1380
1379
  const status = error.status ?? error.response?.status;
1381
- const data = error.response ? await parseBody(error.response) : error.body;
1380
+ const data = parseBody(error.body);
1382
1381
  return new HttpError(`Request failed with status code ${status}${after}`, { status, data });
1383
1382
  }
1384
1383
  }
@@ -1409,9 +1408,9 @@ var HttpClient = class {
1409
1408
  const fullUrl = this.buildUrl(url, options.params);
1410
1409
  const timeout = options.timeout ?? this.config.timeout ?? UPSTREAM_POLICY.timeoutMs[this.config.source];
1411
1410
  const headers = { ...this.config.headers, ...options.headers };
1412
- let response;
1411
+ let text;
1413
1412
  try {
1414
- response = await upstreamCallFor(this.config.source).response(fullUrl, {
1413
+ text = await upstreamCallFor(this.config.source).text(fullUrl, {
1415
1414
  method,
1416
1415
  headers,
1417
1416
  body,
@@ -1420,7 +1419,7 @@ var HttpClient = class {
1420
1419
  } catch (error) {
1421
1420
  throw await translateUpstreamError(error, timeout);
1422
1421
  }
1423
- return { data: await parseBody(response), status: response.status };
1422
+ return { data: parseBody(text) };
1424
1423
  }
1425
1424
  };
1426
1425
 
@@ -1735,7 +1734,7 @@ var WHOClient = class {
1735
1734
  }
1736
1735
  });
1737
1736
  const duration = Date.now() - startTime;
1738
- log.debug({ status: response.status, duration }, "HTTP response OK");
1737
+ log.debug({ duration }, "HTTP response OK");
1739
1738
  return response.data;
1740
1739
  } catch (error) {
1741
1740
  if (error instanceof HttpError) {
@@ -2020,7 +2019,15 @@ var provenanceContext = createProvenanceContext({
2020
2019
  metaNamespace: "com.sidneybissoli.medical",
2021
2020
  locale: "en",
2022
2021
  timezone: "utc",
2023
- defaultMode: "concise"
2022
+ defaultMode: "concise",
2023
+ // Contract 1.3 since step two of it (the imported schema accepted 1.3 since
2024
+ // 2.2.0): the concise block carries `revision` always (every preset sets
2025
+ // it), `notices` when the source has a caveat about the DATA, and `derived`
2026
+ // + `derivation_note` when this server computed — absent, not empty, when
2027
+ // there is nothing to say. License statements are NOT notices: they live in
2028
+ // NOTICE.md, the README and `info://licenses`. This server never passes
2029
+ // `field_sources` (1.2) — multi-source responses carry one block per source.
2030
+ contractVersion: "1.3"
2024
2031
  });
2025
2032
  var PROVENANCE_META_KEY = provenanceContext.metaKeys.provenance;
2026
2033
  var ATTRIBUTION_META_KEY = provenanceContext.metaKeys.attribution;
@@ -2044,11 +2051,13 @@ var MEDICAL_SOURCES = {
2044
2051
  // §1.3 of the ICD-11 license fixes this citation; the retrieval clause
2045
2052
  // is additive (marked as ours per §1.2.5).
2046
2053
  citation: (date) => `International Classification of Diseases, Eleventh Revision (ICD-11), World Health Organization (WHO) 2019. https://icd.who.int/browse11. Licensed under the Creative Commons Attribution-NoDerivatives 3.0 IGO licence (CC BY-ND 3.0 IGO). Retrieved via the WHO ICD-API on ${date}.`,
2047
- notices: [
2048
- "ICD-11 content is served verbatim with code, title, and URI preserved (license \xA71.2.2\u20131.2.3)."
2049
- ],
2054
+ // Verbatim service with code, title and URI (license §1.2.2–1.2.3) is how
2055
+ // this server complies with the license — stated in `info://licenses`, not
2056
+ // a caveat about the data.
2057
+ notices: [],
2050
2058
  cachePrefixes: ["icd11"],
2051
- defaultVintage: () => getEnv("WHO_ICD11_RELEASE_ID") ?? WHO_ICD11_DEFAULT_RELEASE
2059
+ defaultVintage: () => getEnv("WHO_ICD11_RELEASE_ID") ?? WHO_ICD11_DEFAULT_RELEASE,
2060
+ revision: { status: "current", note: "WHO publishes a new ICD-11 release annually (usually Jan-Feb); this server queries one pinned release." }
2052
2061
  },
2053
2062
  WHO_TRANSITION_TABLES: {
2054
2063
  name: "WHO ICD-10 \u2192 ICD-11 transition tables (bundled)",
@@ -2068,8 +2077,9 @@ var MEDICAL_SOURCES = {
2068
2077
  'WHO: "Mapping tables show the correspondence between ICD-10 and ICD-11 codes. They are not intended for directly converting data from one revision to the other."'
2069
2078
  ],
2070
2079
  cachePrefixes: [],
2071
- defaultVintage: () => null
2080
+ defaultVintage: () => null,
2072
2081
  // caller passes the live dataset version
2082
+ revision: { status: "current", note: "Bundled from one WHO release of the transition tables; ICD-10 itself is frozen (superseded by ICD-11)." }
2073
2083
  },
2074
2084
  DATASUS_CID10: {
2075
2085
  name: "CID-10 V2008 (DataSUS, bundled)",
@@ -2087,7 +2097,8 @@ var MEDICAL_SOURCES = {
2087
2097
  citation: (date) => `CID-10 V2008 \u2014 Classifica\xE7\xE3o Estat\xEDstica Internacional de Doen\xE7as, 10\xAA Revis\xE3o. DataSUS / Minist\xE9rio da Sa\xFAde do Brasil; Brazilian Portuguese translation by CBCD/USP; \xA9 World Health Organization. http://www2.datasus.gov.br/cid10/V2008/. Queried in-process on ${date}.`,
2088
2098
  notices: [],
2089
2099
  cachePrefixes: [],
2090
- defaultVintage: () => "V2008"
2100
+ defaultVintage: () => "V2008",
2101
+ revision: { status: "current", note: "Frozen since 2008: DataSUS has not published a successor to V2008." }
2091
2102
  },
2092
2103
  NLM_RXNAV: {
2093
2104
  name: "RxNorm (NLM RxNav API)",
@@ -2103,9 +2114,10 @@ var MEDICAL_SOURCES = {
2103
2114
  verified_at: VERIFIED_AT
2104
2115
  },
2105
2116
  citation: (date) => `RxNorm, U.S. National Library of Medicine. Retrieved via the NLM RxNav API on ${date}.`,
2106
- notices: [NLM_STATEMENT],
2117
+ notices: [],
2107
2118
  cachePrefixes: ["rxnorm"],
2108
- defaultVintage: () => null
2119
+ defaultVintage: () => null,
2120
+ revision: { status: "current", note: "RxNorm is released monthly (first Monday); concepts update with each release." }
2109
2121
  },
2110
2122
  NLM_RXCLASS_ATC: {
2111
2123
  name: "ATC via NLM RxClass",
@@ -2121,11 +2133,12 @@ var MEDICAL_SOURCES = {
2121
2133
  verified_at: VERIFIED_AT
2122
2134
  },
2123
2135
  citation: (date) => `ATC classification \xA9 WHO Collaborating Centre for Drug Statistics Methodology, served via NLM RxClass. Retrieved on ${date}.`,
2124
- notices: [NLM_STATEMENT],
2136
+ notices: [],
2125
2137
  // ATC shares the RxNorm client/host, so its accesses land on the same
2126
2138
  // cache prefix; the aggregation is per-host, which is honest here.
2127
2139
  cachePrefixes: ["rxnorm"],
2128
- defaultVintage: () => null
2140
+ defaultVintage: () => null,
2141
+ revision: { status: "current", note: "The WHO ATC classification is updated annually." }
2129
2142
  },
2130
2143
  NLM_MESH: {
2131
2144
  name: "MeSH (NLM Linked Data API)",
@@ -2135,15 +2148,16 @@ var MEDICAL_SOURCES = {
2135
2148
  sourceUrl: () => "https://id.nlm.nih.gov/mesh",
2136
2149
  license: {
2137
2150
  id: null,
2138
- name: 'NLM Terms and Conditions \u2014 U.S. government work, no charges or royalties; credit "Courtesy of the U.S. National Library of Medicine" required',
2151
+ name: "NLM Terms and Conditions \u2014 MeSH is a U.S. government work, free of charge",
2139
2152
  url: null,
2140
2153
  terms_url: "https://www.nlm.nih.gov/databases/download/terms_and_conditions.html",
2141
2154
  verified_at: VERIFIED_AT
2142
2155
  },
2143
- citation: (date) => `MeSH (Medical Subject Headings). Courtesy of the U.S. National Library of Medicine. Retrieved via the MeSH Linked Data API on ${date}.`,
2144
- notices: [NLM_STATEMENT],
2156
+ citation: (date) => `MeSH (Medical Subject Headings), U.S. National Library of Medicine. Retrieved via the MeSH Linked Data API on ${date}.`,
2157
+ notices: [],
2145
2158
  cachePrefixes: ["mesh"],
2146
- defaultVintage: () => null
2159
+ defaultVintage: () => null,
2160
+ revision: { status: "current", note: "MeSH is released annually (November)." }
2147
2161
  },
2148
2162
  CLINICALTABLES_LOINC: {
2149
2163
  name: "LOINC via NLM Clinical Tables",
@@ -2159,9 +2173,10 @@ var MEDICAL_SOURCES = {
2159
2173
  verified_at: VERIFIED_AT
2160
2174
  },
2161
2175
  citation: (date) => `LOINC content retrieved via the NLM Clinical Tables API on ${date}. ${LOINC_NOTICE}`,
2162
- notices: [LOINC_NOTICE, NLM_STATEMENT],
2176
+ notices: [],
2163
2177
  cachePrefixes: ["loinc"],
2164
- defaultVintage: () => null
2178
+ defaultVintage: () => null,
2179
+ revision: { status: "current", note: "LOINC is released bi-annually; the release served varies by NLM update cycle." }
2165
2180
  },
2166
2181
  SERVER_METADATA: {
2167
2182
  name: "medical-terminologies-mcp (server-maintained metadata)",
@@ -2179,7 +2194,8 @@ var MEDICAL_SOURCES = {
2179
2194
  citation: (date) => `medical-terminologies-mcp \u2014 server-maintained metadata (not terminology content). https://github.com/SidneyBissoli/medical-terminologies-mcp. Generated on ${date}.`,
2180
2195
  notices: [],
2181
2196
  cachePrefixes: [],
2182
- defaultVintage: () => null
2197
+ defaultVintage: () => null,
2198
+ revision: { status: "current", note: null }
2183
2199
  }
2184
2200
  };
2185
2201
  function medicalProvenance(key, opts = {}) {
@@ -2209,6 +2225,7 @@ function medicalProvenance(key, opts = {}) {
2209
2225
  citation: src.citation(date, opts.citationDetail),
2210
2226
  license: src.license,
2211
2227
  notices: src.notices,
2228
+ revision: src.revision,
2212
2229
  derived: opts.derived !== void 0,
2213
2230
  ...opts.derived !== void 0 ? { derivation_note: opts.derived.note } : {},
2214
2231
  served_from_cache: src.cachePrefixes.length === 0 ? null : meta.servedFromCache
@@ -2238,10 +2255,14 @@ var BLOCK_DESCRIPTIONS = {
2238
2255
  source_url: "Canonical URL of the source (API base or dataset release)",
2239
2256
  data_vintage: "Version/release of the data as exposed by the source; null when not exposed",
2240
2257
  retrieved_at: "Real instant of the upstream extraction (ISO-8601, UTC). Responses served from cache keep the ORIGINAL fetch instant.",
2241
- retrieval: "Origin diagnostics of THIS source in this call (contract v1.1): requests made to the upstream, attempts summed across retries, anomalies worked around (kind + count); unstable=true when any anomaly happened. null when nothing was measured (bundled dataset, or response served entirely from cache)",
2258
+ retrieval: "Origin diagnostics of THIS source in this call: requests made to the upstream, attempts summed across retries, anomalies worked around (kind + count); unstable=true when any anomaly happened. null when nothing was measured (bundled dataset, or response served entirely from cache)",
2242
2259
  citation: "Ready-to-use citation/attribution string",
2243
2260
  license: "License / legal regime of the data",
2244
- field_sources: "Present only when the response joins parts from different origins or extraction instants (contract v1.2): for each group of fields, its URL, extraction instant and whether it came from cache. Absent in single-origin responses"
2261
+ field_sources: "Present only when the response joins parts from different origins or extraction instants: for each group of fields, its URL, extraction instant and whether it came from cache. Absent in single-origin responses",
2262
+ notices: "Caveats the source publishes about the data, verbatim (license statements are not repeated here; see the info://licenses resource). Absent when there is none",
2263
+ derived: "Present (true) only when this server computed the value (e.g. a ranking or summary statistics) instead of passing on what the source returned",
2264
+ derivation_note: "What this server computed; present together with derived",
2265
+ revision: "Whether the data can still change at the source: current = the version in force, the source may revise it; provisional = preliminary; final = will not change. Absent when unknown"
2245
2266
  };
2246
2267
  function describeFromJsonSchema(schema, node, overrides = {}, text = node?.description) {
2247
2268
  let out;
@@ -2282,7 +2303,7 @@ var provenanceBlockSchema = describeFromJsonSchema(
2282
2303
  function withProvenance(schema) {
2283
2304
  return schema.extend({
2284
2305
  provenance: provenanceBlockSchema.describe(
2285
- "Provenance block (contract v1.1): source, URL, data vintage, extraction instant, origin diagnostics, citation, license"
2306
+ "Provenance block: source, URL, data vintage, extraction instant, origin diagnostics, citation, license"
2286
2307
  ),
2287
2308
  attribution: z3.array(z3.string()).describe("Canonical source URLs of this response (attribution list)")
2288
2309
  });
@@ -2290,7 +2311,7 @@ function withProvenance(schema) {
2290
2311
  function withProvenanceMulti(schema) {
2291
2312
  return schema.extend({
2292
2313
  provenance: z3.array(provenanceBlockSchema).describe(
2293
- "One provenance block per upstream source that contributed to this response (contract v1.1; licenses are never merged; each block carries the origin diagnostics of ITS source)"
2314
+ "One provenance block per upstream source that contributed to this response (licenses are never merged; each block carries the origin diagnostics of ITS source)"
2294
2315
  ),
2295
2316
  attribution: z3.array(z3.string()).describe("Canonical source URLs of this response (attribution list)")
2296
2317
  });
@@ -7293,7 +7314,8 @@ with the server** (CID-10 V2008 and the WHO ICD-10 \u2192 ICD-11 transition
7293
7314
  tables), which are NOT covered by the MIT license. Every successful tool
7294
7315
  response carries a provenance block (source, URL, data vintage,
7295
7316
  extraction instant, citation, license); this resource is the
7296
- consolidated notice for the hosted service. The full text ships as
7317
+ consolidated notice for the hosted service \u2014 the license statements below
7318
+ are not repeated in each response's notices. The full text ships as
7297
7319
  NOTICE.md in the npm package.
7298
7320
 
7299
7321
  ## ICD-11 (WHO)
@@ -7351,12 +7373,15 @@ NOTICE.md in the npm package.
7351
7373
  - ATC classification \xA9 WHO Collaborating Centre for Drug Statistics
7352
7374
  Methodology (https://atcddd.fhi.no/); retrieved via NLM RxClass and
7353
7375
  served verbatim. This server never redistributes the WHOCC ATC/DDD
7354
- index itself.
7376
+ index itself. The NLM statement in the RxNorm section applies to the
7377
+ RxClass channel as well.
7355
7378
  - No authentication required to query.
7356
7379
 
7357
7380
  ## MeSH (US National Library of Medicine)
7358
- - U.S. government work under the NLM Terms and Conditions, free of
7359
- charge. Courtesy of the U.S. National Library of Medicine.
7381
+ - U.S. government work under the NLM Terms and Conditions
7382
+ (https://www.nlm.nih.gov/databases/download/terms_and_conditions.html),
7383
+ free of charge. The NLM statement in the RxNorm section applies to this
7384
+ channel as well; no endorsement by NLM is implied.
7360
7385
  - No authentication required.
7361
7386
 
7362
7387
  ## Important caveat for LLM use
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "medical-terminologies-mcp",
3
3
  "mcpName": "io.github.SidneyBissoli/medical-terminologies-mcp",
4
- "version": "2.1.2",
4
+ "version": "2.3.0",
5
5
  "description": "Unified MCP server for six medical terminologies (ICD-11, LOINC, RxNorm, MeSH, ATC, CID-10) with authoritative WHO ICD-10→ICD-11 mapping. 33 tools, hosted endpoint available, MIT.",
6
6
  "author": "Sidney da Silva Pereira Bissoli",
7
7
  "license": "MIT",
@@ -59,19 +59,19 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@modelcontextprotocol/server": "^2.0.0",
62
- "@sbissoli/mcp-provenance": "^0.3.0",
62
+ "@sbissoli/mcp-provenance": "^0.4.0",
63
63
  "@sbissoli/mcp-search": "^0.9.0",
64
- "@sbissoli/mcp-upstream": "^0.4.0",
64
+ "@sbissoli/mcp-upstream": "^0.4.2",
65
65
  "pino": "^10.2.1",
66
66
  "zod": "^4.5.4"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@modelcontextprotocol/client": "^2.0.0",
70
70
  "@sbissoli/mcp-evals": "^0.2.1",
71
- "@sbissoli/mcp-surface": "^0.5.0",
71
+ "@sbissoli/mcp-surface": "^0.6.0",
72
72
  "@types/node": "^26.5.1",
73
73
  "esbuild": "^0.28.2",
74
- "nock": "^14.0.15",
74
+ "nock": "^15.0.1",
75
75
  "pino-pretty": "^13.1.3",
76
76
  "tsx": "^4.23.13",
77
77
  "typescript": "^7.0.2",