searchfetch 2.0.0 → 3.0.0
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 +13 -13
- package/index.js +895 -197
- package/package.json +5 -4
- package/templates/crates-package.json +37 -0
- package/templates/docs-page.json +31 -0
- package/templates/duckduckgo-search.json +67 -0
- package/templates/github-issue.json +69 -0
- package/templates/github-repo.json +36 -0
- package/templates/google-search.json +75 -0
- package/templates/npm-package.json +49 -0
- package/templates/pypi-package.json +43 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SearchFetch (MCP Server)
|
|
2
2
|
|
|
3
|
-
A maximum fault-tolerant, stealth-enabled Model Context Protocol (MCP) server for web searching and content fetching. Built specifically for AI Agents (Cursor, Claude
|
|
3
|
+
A maximum fault-tolerant, stealth-enabled Model Context Protocol (MCP) server for web searching and content fetching. Built specifically for AI Agents (Cursor, Claude Code, OpenCode), it completely bypasses bot detection (Cloudflare Turnstile, Datadome), dynamically handles SPAs/React, and converts bloat into token-optimized Markdown.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
* **Maximum Fault Tolerance:** Implements auto-healing browser sessions, grace-period timeouts for clunky SPAs, and network-level aborting of tracking scripts and media.
|
|
@@ -51,34 +51,34 @@ Add it via the **MCP panel** in Cursor settings:
|
|
|
51
51
|
## Available Tools
|
|
52
52
|
|
|
53
53
|
### 1. `websearch`
|
|
54
|
-
Searches the web
|
|
54
|
+
Searches the web through the v3 template pipeline. DuckDuckGo and Google are built-in templates, and custom search templates can be selected by name.
|
|
55
55
|
|
|
56
56
|
**Parameters:**
|
|
57
57
|
* **`query`** *(string, required)*: The search query string.
|
|
58
|
-
* **`engine`** *(string, optional)*: Search engine to use. Can be `"duckduckgo"
|
|
58
|
+
* **`engine`** *(string, optional)*: Search engine/template to use. Can be `"duckduckgo"`, `"google"`, or a custom search template name. Default is `"duckduckgo"`.
|
|
59
59
|
* **`max_results`** *(number, optional)*: Maximum number of results to return. Default is `10`.
|
|
60
|
-
* **`region`** *(string, optional)*: Region and language code to localize search results.
|
|
60
|
+
* **`region`** *(string/null, optional)*: Region and language code to localize search results.
|
|
61
61
|
* Examples: `"us-en"`, `"uk-en"`, `"de-de"`.
|
|
62
62
|
* For DuckDuckGo, it maps directly.
|
|
63
63
|
* For Google, it maps to the `gl` (country) and `hl` (language) query parameters automatically.
|
|
64
|
-
*
|
|
65
|
-
* **`safe_search`** *(
|
|
66
|
-
|
|
67
|
-
* `"1"` for Strict.
|
|
68
|
-
* `"-2"` for Off.
|
|
69
|
-
* Default is `"-1"`.
|
|
70
|
-
* *Note: Only applies to DuckDuckGo.*
|
|
64
|
+
* `null` uses the template default.
|
|
65
|
+
* **`safe_search`** *(boolean/null, optional)*: Enable safe search. Maps to DuckDuckGo/Google parameters automatically; `null` uses the template default.
|
|
66
|
+
* **`block_media`** *(boolean, optional)*: Block images, media, and fonts at the network layer. Default is `true`.
|
|
71
67
|
|
|
72
68
|
### 2. `webfetch`
|
|
73
|
-
|
|
69
|
+
Fetches a page with CloakBrowser and extracts structured Markdown using a named, inline, or auto-detected template. Built-ins include GitHub repositories/issues, npm, PyPI, crates.io, and ReadTheDocs-style docs pages. Unknown pages fall back to generic Markdown extraction.
|
|
74
70
|
|
|
75
71
|
**Parameters:**
|
|
76
72
|
* **`url`** *(string, required)*: The full URL of the webpage to fetch (must start with http/https).
|
|
77
|
-
* **`
|
|
73
|
+
* **`template`** *(string, optional)*: `"auto"`, a built-in template name, or inline JSON template. Default is `"auto"`.
|
|
78
74
|
* **`start_index`** *(number, optional)*: Character offset to start reading from for pagination. Use this if a document is too large to fit in the context window. Default is `0`.
|
|
79
75
|
* **`max_length`** *(number, optional)*: Maximum characters to return per request. Default is `10000`.
|
|
80
76
|
* **`block_media`** *(boolean, optional)*: Block images, videos, and fonts entirely at the network layer to drastically speed up page loads and dodge tracking pixels. Default is `true`.
|
|
81
77
|
|
|
78
|
+
Template extraction supports `text`, `markdown`, `attribute`, and `html` sections; nested children; repeated sections; URL decoding transforms; per-template cookies; and per-template resource blocking.
|
|
79
|
+
|
|
80
|
+
Built-in templates live in `templates/*.json` and are shared by the Node.js and Python implementations. Each JSON file defines exactly one template — no duplication between languages.
|
|
81
|
+
|
|
82
82
|
---
|
|
83
83
|
|
|
84
84
|
## Architecture & Contributions
|