@nite07/websearch-mcp 0.2.1 → 0.2.2

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
@@ -13,9 +13,9 @@ MCP client: Claude Code, Codex, DeepSeek Harness, or your own.
13
13
 
14
14
  Most MCP search servers pick a provider for you and hide what happens when it fails. This one does the
15
15
  opposite: every backend has an explicit access mode, every access mode carries a cost tier, and a
16
- failure comes back named instead of as an empty result. The model can also steer a single call —
17
- parallel or single, which backends, how much of each source — so a cheap lookup does not cost the same
18
- as a broad sweep.
16
+ failure comes back named instead of as an empty result. The model can also steer a single call — which
17
+ backends, how much of each source — so a cheap lookup does not cost the same as a broad sweep. How many
18
+ run is the caller's decision: one id in `backends` runs one backend, several run in parallel.
19
19
 
20
20
  ## Install
21
21
 
@@ -149,7 +149,7 @@ carries the token the read needs) or a note id an earlier search returned.
149
149
 
150
150
  | Tool | What it does |
151
151
  | --- | --- |
152
- | `web_search` | Search across the enabled backends. Takes `query`, plus optional `mode`, `backends`, `allBackends`, `exclude`, `backend`, `compact` and `maxResults`. Anything that cannot be honoured is named in the report rather than silently dropped. |
152
+ | `web_search` | Search across the enabled backends. Takes `query`, plus optional `backends`, `allBackends`, `exclude`, `compact` and `maxResults`. `backends` decides how many run: one id runs that backend alone, several run in parallel, and omitting it runs every enabled backend. Anything that cannot be honoured is named in the report rather than silently dropped. |
153
153
  | `read_thread` | Read one discussion, with the pictures a post carries returned as MCP image content (bounded by count, per-file size and a per-call budget, with every link listed): `source: "reddit"` for a post with its comment tree (`sort`, `limit`, `depth` caps), or `source: "x"` for a post with its replies (needs the X backend in session mode). Comment text is untrusted user content. |
154
154
  | `xiaohongshu_note` | Read one note: text, author, engagement counts, tags, pictures as image
155
155
  content, and optionally its top-level comments (depth is one level, `commentLimit` 1–50). Needs the
@@ -173,7 +173,7 @@ The wire protocol is the [official TypeScript SDK](https://ts.sdk.modelcontextpr
173
173
  the config. Retries stay on the same provider and mode.
174
174
  - **Failures are visible.** Partial failures return the sources that worked and name the ones that did
175
175
  not; total failures say the search failed. Failed calls are never cached.
176
- - **Per-call strategy, saved config untouched.** `mode`, `backends` and `compact` apply to that one
176
+ - **Per-call strategy, saved config untouched.** `backends`, `exclude` and `compact` apply to that one
177
177
  call, so a narrow lookup and a broad sweep can coexist without editing the file.
178
178
  - **Reddit is anonymous by default.** No account needed; the adapter uses the same anonymous token the
179
179
  Android client obtains, because Reddit's public REST search answers 403 to anonymous callers.
@@ -1,7 +1,5 @@
1
1
  {
2
2
  "search": {
3
- "mode": "parallel",
4
- "singleBackend": "keenable",
5
3
  "maxResults": 8,
6
4
  "concurrency": 4,
7
5
  "overallTimeoutMs": 30000,
package/dist/tools.js CHANGED
@@ -23,16 +23,14 @@ export function createTools(config, identity, engine, readers = { reddit: fetchR
23
23
  };
24
24
  const searchTool = {
25
25
  name: 'web_search',
26
- description: 'Search the web through the configured backends and return citeable sources. The strategy is explicit: pick parallel or single mode, choose which enabled backends to use, and how much of each source to return. Failures are named instead of being hidden behind an empty result, and the response reports every request that failed. Nothing falls back to another backend, mode or credential.',
26
+ description: 'Search the web through the enabled backends and return citeable sources. The backends array is the whole strategy: one id runs that backend alone, several ids run in parallel, allBackends with exclude is the same choice written as a set, and leaving it out runs every enabled backend. Failures are named instead of being hidden behind an empty result, and the response reports every request that failed. Nothing falls back to another backend, access mode or credential.',
27
27
  inputSchema: {
28
28
  type: 'object',
29
29
  properties: {
30
30
  query: { type: 'string', description: 'Search query.' },
31
- mode: { type: 'string', enum: ['single', 'parallel'], description: 'Strategy for this call. Omit to use the configured mode.' },
32
- backends: { type: 'array', items: { type: 'string' }, description: 'Enabled backend ids to use, for example ["exa","reddit"].' },
33
- allBackends: { type: 'boolean', description: 'Use every enabled backend before exclusions.' },
34
- exclude: { type: 'array', items: { type: 'string' }, description: 'Backends to leave out of this call.' },
35
- backend: { type: 'string', description: 'Single backend id; ignored with a note when the effective mode is single.' },
31
+ backends: { type: 'array', items: { type: 'string' }, description: 'Enabled backend ids to run: one id runs only that backend, several run in parallel. Omit to run every enabled backend.' },
32
+ allBackends: { type: 'boolean', description: 'Run every enabled backend before exclusions.' },
33
+ exclude: { type: 'array', items: { type: 'string' }, description: 'Backends to leave out of this call, applied to allBackends or to the backends list.' },
36
34
  compact: { type: 'boolean', description: 'Return only URL, title and date per source, dropping snippets.' },
37
35
  maxResults: { type: 'integer', minimum: 1, maximum: 50, description: 'Upper bound on returned sources.' },
38
36
  },
@@ -45,11 +43,9 @@ export function createTools(config, identity, engine, readers = { reddit: fetchR
45
43
  if (!query)
46
44
  throw new Error('web_search needs a non-empty query.');
47
45
  const overrides = {
48
- ...(typeof args.mode === 'string' ? { mode: args.mode } : {}),
49
46
  ...(args.allBackends === true ? { backends: 'all' } : {}),
50
47
  ...(strings(args.backends) ? { backends: strings(args.backends) } : {}),
51
48
  ...(strings(args.exclude) ? { exclude: strings(args.exclude) } : {}),
52
- ...(typeof args.backend === 'string' && args.backend !== '' ? { backend: args.backend } : {}),
53
49
  compact: bool(args.compact) ?? config.compactByDefault,
54
50
  ...(int(args.maxResults) !== undefined ? { maxResults: int(args.maxResults) } : {}),
55
51
  };
package/dist/ui/page.html CHANGED
@@ -150,8 +150,7 @@ const I18N = {
150
150
  saved: '已保存并热重载', savedNoChange: '没有需要保存的更改', reloaded: '已从磁盘重新加载',
151
151
  loadError: '磁盘上的配置无法解析,页面暂时显示默认值;保存后即覆盖。',
152
152
  sessionExpired: '会话已过期,请用 --print-url 重新打开链接。',
153
- strategy: '检索策略', mode: '模式', parallel: '并行(全部启用后端)', single: '单后端',
154
- singleBackend: '单后端选择', singleBackendHint: 'single 模式下唯一使用的后端',
153
+ strategy: '检索策略', mode: '模式',
155
154
  maxResults: '结果上限', concurrency: '并发', overallTimeout: '总超时 (ms)', backendTimeout: '超时 (ms)',
156
155
  query: '查询默认值', language: '语言', region: '地区', recency: '时效', dedup: '去重', fusion: '融合',
157
156
  safeSearch: '安全搜索', includeDomains: '包含域名', excludeDomains: '排除域名',
@@ -189,8 +188,7 @@ const I18N = {
189
188
  saved: 'Saved and hot-reloaded', savedNoChange: 'Nothing to save', reloaded: 'Reloaded from disk',
190
189
  loadError: 'The file on disk does not parse, so defaults are shown; saving replaces it.',
191
190
  sessionExpired: 'Session expired. Open the link from --print-url again.',
192
- strategy: 'Strategy', mode: 'Mode', parallel: 'Parallel (every enabled backend)', single: 'Single backend',
193
- singleBackend: 'Single backend', singleBackendHint: 'The only backend used in single mode',
191
+ strategy: 'Strategy', mode: 'Mode',
194
192
  maxResults: 'Max results', concurrency: 'Concurrency', overallTimeout: 'Overall timeout (ms)', backendTimeout: 'Timeout (ms)',
195
193
  query: 'Query defaults', language: 'Language', region: 'Region', recency: 'Recency', dedup: 'Dedup', fusion: 'Fusion',
196
194
  safeSearch: 'Safe search', includeDomains: 'Include domains', excludeDomains: 'Exclude domains',
@@ -348,8 +346,6 @@ function onModeChange(backendPath, mode) {
348
346
  function overview() {
349
347
  const strategy = h('div', { class: 'panel pad' },
350
348
  h('div', { class: 'grid' },
351
- field({ path: 'mode', type: 'select', label: t('mode'), options: [['parallel', t('parallel')], ['single', t('single')]] }),
352
- field({ path: 'singleBackend', type: 'select', label: t('singleBackend'), hint: t('singleBackendHint'), options: state.snap.catalog.map(item => [item.id, item.title]) }),
353
349
  field({ path: 'maxResults', type: 'number', label: t('maxResults'), min: 1, max: 50 }),
354
350
  field({ path: 'concurrency', type: 'number', label: t('concurrency'), min: 1, max: 20 }),
355
351
  field({ path: 'overallTimeoutMs', type: 'number', label: t('overallTimeout'), min: 1000, max: 180000, step: 1000 }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nite07/websearch-mcp",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "MCP server for multi-backend web search plus Reddit and X thread reading, built on @nite07/search-core.",
5
5
  "license": "MIT",
6
6
  "author": "nite07",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@modelcontextprotocol/server": "^2.4.0",
46
- "@nite07/search-core": "0.1.8"
46
+ "@nite07/search-core": "0.2.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/node": "^22.10.2",