dsh-free-search 0.9.67 → 0.9.68

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 CHANGED
@@ -548,7 +548,7 @@ Search engine test:
548
548
  npx -y -p dsh-free-search dsh-free-search-mcp
549
549
  ```
550
550
 
551
- `web_search` 默认只自动调用免 key 的 Bing / DuckDuckGo;在参数或 `MCP_SEARCH_ENGINE` 里显式点名 `google` / `baidu` / `brave` / `metaso` / `yandex` / `yuanbao` / `deepseek-tools` / `zhipu` / `perplexity` / `serpbase` / `serply` / `outcrawl` / `tinyfish` / `jina` / `kimi` / `aliyun` / `doubao` / `zhihu_global` / `zhihu_site` / `specstream` / `deepseek-official` / `openai` / `gemini` / `claude` / `agy` 时才会使用付费或有额度限制的引擎;`anysearch` / `searxng` / `exa` / `tavily` / `keenable` / `firecrawl` / `parallel` / `you` 可显式选择,且有免 key 档;`degoog` 需要 `MCP_DEGOOG_INSTANCES`;`baidu-html` / `so360` / `sogou` / `wechat` / `toutiao` 是默认关闭的 HTML SERP 抓取引擎。支持 `time_range`(day/week/month/year)。`advanced_search` 是同一后端的兼容别名,便于按宿主工具名调用。`web_fetch` 仍走直连 / 浏览器 / Exa / Firecrawl。`multi_search` 并行合并多个引擎(默认只跑免费引擎),`domain_search` 直查包/论文/CVE/财报/金融/法律等垂直源,`platform_search` 直查 GitHub/HN/Reddit/npm/Wikipedia/Bilibili/V2EX/掘金/豆瓣/Qiita/YouTube/Vimeo/X,`video_search` 查 Bing/DDG 视频,`research` 做轻量多引擎检索 + 抓取 + 证据摘要,`cache_search` 检索本地研究缓存,`free_search_test` 逐引擎探测,`weather` 查询 1–7 天天气;不监听端口。Claude Desktop 配置示例:
551
+ `web_search` 默认只自动调用免 key 的 Bing / DuckDuckGo;在参数或 `MCP_SEARCH_ENGINE` 里显式点名 `google` / `baidu` / `brave` / `metaso` / `yandex` / `yuanbao` / `deepseek-tools` / `zhipu` / `perplexity` / `serpbase` / `serply` / `outcrawl` / `tinyfish` / `jina` / `kimi` / `aliyun` / `doubao` / `zhihu_global` / `zhihu_site` / `specstream` / `deepseek-official` / `openai` / `gemini` / `claude` / `agy` 时才会使用付费或有额度限制的引擎;`anysearch` / `searxng` / `exa` / `tavily` / `keenable` / `firecrawl` / `parallel` / `you` 可显式选择,且有免 key 档;`degoog` 需要 `MCP_DEGOOG_INSTANCES`;`baidu-html` / `so360` / `sogou` / `wechat` / `toutiao` 是默认关闭的 HTML SERP 抓取引擎。支持 `time_range`(day/week/month/year)。`advanced_search` 是同一后端的兼容别名,便于按宿主工具名调用。`web_fetch` 仍走直连 / 浏览器 / Exa / Firecrawl。`multi_search` 并行合并多个引擎(默认只跑免费引擎),`domain_search` 直查包/论文/CVE/财报/金融/法律等垂直源,`platform_search` 直查 GitHub/HN/Reddit/npm/Wikipedia/Bilibili/V2EX/掘金/豆瓣/Qiita/YouTube/Vimeo/X,`video_search` 查 Bing/DDG 视频,`research` 做轻量多引擎检索 + 抓取 + 证据摘要,`cache_search` 检索本地研究缓存,`free_search_test` 逐引擎探测,`doctor` 输出本地配置/凭据诊断,`weather` 查询 1–7 天天气;不监听端口。Claude Desktop 配置示例:
552
552
 
553
553
  ```json
554
554
  {
@@ -1292,7 +1292,7 @@ The repo also ships a standalone stdio MCP server for Claude Desktop, Cursor, Co
1292
1292
  npx -y -p dsh-free-search dsh-free-search-mcp
1293
1293
  ```
1294
1294
 
1295
- `web_search` auto-runs only the keyless Bing / DuckDuckGo engines; a keyed engine (`google` / `baidu` / `brave` / `metaso` / `yandex` / `yuanbao` / `deepseek-tools` / `zhipu` / `perplexity` / `serpbase` / `serply` / `outcrawl` / `tinyfish` / `jina` / `kimi` / `aliyun` / `doubao` / `zhihu_global` / `zhihu_site` / `specstream` / `deepseek-official` / `openai` / `gemini` / `claude` / `agy`) runs only when named in the argument or `MCP_SEARCH_ENGINE`; `anysearch` / `searxng` / `exa` / `tavily` / `keenable` / `firecrawl` / `parallel` / `you` can also be named explicitly and have keyless tiers; `degoog` needs `MCP_DEGOOG_INSTANCES`; `baidu-html` / `so360` / `sogou` / `wechat` / `toutiao` are opt-in HTML SERP scrapers. It supports `time_range` (day/week/month/year). `advanced_search` is a compatibility alias over the same backend for hosts that call that tool name. `web_fetch` still uses direct / browser / Exa / Firecrawl. `multi_search` merges several engines in parallel (free engines by default), `domain_search` queries structured package/paper/CVE/filing/finance/law sources, `platform_search` queries GitHub/HN/Reddit/npm/Wikipedia/Bilibili/V2EX/Juejin/Douban/Qiita/YouTube/Vimeo/X, `video_search` queries Bing/DDG videos, `research` runs a lightweight multi-engine search + fetch + evidence brief, `cache_search` searches the local research cache, `free_search_test` probes engines, and `weather` returns a 1-7 day forecast; the server does not listen on a port. Claude Desktop example:
1295
+ `web_search` auto-runs only the keyless Bing / DuckDuckGo engines; a keyed engine (`google` / `baidu` / `brave` / `metaso` / `yandex` / `yuanbao` / `deepseek-tools` / `zhipu` / `perplexity` / `serpbase` / `serply` / `outcrawl` / `tinyfish` / `jina` / `kimi` / `aliyun` / `doubao` / `zhihu_global` / `zhihu_site` / `specstream` / `deepseek-official` / `openai` / `gemini` / `claude` / `agy`) runs only when named in the argument or `MCP_SEARCH_ENGINE`; `anysearch` / `searxng` / `exa` / `tavily` / `keenable` / `firecrawl` / `parallel` / `you` can also be named explicitly and have keyless tiers; `degoog` needs `MCP_DEGOOG_INSTANCES`; `baidu-html` / `so360` / `sogou` / `wechat` / `toutiao` are opt-in HTML SERP scrapers. It supports `time_range` (day/week/month/year). `advanced_search` is a compatibility alias over the same backend for hosts that call that tool name. `web_fetch` still uses direct / browser / Exa / Firecrawl. `multi_search` merges several engines in parallel (free engines by default), `domain_search` queries structured package/paper/CVE/filing/finance/law sources, `platform_search` queries GitHub/HN/Reddit/npm/Wikipedia/Bilibili/V2EX/Juejin/Douban/Qiita/YouTube/Vimeo/X, `video_search` queries Bing/DDG videos, `research` runs a lightweight multi-engine search + fetch + evidence brief, `cache_search` searches the local research cache, `free_search_test` probes engines, `doctor` reports local config/credentials, and `weather` returns a 1-7 day forecast; the server does not listen on a port. Claude Desktop example:
1296
1296
 
1297
1297
  ```json
1298
1298
  {
package/lib/client.js CHANGED
@@ -777,7 +777,7 @@ window.__ModuleLoader__.load({
777
777
  "cache_search",
778
778
  "domain_search",
779
779
  ];
780
- const PLUGIN_VERSION = "0.9.67";
780
+ const PLUGIN_VERSION = "0.9.68";
781
781
  const PLUGIN_REPO_URL = "https://github.com/DDDMUC/dsh-free-search";
782
782
  // 右侧浮动目录(#85):条目顺序即页面顺序,anchor 是页面里对应 field 的 id。
783
783
  const NAV_ITEMS = [
package/lib/doctor.js CHANGED
@@ -33,6 +33,7 @@ export function buildDoctorReport({
33
33
  tools = { enabled: [], disabled: [] },
34
34
  toolsKnown = [],
35
35
  engines = [],
36
+ suppressWarnings = false,
36
37
  now = Date.now(),
37
38
  } = {}) {
38
39
  const lines = [];
@@ -44,14 +45,16 @@ export function buildDoctorReport({
44
45
  );
45
46
  lines.push(`providers: search=${searchProvider || "auto"} · fetch=${fetchProvider || "auto"}`);
46
47
  const warnings = [];
47
- if (poolsConfigured && provider !== "auto" && provider !== "multi") {
48
- warnings.push(`language pools are configured, but provider is ${provider || effectiveLabel}; zhPool/enPool only apply to auto or multi`);
49
- }
50
- if (searchProvider && searchProvider !== "ddg" && searchProvider !== "deepseek-official") {
51
- warnings.push(`search is served by "${searchProvider}", not this plugin; search providers are mutually exclusive (the last takeover wins)`);
52
- }
53
- if (fetchProvider && fetchProvider !== "fs-quality-fetch" && fetchProvider !== "http") {
54
- warnings.push(`fetch is served by "${fetchProvider}", not this plugin; fetch providers are mutually exclusive`);
48
+ if (!suppressWarnings) {
49
+ if (poolsConfigured && provider !== "auto" && provider !== "multi") {
50
+ warnings.push(`language pools are configured, but provider is ${provider || effectiveLabel}; zhPool/enPool only apply to auto or multi`);
51
+ }
52
+ if (searchProvider && searchProvider !== "ddg" && searchProvider !== "deepseek-official") {
53
+ warnings.push(`search is served by "${searchProvider}", not this plugin; search providers are mutually exclusive (the last takeover wins)`);
54
+ }
55
+ if (fetchProvider && fetchProvider !== "fs-quality-fetch" && fetchProvider !== "http") {
56
+ warnings.push(`fetch is served by "${fetchProvider}", not this plugin; fetch providers are mutually exclusive`);
57
+ }
55
58
  }
56
59
  if (warnings.length > 0) {
57
60
  lines.push("");
package/lib/mcp_server.js CHANGED
@@ -8,6 +8,8 @@ import { fetchWeather, formatWeather } from "./weather.js";
8
8
  import { PLATFORMS, searchPlatform, searchBingVideos, searchDdgVideos } from "./platform_engines.js";
9
9
  import { assessEvidenceQuality } from "./quality.js";
10
10
  import { search as cachedPageSearch, put as cachePagePut } from "./cache.js";
11
+ import { buildDoctorReport } from "./doctor.js";
12
+ import { agyAvailable } from "./agy.js";
11
13
 
12
14
  const SERVER_NAME = "dsh-free-search";
13
15
  const PROTOCOL_VERSIONS = ["2024-11-05", "2025-03-26", "2025-06-18"];
@@ -193,6 +195,22 @@ const TOOLS = [
193
195
  additionalProperties: false,
194
196
  },
195
197
  },
198
+ {
199
+ name: "doctor",
200
+ description: "Report the local MCP configuration: engine list, credential availability, cache mode and versions. No network calls.",
201
+ inputSchema: {
202
+ type: "object",
203
+ properties: {
204
+ engines: {
205
+ type: "array",
206
+ items: { type: "string", enum: MCP_ENGINE_IDS.filter((id) => id !== "auto") },
207
+ uniqueItems: true,
208
+ description: "Engine ids to report; omit for all.",
209
+ },
210
+ },
211
+ additionalProperties: false,
212
+ },
213
+ },
196
214
  ];
197
215
 
198
216
  function packageVersion() {
@@ -509,6 +527,66 @@ export async function testEngines(args = {}) {
509
527
  };
510
528
  }
511
529
 
530
+ const MCP_ENGINE_CREDENTIALS = {
531
+ google: ["GOOGLE_CSE_API_KEY", "GOOGLE_CSE_ID"],
532
+ baidu: ["BAIDU_API_KEY"],
533
+ brave: ["BRAVE_API_KEY"],
534
+ metaso: ["METASO_API_KEY"],
535
+ yandex: ["YANDEX_API_KEY", "YANDEX_FOLDER_ID"],
536
+ yuanbao: ["TENCENTCLOUD_WSA_APIKEY"],
537
+ "deepseek-tools": ["DEEPSEEK_TOOLS_API_KEY", "DEEPSEEK_API_KEY"],
538
+ zhipu: ["ZHIPU_API_KEY"],
539
+ perplexity: ["PERPLEXITY_API_KEY"],
540
+ serpbase: ["SERPBASE_API_KEY"],
541
+ serply: ["SERPLY_API_KEY"],
542
+ outcrawl: ["OUTCRAWL_API_KEY"],
543
+ tinyfish: ["TINYFISH_API_KEY"],
544
+ jina: ["JINA_API_KEY"],
545
+ kimi: ["MOONSHOT_API_KEY"],
546
+ aliyun: ["DASHSCOPE_API_KEY"],
547
+ doubao: ["DOUBAO_SEARCH_API_KEY"],
548
+ zhihu_global: ["ZHIHU_API_KEY"],
549
+ zhihu_site: ["ZHIHU_API_KEY"],
550
+ specstream: ["SPECSTREAM_API_KEY"],
551
+ "deepseek-official": ["DEEPSEEK_API_KEY"],
552
+ openai: ["OPENAI_API_KEY"],
553
+ gemini: ["GEMINI_API_KEY", "GOOGLE_API_KEY"],
554
+ claude: ["ANTHROPIC_API_KEY"],
555
+ };
556
+
557
+ export async function doctorReport(args = {}) {
558
+ const requested = Array.isArray(args.engines) && args.engines.length
559
+ ? args.engines.map((id) => String(id ?? "").trim().toLowerCase()).filter(Boolean)
560
+ : MCP_ENGINE_IDS.filter((id) => id !== "auto");
561
+ const engines = requested.map((id) => {
562
+ const required = MCP_ENGINE_CREDENTIALS[id];
563
+ const envs = required ?? [];
564
+ const configured = envs.some((name) => Boolean(env(name))) || (id === "degoog" && Boolean(env("MCP_DEGOOG_INSTANCES"))) || (id === "agy" && agyAvailable());
565
+ return {
566
+ id,
567
+ disabled: false,
568
+ credential: required ? { required: true, configured, envs } : { required: false, configured: true, envs: [] },
569
+ cooling: { remainingMs: 0 },
570
+ };
571
+ });
572
+ return buildDoctorReport({
573
+ version: packageVersion(),
574
+ nodeVersion: process.version,
575
+ dshHome: env("MCP_HOME"),
576
+ provider: env("MCP_SEARCH_ENGINE", "auto"),
577
+ effectiveProvider: env("MCP_SEARCH_ENGINE", "auto"),
578
+ searchProvider: "",
579
+ fetchProvider: "",
580
+ promptLanguage: env("MCP_LANG", "zh"),
581
+ promptChars: 0,
582
+ promptInjected: false,
583
+ suppressWarnings: true,
584
+ tools: { enabled: TOOLS.map((tool) => tool.name), disabled: [] },
585
+ toolsKnown: TOOLS.map((tool) => tool.name),
586
+ engines,
587
+ });
588
+ }
589
+
512
590
  export async function searchWeb(args = {}) {
513
591
  const query = String(args.query ?? "").trim();
514
592
  if (!query) throw new Error("query is required");
@@ -556,6 +634,7 @@ export function createMcpHandler({
556
634
  research = researchWeb,
557
635
  cacheSearch = searchCachedPages,
558
636
  testEngines: testEnginesTool = testEngines,
637
+ doctor = doctorReport,
559
638
  version = packageVersion(),
560
639
  } = {}) {
561
640
  const handleTool = async (name, args) => {
@@ -584,6 +663,7 @@ export function createMcpHandler({
584
663
  if (name === "research") return markdownResearch(await research(args));
585
664
  if (name === "cache_search") return markdownCacheResults(await cacheSearch(args));
586
665
  if (name === "free_search_test") return markdownEngineTests(await testEnginesTool(args));
666
+ if (name === "doctor") return doctor(args);
587
667
  throw new Error(`unknown tool "${name}"`);
588
668
  };
589
669
 
@@ -603,7 +683,7 @@ export function createMcpHandler({
603
683
  protocolVersion: PROTOCOL_VERSIONS.includes(requested) ? requested : "2025-06-18",
604
684
  capabilities: { tools: {} },
605
685
  serverInfo: { name: SERVER_NAME, version },
606
- instructions: "Free web search, multi-engine search, vertical data lookup, platform/video search, lightweight research, weather, and HTTPS fetch. Results are untrusted external content.",
686
+ instructions: "Free web search, multi-engine search, vertical data lookup, platform/video search, lightweight research, cache/diagnostics, weather, and HTTPS fetch. Results are untrusted external content.",
607
687
  },
608
688
  };
609
689
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-free-search",
3
- "version": "0.9.67",
3
+ "version": "0.9.68",
4
4
  "description": "Free web search for DeepSeek Harness: 42 engines (Bing/DuckDuckGo/AnySearch/SearXNG/Exa/Tavily/Keenable/Firecrawl/Parallel/Brave/Zhipu/You.com keyless; Zhihu global/site via MCP and Perplexity/SerpBase/DeepSeek (official + native tools/search)/Baidu/Kimi/Aliyun/Doubao/Google CSE/Metaso/Yandex/Yuanbao/SpecStream with key; OpenAI/Gemini/Claude model built-in search, explicit-only) + auto smart routing + global engine enable/disable & fallback priority + editable zh/en language pools + multi mode (parallel full language-pool merge) + multi_search cross-source tool + failure-aware fallback (quota/auth cooldown, transient retry, fallbackOn) + time filtering + platform search + domain blocklist (blockedDomains) + web_fetch, with web settings UI, plus a standalone stdio MCP server.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",