@cyanheads/pubmed-mcp-server 2.10.9 → 2.10.10
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/AGENTS.md +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +4 -3
- package/dist/mcp-server/tools/definitions/fetch-fulltext.tool.d.ts +17 -0
- package/dist/mcp-server/tools/definitions/fetch-fulltext.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/fetch-fulltext.tool.js +297 -62
- package/dist/mcp-server/tools/definitions/fetch-fulltext.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/find-related.tool.d.ts +8 -0
- package/dist/mcp-server/tools/definitions/find-related.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/find-related.tool.js +131 -23
- package/dist/mcp-server/tools/definitions/find-related.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/lookup-mesh.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/lookup-mesh.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/lookup-mesh.tool.js +14 -3
- package/dist/mcp-server/tools/definitions/lookup-mesh.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-articles.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/search-articles.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-articles.tool.js +15 -3
- package/dist/mcp-server/tools/definitions/search-articles.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/spell-check.tool.d.ts +6 -0
- package/dist/mcp-server/tools/definitions/spell-check.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/spell-check.tool.js +15 -3
- package/dist/mcp-server/tools/definitions/spell-check.tool.js.map +1 -1
- package/dist/services/error-contracts.d.ts +22 -2
- package/dist/services/error-contracts.d.ts.map +1 -1
- package/dist/services/error-contracts.js +24 -2
- package/dist/services/error-contracts.js.map +1 -1
- package/dist/services/ncbi/parsing/pmc-article-parser.d.ts +24 -4
- package/dist/services/ncbi/parsing/pmc-article-parser.d.ts.map +1 -1
- package/dist/services/ncbi/parsing/pmc-article-parser.js +498 -56
- package/dist/services/ncbi/parsing/pmc-article-parser.js.map +1 -1
- package/dist/services/ncbi/types.d.ts +43 -0
- package/dist/services/ncbi/types.d.ts.map +1 -1
- package/dist/services/openalex/api-client.d.ts +13 -4
- package/dist/services/openalex/api-client.d.ts.map +1 -1
- package/dist/services/openalex/api-client.js +19 -8
- package/dist/services/openalex/api-client.js.map +1 -1
- package/dist/services/openalex/openalex-service.d.ts +34 -17
- package/dist/services/openalex/openalex-service.d.ts.map +1 -1
- package/dist/services/openalex/openalex-service.js +119 -35
- package/dist/services/openalex/openalex-service.js.map +1 -1
- package/dist/services/openalex/types.d.ts +34 -1
- package/dist/services/openalex/types.d.ts.map +1 -1
- package/dist/services/openalex/types.js +20 -0
- package/dist/services/openalex/types.js.map +1 -1
- package/package.json +1 -1
- package/server.json +3 -3
package/AGENTS.md
CHANGED
package/CLAUDE.md
CHANGED
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/pubmed-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/pubmed-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
13
13
|
|
|
14
14
|
</div>
|
|
15
15
|
|
|
@@ -85,12 +85,13 @@ Fetch full-text articles via a three-stage chain: NCBI PMC EFetch → Europe PMC
|
|
|
85
85
|
- Europe PMC layer (enabled by default; disable with `EUROPEPMC_ENABLED=false`) recovers PMC-counterpart records that NCBI PMC EFetch missed, and resolves DOI input to PMC counterparts when one exists. EPMC's `fullTextXML` is PMC-keyed, so preprints (PPR), patents (PAT), and Agricola (AGR) are reachable via `pubmed_europepmc_search` for metadata but have no full text via this chain.
|
|
86
86
|
- Unpaywall layer (enabled by setting `UNPAYWALL_EMAIL`) resolves DOIs to legal OA copies; extracts HTML landing pages to Markdown via Defuddle or PDFs to text via unpdf
|
|
87
87
|
- Discriminated output contract — `source: "pmc"` (structured sections, regardless of whether it came from PMC or EPMC) or `source: "unpaywall"` (best-effort body + `contentFormat`: `html-markdown` or `pdf-text`)
|
|
88
|
-
- Structured unavailable reasons (`not-found`, `no-pmc-fallback-disabled`, `no-epmc-fulltext`, `no-body`, `no-doi`, `no-oa`, `fetch-failed`, `parse-failed`, `service-error`) so callers can retry or explain to users without parsing text
|
|
88
|
+
- Structured unavailable reasons (`not-found`, `no-pmc-fallback-disabled`, `no-epmc-fulltext`, `no-body`, `no-doi`, `doi-lookup-failed`, `no-oa`, `fetch-failed`, `parse-failed`, `service-error`) so callers can retry or explain to users without parsing text. `no-doi` and `doi-lookup-failed` are the settled and unsettled halves of the same gap: the first means the DOI lookup ran and the record has none, the second that the lookup itself errored, so a DOI may well exist and the request is worth retrying
|
|
89
89
|
- An `unavailable` entry also carries `unqueriedTiers` when the chain skipped a tier this deployment has not configured and that tier could have served the id — the search was incomplete, and a deployment with those tiers configured may still resolve it
|
|
90
90
|
- Each `unavailable` entry carries `idType` (`pmid` / `pmcid` / `doi`) and `triedTiers` — per-tier outcomes (`not-attempted`, `miss`, `no-fulltext`, `service-error`, …) in execution order, so callers can see which stage failed and why
|
|
91
91
|
- Section filtering by title (case-insensitive substring match at any nesting depth, e.g. `["methods", "results"]`) and configurable max sections apply to PMC output. A section that matches directly is returned whole; one kept only because a nested subsection matched keeps its heading as a breadcrumb with its own text cleared
|
|
92
92
|
- Tables are returned as structured cells (`tables[]` on each PMC article — rows, caption, label, footnotes, and the enclosing section, named for back-matter and appendix tables as well as body ones), covering `<floats-group>`, `<back>` and appendix deposits alongside body tables. `colspan` and `rowspan` are expanded to one entry per grid column, so a value stays under the header it belongs to on both output surfaces; a cell spanning several columns or rows repeats across the cells it covers. A deposit with no readable markup comes back labelled with an `unextractableReason` rather than silently missing. Turn them off with `includeTables: false`
|
|
93
|
-
-
|
|
93
|
+
- Figures and supplementary material come back as structured entries (`assets[]` on each PMC article — `assetType`, label, caption, the enclosing section, and the `<graphic>`/`<media>` pointer exactly as deposited, which is a name inside the PMC deposit rather than a fetchable URL), covering `<floats-group>`, `<back>` and appendix placements alongside body ones. Each one lifted out of the body leaves a `[Figure: <label>]` / `[Supplementary: <label>]` marker at its position, so reading order survives the lift. Turn them off with `includeAssets: false`, which removes the markers with them. Prose-shaped blocks — lists, definition lists, block quotes, boxed text, preformatted blocks, displayed formulae — render into the section text at their document position instead, and no block is ever concatenated into a neighbouring sentence
|
|
94
|
+
- Character budgets keep context size predictable: `maxCharacters` caps body text per article (PMC sections and subsections, inline blocks included, plus table content — cell, caption, label and footnote text, not the Markdown grid rendered around it — and asset label, caption and pointer text; or the Unpaywall body), `maxCharactersPerSection` caps a single PMC section, and `overflowMode` picks between `truncate` (fill sections in document order) and `outline` (split the budget evenly so every heading survives with an excerpt). Sections are served first, then tables, then assets, each spending what is left in document order until one does not fit; that entry and the rest are dropped whole rather than cut mid-row or returned with a shortened caption, and named in `truncation.articles[].omittedTableNames` / `omittedAssetNames`. Budgets run after the semantic filters, and a `truncation` object reports per-article and per-section character counts whenever anything was shortened
|
|
94
95
|
- `maxResponseCharacters` bounds the whole response instead of each body: every field of a returned record counts (abstract, references, metadata, body), one ledger across PMC-, Europe PMC-, and Unpaywall-served articles. Articles past the ceiling are deferred whole, with their ids — in the branch they were requested under — in `deferred.ids` for a follow-up call
|
|
95
96
|
- Up to 10 articles per request
|
|
96
97
|
|
|
@@ -35,6 +35,7 @@ export declare const fetchFulltextTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
35
35
|
dois: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
36
|
includeReferences: z.ZodDefault<z.ZodBoolean>;
|
|
37
37
|
includeTables: z.ZodDefault<z.ZodBoolean>;
|
|
38
|
+
includeAssets: z.ZodDefault<z.ZodBoolean>;
|
|
38
39
|
maxSections: z.ZodOptional<z.ZodNumber>;
|
|
39
40
|
sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
40
41
|
maxCharacters: z.ZodOptional<z.ZodNumber>;
|
|
@@ -102,6 +103,17 @@ export declare const fetchFulltextTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
102
103
|
"no-rows": "no-rows";
|
|
103
104
|
}>>;
|
|
104
105
|
}, z.core.$strip>>>;
|
|
106
|
+
assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
107
|
+
assetType: z.ZodEnum<{
|
|
108
|
+
figure: "figure";
|
|
109
|
+
"supplementary-material": "supplementary-material";
|
|
110
|
+
}>;
|
|
111
|
+
label: z.ZodOptional<z.ZodString>;
|
|
112
|
+
caption: z.ZodOptional<z.ZodString>;
|
|
113
|
+
id: z.ZodOptional<z.ZodString>;
|
|
114
|
+
sectionTitle: z.ZodOptional<z.ZodString>;
|
|
115
|
+
href: z.ZodOptional<z.ZodString>;
|
|
116
|
+
}, z.core.$strip>>>;
|
|
105
117
|
references: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
106
118
|
citation: z.ZodString;
|
|
107
119
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -138,6 +150,7 @@ export declare const fetchFulltextTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
138
150
|
pmid: "pmid";
|
|
139
151
|
}>;
|
|
140
152
|
reason: z.ZodEnum<{
|
|
153
|
+
"doi-lookup-failed": "doi-lookup-failed";
|
|
141
154
|
"fetch-failed": "fetch-failed";
|
|
142
155
|
"no-body": "no-body";
|
|
143
156
|
"no-doi": "no-doi";
|
|
@@ -155,6 +168,7 @@ export declare const fetchFulltextTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
155
168
|
unpaywall: "unpaywall";
|
|
156
169
|
}>;
|
|
157
170
|
outcome: z.ZodEnum<{
|
|
171
|
+
"doi-lookup-failed": "doi-lookup-failed";
|
|
158
172
|
"fetch-failed": "fetch-failed";
|
|
159
173
|
miss: "miss";
|
|
160
174
|
"no-body": "no-body";
|
|
@@ -183,6 +197,7 @@ export declare const fetchFulltextTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
183
197
|
returnedCharacters: z.ZodNumber;
|
|
184
198
|
omittedSections: z.ZodNumber;
|
|
185
199
|
omittedTables: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
omittedAssets: z.ZodOptional<z.ZodNumber>;
|
|
186
201
|
articles: z.ZodArray<z.ZodObject<{
|
|
187
202
|
id: z.ZodString;
|
|
188
203
|
source: z.ZodEnum<{
|
|
@@ -199,6 +214,8 @@ export declare const fetchFulltextTool: import("@cyanheads/mcp-ts-core").ToolDef
|
|
|
199
214
|
}, z.core.$strip>>>;
|
|
200
215
|
omittedTables: z.ZodOptional<z.ZodNumber>;
|
|
201
216
|
omittedTableNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
217
|
+
omittedAssets: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
omittedAssetNames: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
202
219
|
}, z.core.$strip>>;
|
|
203
220
|
}, z.core.$strip>>;
|
|
204
221
|
deferred: z.ZodOptional<z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-fulltext.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/fetch-fulltext.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch-fulltext.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/fetch-fulltext.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAsB,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAi0C/D;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;CACpB,GAAG,MAAM,CAiCT;AAID,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAs3B5B,CAAC"}
|