paperplain-mcp 1.2.2 → 1.2.3
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/package.json +1 -1
- package/server.js +8 -4
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -262,7 +262,7 @@ async function searchSemanticScholar(query, maxResults) {
|
|
|
262
262
|
// ── MCP Server ─────────────────────────────────────────────────────────────
|
|
263
263
|
const server = new McpServer({
|
|
264
264
|
name: "paperplain",
|
|
265
|
-
version: "1.2.
|
|
265
|
+
version: "1.2.3",
|
|
266
266
|
description:
|
|
267
267
|
"Search 200M+ peer-reviewed papers from PubMed, ArXiv, and Semantic Scholar. Returns papers with full abstracts — use your own model to synthesize findings.",
|
|
268
268
|
});
|
|
@@ -338,8 +338,9 @@ Use the returned abstracts to synthesize findings, answer the user's question, o
|
|
|
338
338
|
safeS2(query, Math.ceil(max_results / 2)),
|
|
339
339
|
]);
|
|
340
340
|
const maxArxiv = Math.ceil(max_results * 0.6);
|
|
341
|
-
|
|
342
|
-
const
|
|
341
|
+
// Deduplicate on URL — S2 uses arxiv.org URLs for arXiv papers, matching exactly
|
|
342
|
+
const arxivUrls = new Set(arxiv.map((p) => p.url));
|
|
343
|
+
const uniqueS2 = s2.filter((p) => !arxivUrls.has(p.url));
|
|
343
344
|
papers = [
|
|
344
345
|
...arxiv.slice(0, maxArxiv),
|
|
345
346
|
...uniqueS2.slice(0, max_results - Math.min(arxiv.length, maxArxiv)),
|
|
@@ -350,12 +351,15 @@ Use the returned abstracts to synthesize findings, answer the user's question, o
|
|
|
350
351
|
safePubMed(query, max_results),
|
|
351
352
|
safeS2(query, Math.ceil(max_results / 2)),
|
|
352
353
|
]);
|
|
354
|
+
// Deduplicate S2 against both ArXiv and PubMed URLs
|
|
355
|
+
const seenUrls = new Set([...arxiv.map((p) => p.url), ...pubmed.map((p) => p.url)]);
|
|
356
|
+
const uniqueS2 = s2.filter((p) => !seenUrls.has(p.url));
|
|
353
357
|
const maxEach = Math.floor(max_results / 3);
|
|
354
358
|
const remainder = max_results - maxEach * 3;
|
|
355
359
|
papers = [
|
|
356
360
|
...arxiv.slice(0, maxEach + remainder),
|
|
357
361
|
...pubmed.slice(0, maxEach),
|
|
358
|
-
...
|
|
362
|
+
...uniqueS2.slice(0, maxEach),
|
|
359
363
|
].slice(0, max_results);
|
|
360
364
|
}
|
|
361
365
|
|