duckduckgo-websearch 2.0.1 → 2.0.3

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
@@ -1,243 +1,233 @@
1
- # DuckDuckGo Search MCP Server (Node.js/TypeScript)
1
+ # DuckDuckGo Search MCP Server
2
2
 
3
- A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing. This is the Node.js/TypeScript version of the original Python implementation.
3
+ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server that provides web search and content fetching via DuckDuckGo. No API key required.
4
4
 
5
5
  ## Features
6
6
 
7
- - **Web Search**: Search DuckDuckGo with advanced rate limiting and result formatting
8
- - **Content Fetching**: Retrieve and parse webpage content with intelligent text extraction
9
- - **Rate Limiting**: Built-in protection against rate limits for both search and content fetching
10
- - **Error Handling**: Comprehensive error handling and logging
11
- - **LLM-Friendly Output**: Results formatted specifically for large language model consumption
12
- - **TypeScript**: Full TypeScript support with type definitions
13
- - **Global CLI**: Available as a global npm package
14
- - **Custom Headers**: Referer、Origin...etc
15
- - **Zero Click Results**: eg: search `ip`
7
+ - **Web Search** Multi-page results (supports 10 ~ 100+ results via automatic pagination)
8
+ - **Content Fetching** Fetch and parse any webpage to clean text
9
+ - **Bot Detection & Retry** Automatically retries up to 3 times on DDG bot challenges
10
+ - **Session Cookie Jar** Persists DDG session cookies in-memory across requests
11
+ - **Advanced Query Syntax** Full support for DDG/Google-style operators (`site:`, `OR`, `intitle:`, etc.)
12
+ - **Zero-Click Results** Instant answer cards (e.g. search `ip`, `weather`)
13
+ - **Zero Dependencies at Runtime** Only `cheerio` + `@modelcontextprotocol/sdk`
14
+ - **Node.js & Bun** — Works with both runtimes (Node ≥ 18)
15
+
16
+ ---
16
17
 
17
18
  ## Installation
18
19
 
19
- ### Global Installation (Recommended)
20
+ ### As MCP Server (global CLI)
20
21
 
21
22
  ```bash
22
- # Install globally via npm
23
23
  npm install -g duckduckgo-websearch
24
-
25
- # Or using pnpm
26
- pnpm add -g duckduckgo-websearch
27
-
28
- # Or using yarn
29
- yarn global add duckduckgo-websearch
24
+ # or
25
+ npx duckduckgo-websearch
30
26
  ```
31
27
 
32
- After global installation, you can use the following commands:
33
- - `npx duckduckgo-websearch`
34
- - `npx ddg-websearch`
35
- - `duckduckgo-websearch`
36
- - `ddg-websearch` (short alias)
37
-
38
- ### Local Installation
28
+ ### As npm Library
39
29
 
40
30
  ```bash
41
- # Clone and install locally
42
- git clone https://github.com/HeiSir2014/duckduckgo-mcp-server
43
- cd duckduckgo-mcp-server
44
- npm install
45
- npm run build
31
+ npm install duckduckgo-websearch
46
32
  ```
47
33
 
48
- ## Usage
49
-
50
- ### Global Usage
34
+ ---
51
35
 
52
- After global installation, you can run the server directly:
36
+ ## MCP Server Usage
53
37
 
54
- ```bash
55
- # Start the server
56
- npx duckduckgo-websearch
38
+ ### Claude Desktop
57
39
 
58
- # Or using the short alias
59
- npx ddg-websearch
40
+ Edit your Claude Desktop config:
60
41
 
61
- # or
62
- duckduckgo-websearch
42
+ - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
43
+ - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
63
44
 
64
- # Or using the short alias
65
- ddg-websearch
66
- ```
67
-
68
- ### Running with Claude Desktop
69
-
70
- 1. Download [Claude Desktop](https://claude.ai/download)
71
- 2. Create or edit your Claude Desktop configuration:
72
- - On macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
73
- - On Windows: `%APPDATA%\Claude\claude_desktop_config.json`
74
-
75
- #### For Global Installation:
76
45
  ```json
77
46
  {
78
47
  "mcpServers": {
79
48
  "ddg-search": {
80
- "command": "npx duckduckgo-websearch"
49
+ "command": "npx",
50
+ "args": ["duckduckgo-websearch"]
81
51
  }
82
52
  }
83
53
  }
84
54
  ```
85
55
 
86
- #### For Local Installation:
56
+ Or with a local build:
57
+
87
58
  ```json
88
59
  {
89
60
  "mcpServers": {
90
61
  "ddg-search": {
91
62
  "command": "node",
92
- "args": ["path/to/duckduckgo-mcp-server/build/index.js"]
63
+ "args": ["/path/to/duckduckgo-mcp-server/build/index.js"]
93
64
  }
94
65
  }
95
66
  }
96
67
  ```
97
68
 
98
- 3. Restart Claude Desktop
69
+ ### Other MCP Clients
99
70
 
100
- ### Development
71
+ Any MCP-compatible client (Cursor, Cline, Continue, etc.) can connect via stdio transport using the same command above.
101
72
 
102
- For local development:
73
+ ---
103
74
 
104
- ```bash
105
- # Install dependencies
106
- npm install
75
+ ## MCP Tools
107
76
 
108
- # Build the project
109
- npm run build
77
+ ### `search`
110
78
 
111
- # Run in development mode
112
- npm run dev
79
+ Search DuckDuckGo and return paginated results.
113
80
 
114
- # Start the built server
115
- npm start
81
+ | Parameter | Type | Default | Description |
82
+ |-----------|------|---------|-------------|
83
+ | `query` | `string` | required | Search query. Supports advanced syntax (see below) |
84
+ | `max_results` | `integer` | `25` | Number of results to return. Triggers automatic pagination when > 10 |
116
85
 
117
- # Run tests
118
- npm test
119
- ```
86
+ **Advanced Query Syntax** (DDG supports Google-style operators):
120
87
 
121
- ## Available Tools
88
+ | Syntax | Example | Effect |
89
+ |--------|---------|--------|
90
+ | `site:domain` | `site:github.com python` | Restrict to a domain |
91
+ | `site:a.com OR site:b.com` | `site:docs.python.org OR site:stackoverflow.com` | Multiple domains |
92
+ | `"exact phrase"` | `"model context protocol"` | Exact match |
93
+ | `-word` | `python -snake` | Exclude keyword |
94
+ | `intitle:word` | `intitle:tutorial python` | Match in page title |
95
+ | `filetype:ext` | `filetype:pdf machine learning` | Filter by file type |
96
+ | `OR` / `AND` | `python OR javascript async` | Boolean operators |
122
97
 
123
- ### 1. Search Tool
98
+ **Response format:**
124
99
 
125
- ```typescript
126
- async function search(query: string, max_results?: number): Promise<string>
127
100
  ```
101
+ Found 25 search results:
128
102
 
129
- Performs a web search on DuckDuckGo and returns formatted results.
103
+ 1. Page Title
104
+ URL: https://example.com/page
105
+ Summary: Brief description of the page content...
130
106
 
131
- **Parameters:**
132
- - `query`: Search query string
133
- - `max_results`: Maximum number of results to return (default: 10)
107
+ 2. ...
108
+ ```
134
109
 
135
- **Returns:**
136
- Formatted string containing search results with titles, URLs, and snippets.
110
+ ---
137
111
 
138
- ### 2. Content Fetching Tool
112
+ ### `fetch_content`
139
113
 
140
- ```typescript
141
- async function fetch_content(url: string, max_length?: number): Promise<string>
142
- ```
114
+ Fetch and parse a webpage to clean, LLM-readable text.
143
115
 
144
- Fetches and parses content from a webpage.
116
+ | Parameter | Type | Default | Description |
117
+ |-----------|------|---------|-------------|
118
+ | `url` | `string` | required | Webpage URL to fetch |
119
+ | `max_content_length` | `integer` | `8000` | Maximum characters to return |
145
120
 
146
- **Parameters:**
147
- - `url`: The webpage URL to fetch content from
148
- - `max_length`: Maximum content length to return (default: 8000)
121
+ ---
149
122
 
150
- **Returns:**
151
- Cleaned and formatted text content from the webpage.
123
+ ## Library Usage (Node.js / Bun)
152
124
 
153
- ## Features in Detail
125
+ ```typescript
126
+ import { WebSearch, WebFetcher } from 'duckduckgo-websearch';
154
127
 
155
- ### Rate Limiting
128
+ // Search
129
+ const searcher = new WebSearch();
156
130
 
157
- - Search: Limited to 30 requests per minute
158
- - Content Fetching: Limited to 20 requests per minute
159
- - Automatic queue management and wait times
131
+ // Basic search — returns up to 10 results (1 page)
132
+ const results = await searcher.search('claude anthropic');
160
133
 
161
- ### Result Processing
134
+ // Request more results — auto-paginates across multiple DDG pages
135
+ const results = await searcher.search('python tutorial', { maxResults: 50 });
162
136
 
163
- - Removes ads and irrelevant content
164
- - Cleans up DuckDuckGo redirect URLs
165
- - Formats results for optimal LLM consumption
166
- - Truncates long content appropriately
137
+ // Advanced query syntax works natively in the query string
138
+ const results = await searcher.search('site:github.com mcp server typescript');
139
+ const results = await searcher.search('site:docs.python.org OR site:realpython.com async await');
167
140
 
168
- ### Error Handling
141
+ // Format for LLM consumption
142
+ console.log(searcher.formatResultsForLLM(results));
169
143
 
170
- - Comprehensive error catching and reporting
171
- - Graceful degradation on rate limits or timeouts
144
+ // Fetch webpage content
145
+ const fetcher = new WebFetcher();
146
+ const content = await fetcher.fetchAndParse('https://example.com', 8000);
147
+ ```
172
148
 
173
- ## Technical Details
149
+ ### SearchResult type
174
150
 
175
- ### Dependencies
151
+ ```typescript
152
+ interface SearchResult {
153
+ title: string;
154
+ link: string;
155
+ snippet: string;
156
+ position: number;
157
+ }
158
+ ```
176
159
 
177
- - `@modelcontextprotocol/sdk`: MCP SDK for Node.js
178
- - `cheerio`: Server-side jQuery implementation for HTML parsing
179
- - Node.js 内置 `fetch` API:用于 HTTP 请求(无需额外依赖)
160
+ ### Error handling
180
161
 
181
- ### Architecture
162
+ ```typescript
163
+ import { WebSearch, SearchError } from 'duckduckgo-websearch';
164
+
165
+ try {
166
+ const results = await searcher.search('query');
167
+ } catch (err) {
168
+ if (err instanceof SearchError) {
169
+ console.error(err.code); // 'BOT_DETECTED' | 'HTTP_ERROR' | 'TIMEOUT' | 'UNKNOWN'
170
+ console.error(err.message);
171
+ }
172
+ }
173
+ ```
182
174
 
183
- The server is built using the MCP SDK and consists of several key components:
175
+ `SearchError` codes:
184
176
 
185
- - **DuckDuckGoSearcher**: Handles search requests with rate limiting
186
- - **WebContentFetcher**: Fetches and parses webpage content
187
- - **RateLimiter**: Manages request rate limiting
188
- - **Main Server**: Integrates everything and handles MCP protocol
177
+ | Code | Meaning |
178
+ |------|---------|
179
+ | `BOT_DETECTED` | DDG bot challenge triggered after 3 retry attempts |
180
+ | `HTTP_ERROR` | Non-2xx HTTP response |
181
+ | `TIMEOUT` | Request timed out (30s limit) |
182
+ | `UNKNOWN` | Unexpected failure |
189
183
 
190
- ## Publishing (For Maintainers)
184
+ ---
191
185
 
192
- ### Version Management
186
+ ## Development
193
187
 
194
188
  ```bash
195
- # Update version
196
- npm run version:patch # 0.1.1 -> 0.1.2
197
- npm run version:minor # 0.1.1 -> 0.2.0
198
- npm run version:major # 0.1.1 -> 1.0.0
199
- ```
189
+ git clone https://github.com/HeiSir2014/duckduckgo-mcp-server
190
+ cd duckduckgo-mcp-server
200
191
 
201
- ### Publishing to npm
192
+ npm install
193
+ npm run build # compile TypeScript → build/
202
194
 
203
- ```bash
204
- # Check publish readiness
205
- npm run publish:check
195
+ # Run example test (Bun)
196
+ bun example/test.ts
206
197
 
207
- # Publish (after version update)
208
- npm publish
198
+ # Run with Node
199
+ node -e "require('./build/index.js')"
209
200
  ```
210
201
 
211
- ### Pre-publish Checklist
202
+ ---
212
203
 
213
- - [ ] All tests pass (`npm test`)
214
- - [ ] Build succeeds (`npm run build`)
215
- - [ ] Version updated (`npm version [patch|minor|major]`)
216
- - [ ] README updated
217
- - [ ] CHANGELOG updated
204
+ ## Architecture
218
205
 
219
- ## Contributing
206
+ ```
207
+ src/
208
+ ├── index.ts # MCP server entry, tool definitions
209
+ ├── duckduckgoSearcher.ts # Search logic: fetch, bot detection, retry, pagination
210
+ ├── cookieJar.ts # In-memory cookie jar for DDG session persistence
211
+ ├── webContentFetcher.ts # Webpage fetch + text extraction
212
+ ├── rateLimiter.ts # Token-bucket rate limiter
213
+ └── types.ts # Shared types (SearchResult, SearchOptions, SearchError)
214
+ ```
220
215
 
221
- Issues and pull requests are welcome! Some areas for potential improvement:
216
+ **Pagination mechanism** DDG HTML endpoint returns 10 results per page with a `vqd` session token embedded in the "Next" form. When `maxResults > 10`, the searcher chains page requests using `vqd` and the form parameters (`s`, `dc`) extracted from each page's nav-link.
222
217
 
223
- - Additional search parameters (region, language, etc.)
224
- - Enhanced content parsing options
225
- - Caching layer for frequently accessed content
226
- - Additional rate limiting strategies
227
- - Better error recovery mechanisms
218
+ **Bot detection** On each page fetch the searcher checks for missing result containers (`.serp__results`) and known challenge keywords. On detection it awaits the report ping (`/t/sl_h`) which warms the session, then retries. After 3 failures it throws `SearchError('BOT_DETECTED')`.
228
219
 
229
- ## License
220
+ ---
230
221
 
231
- This project is licensed under the MIT License.
222
+ ## Rate Limits
232
223
 
233
- ## Comparison with Python Version
224
+ | Operation | Limit |
225
+ |-----------|-------|
226
+ | Search | 30 requests / minute |
227
+ | Content Fetch | 20 requests / minute |
234
228
 
235
- This Node.js/TypeScript version provides the same functionality as the original Python version with the following benefits:
229
+ ---
236
230
 
237
- - **Type Safety**: Full TypeScript support with compile-time type checking
238
- - **Performance**: Generally faster startup and execution times
239
- - **Ecosystem**: Access to the extensive npm ecosystem
240
- - **Compatibility**: Better integration with Node.js-based toolchains
241
- - **Global CLI**: Easy global installation and usage
231
+ ## License
242
232
 
243
- The API and behavior are designed to be identical to the Python version, making it a drop-in replacement.
233
+ MIT
package/build/index.d.ts CHANGED
@@ -2,4 +2,5 @@
2
2
  import { DuckDuckGoSearcher } from './duckduckgoSearcher';
3
3
  import { WebContentFetcher } from './webContentFetcher';
4
4
  export { DuckDuckGoSearcher as WebSearch, WebContentFetcher as WebFetcher };
5
+ export { SearchError, SearchResult, SearchOptions } from './types';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AA4JxD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,iBAAiB,IAAI,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AA4JxD,OAAO,EAAE,kBAAkB,IAAI,SAAS,EAAE,iBAAiB,IAAI,UAAU,EAAE,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
package/build/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.WebFetcher = exports.WebSearch = void 0;
4
+ exports.SearchError = exports.WebFetcher = exports.WebSearch = void 0;
5
5
  const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
6
6
  const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
7
7
  const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
@@ -137,4 +137,6 @@ if (require.main === module) {
137
137
  process.exit(1);
138
138
  });
139
139
  }
140
+ var types_1 = require("./types");
141
+ Object.defineProperty(exports, "SearchError", { enumerable: true, get: function () { return types_1.SearchError; } });
140
142
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAEA,wEAAmE;AACnE,wEAAiF;AACjF,iEAI4C;AAC5C,6DAA0D;AA6J3B,0FA7JtB,uCAAkB,OA6Ja;AA5JxC,2DAAwD;AA4JO,2FA5JtD,qCAAiB,OA4J+C;AAxJzE,SAAS,GAAG,CAAC,OAAe;IAC1B,4EAA4E;AAC9E,CAAC;AAGD,MAAM,mBAAmB;IAKvB;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,iBAAM,CACtB;YACE,IAAI,EAAE,sBAAsB;YAC5B,OAAO,EAAE,OAAO;SACjB,EACD;YACE,YAAY,EAAE;gBACZ,KAAK,EAAE,EAAE;aACV;SACF,CACF,CAAC;QAEF,IAAI,CAAC,QAAQ,GAAG,IAAI,uCAAkB,EAAE,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,qCAAiB,EAAE,CAAC;QAEvC,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAC3B,CAAC;IAEO,iBAAiB;QACvB,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,iCAAsB,EAAE,KAAK,IAAI,EAAE;YAC/D,OAAO;gBACL,KAAK,EAAE;oBACL;wBACE,IAAI,E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O,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,GAAG;QACP,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;QAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;CACF;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,mBAAmB,EAAE,CAAC;IACzC,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC;AAGD,iCAAmE;AAA1D,oGAAA,WAAW,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "duckduckgo-websearch",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "MCP Server for searching via DuckDuckGo (Node.js version)",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",