sciverse-mcp-server 0.13.1 → 0.14.1
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/README.md +1 -1
- package/dist/generated/tools.d.ts +1 -1
- package/dist/generated/tools.js +14 -7
- package/dist/tools.js +12 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -217,7 +217,7 @@ Token / endpoint 解析顺序:MCP 配置里显式 `env` → `SCIVERSE_API_TOKE
|
|
|
217
217
|
|---|---|
|
|
218
218
|
| `search_papers` | 结构化元数据检索(作者 / 年份 / 期刊 / 学科) |
|
|
219
219
|
| `semantic_search` | 自然语言语义检索(RAG 用) |
|
|
220
|
-
| `read_content` |
|
|
220
|
+
| `read_content` | 按 Unicode 码点区间读文献原文 |
|
|
221
221
|
| `list_catalog` | 字段 introspection(返回所有字段名 + 枚举值样本,agent 接入时建议先调一次学 schema) |
|
|
222
222
|
| `get_resource` | 取文献附属图片字节流;MCP server 包装为 `image` content block + base64 + mimeType,多模态模型(如 Claude)可直接读图 |
|
|
223
223
|
|
package/dist/generated/tools.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Auto-generated by scripts/gen-tools.mjs. Do not edit.
|
|
2
2
|
// Source of truth: openapi.yaml
|
|
3
|
-
export const TOOLS_VERSION = "0.
|
|
3
|
+
export const TOOLS_VERSION = "0.14.1";
|
|
4
4
|
export const TOOLS = [
|
|
5
5
|
{
|
|
6
6
|
"name": "search_papers",
|
|
@@ -122,11 +122,13 @@ export const TOOLS = [
|
|
|
122
122
|
"sort_by_year": {
|
|
123
123
|
"type": "string",
|
|
124
124
|
"enum": [
|
|
125
|
+
"auto",
|
|
125
126
|
"desc",
|
|
126
127
|
"asc",
|
|
127
128
|
"none"
|
|
128
129
|
],
|
|
129
|
-
"default": "
|
|
130
|
+
"default": "auto",
|
|
131
|
+
"description": "按发表年份排序。默认 auto:传了 query(或 sort_advanced)时不加年份排序\n——保留 BM25 相关性排序,且 freshness/impact/language_affinity 软加权可用;\n纯结构化筛选(无 query)时按年份降序(否则后端默认序是 unique_id,实质乱序)。\n⚠️ 不要用 query + desc 求「最相关且最新」:显式排序会让 query 退化为命中\n过滤(OR 语义、无相关性排序)、三个软加权全部失效——返回的是「含任一关键词\n的最新文档」。要「相关且偏新」请用 freshness_boost。\n"
|
|
130
132
|
},
|
|
131
133
|
"freshness_boost": {
|
|
132
134
|
"type": "string",
|
|
@@ -165,9 +167,10 @@ export const TOOLS = [
|
|
|
165
167
|
},
|
|
166
168
|
"page_size": {
|
|
167
169
|
"type": "integer",
|
|
168
|
-
"default":
|
|
170
|
+
"default": 25,
|
|
169
171
|
"minimum": 1,
|
|
170
|
-
"maximum": 50
|
|
172
|
+
"maximum": 50,
|
|
173
|
+
"description": "每页条数。省略时为服务端默认 25(SDK / MCP 不注入默认值);工具层上限 50。"
|
|
171
174
|
}
|
|
172
175
|
}
|
|
173
176
|
}
|
|
@@ -328,7 +331,7 @@ export const TOOLS = [
|
|
|
328
331
|
},
|
|
329
332
|
{
|
|
330
333
|
"name": "read_content",
|
|
331
|
-
"description": "Read a
|
|
334
|
+
"description": "Read a range of a paper's original text addressed in Unicode code\npoints (offset/limit count characters like Python len(), not bytes).\nTypically used with a doc_id/offset returned by semantic_search to\nexpand context (read more text before or after a chunk).\nReturns: text fragment, bytes_returned (UTF-8 byte length of text, for\nreference only), next_offset (code-point offset of the next fragment —\npage with it, never with bytes_returned), more (boolean).\nServer behaviour: limit above 524288 is silently clamped; omitting\noffset returns the whole document ignoring limit — the SDKs / MCP\nserver send offset=0 and limit=4096 by default, so pass offset\nexplicitly when calling the HTTP API directly.",
|
|
332
335
|
"inputSchema": {
|
|
333
336
|
"type": "object",
|
|
334
337
|
"properties": {
|
|
@@ -339,13 +342,17 @@ export const TOOLS = [
|
|
|
339
342
|
"offset": {
|
|
340
343
|
"type": "integer",
|
|
341
344
|
"format": "int64",
|
|
342
|
-
"default": 0
|
|
345
|
+
"default": 0,
|
|
346
|
+
"minimum": 0,
|
|
347
|
+
"description": "起始 Unicode 码点偏移,直接使用 semantic_search 返回的 offset。默认 0。"
|
|
343
348
|
},
|
|
344
349
|
"limit": {
|
|
345
350
|
"type": "integer",
|
|
346
351
|
"format": "int64",
|
|
347
352
|
"default": 4096,
|
|
348
|
-
"
|
|
353
|
+
"minimum": 1,
|
|
354
|
+
"maximum": 524288,
|
|
355
|
+
"description": "最多返回的 Unicode 码点数。默认 4096;服务端上限 524288(超出静默钳制)。LLM 场景建议 ≤ 16384,避免撑爆上下文。"
|
|
349
356
|
}
|
|
350
357
|
},
|
|
351
358
|
"required": [
|
package/dist/tools.js
CHANGED
|
@@ -39,8 +39,14 @@ function toBackendPayload(args) {
|
|
|
39
39
|
filters.push({ operator: "FILTER_OP_EQ", ...item });
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
// sort_by_year 默认 auto:有 query(或 sort_advanced)时不加年份排序——保 BM25
|
|
43
|
+
// 相关性且软加权可用;纯结构化筛选时按年份降序(后端默认序实质乱序)。
|
|
44
|
+
let sortByYear = args.sort_by_year ?? "auto";
|
|
45
|
+
if (sortByYear === "auto") {
|
|
46
|
+
sortByYear = args.query || (Array.isArray(args.sort_advanced) && args.sort_advanced.length > 0)
|
|
47
|
+
? "none" : "desc";
|
|
48
|
+
}
|
|
49
|
+
if (sortByYear !== "none") {
|
|
44
50
|
sort.push({
|
|
45
51
|
field: "publication_published_year",
|
|
46
52
|
order: sortByYear === "desc" ? "SORT_ORDER_DESC" : "SORT_ORDER_ASC",
|
|
@@ -203,7 +209,10 @@ export async function executeTool(config, name, args) {
|
|
|
203
209
|
content: [{ type: "text", text: JSON.stringify({ error: "doc_id is required" }) }],
|
|
204
210
|
};
|
|
205
211
|
}
|
|
206
|
-
|
|
212
|
+
// 后端未传 offset 时返回整篇全文并忽略 limit;这里始终显式传两者,避免把整篇论文灌进模型上下文。
|
|
213
|
+
return call(config, "GET", endpoint.path, {
|
|
214
|
+
query: { doc_id, offset: offset ?? 0, limit: limit ?? 4096 },
|
|
215
|
+
});
|
|
207
216
|
}
|
|
208
217
|
case "get_resource": {
|
|
209
218
|
const { file_name } = args;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sciverse-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "Sciverse MCP server — exposes academic paper retrieval (search_papers / semantic_search / read_content) to MCP-compatible coding agents (Claude Code, Cursor, Codex CLI, Windsurf, ...).",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/opendatalab/Sciverse-Agent-Tools/tree/main/packages/mcp",
|