sciverse-mcp-server 0.11.0 → 0.11.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/dist/generated/tools.d.ts +1 -1
- package/dist/generated/tools.js +1 -1
- package/dist/tools.js +32 -2
- package/package.json +1 -1
package/dist/generated/tools.js
CHANGED
package/dist/tools.js
CHANGED
|
@@ -58,6 +58,25 @@ function toBackendPayload(args) {
|
|
|
58
58
|
out.sort = sort;
|
|
59
59
|
return out;
|
|
60
60
|
}
|
|
61
|
+
// 上游 agentic-search(Go 服务)没有 mode 字段,未知字段会被静默丢弃,
|
|
62
|
+
// 所以 mode 必须在这里翻译为上游真实参数 retrieval / sub_queries。
|
|
63
|
+
// 与 packages/typescript/src/client.ts 的 SEMANTIC_MODE_MAP 保持一致(同 toBackendPayload 的复制约定)。
|
|
64
|
+
const SEMANTIC_MODE_MAP = {
|
|
65
|
+
fast: { retrieval: "es" },
|
|
66
|
+
balanced: { retrieval: "hybrid" },
|
|
67
|
+
quality: { retrieval: "hybrid", sub_queries: 3 },
|
|
68
|
+
};
|
|
69
|
+
function toSemanticSearchPayload(args) {
|
|
70
|
+
const { mode, ...rest } = args;
|
|
71
|
+
if (mode === undefined || mode === null)
|
|
72
|
+
return rest;
|
|
73
|
+
const mapped = SEMANTIC_MODE_MAP[mode];
|
|
74
|
+
if (!mapped) {
|
|
75
|
+
throw new Error(`mode must be one of ${Object.keys(SEMANTIC_MODE_MAP).join(" / ")}, got ${JSON.stringify(mode)}`);
|
|
76
|
+
}
|
|
77
|
+
// 显式传入的 retrieval / sub_queries 优先于 mode 映射。
|
|
78
|
+
return { ...mapped, ...rest };
|
|
79
|
+
}
|
|
61
80
|
const PLATFORM = process.platform;
|
|
62
81
|
async function call(config, method, path, options = {}) {
|
|
63
82
|
const url = new URL(`${config.baseUrl}${path}`);
|
|
@@ -152,8 +171,19 @@ export async function executeTool(config, name, args) {
|
|
|
152
171
|
switch (name) {
|
|
153
172
|
case "search_papers":
|
|
154
173
|
return call(config, "POST", endpoint.path, { body: toBackendPayload(args) });
|
|
155
|
-
case "semantic_search":
|
|
156
|
-
|
|
174
|
+
case "semantic_search": {
|
|
175
|
+
let body;
|
|
176
|
+
try {
|
|
177
|
+
body = toSemanticSearchPayload(args);
|
|
178
|
+
}
|
|
179
|
+
catch (e) {
|
|
180
|
+
return {
|
|
181
|
+
isError: true,
|
|
182
|
+
content: [{ type: "text", text: JSON.stringify({ error: e.message }) }],
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
return call(config, "POST", endpoint.path, { body });
|
|
186
|
+
}
|
|
157
187
|
case "list_catalog": {
|
|
158
188
|
const { include_sample_values, include_field_stats, collection } = args;
|
|
159
189
|
const query = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sciverse-mcp-server",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.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",
|