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 +142 -152
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,243 +1,233 @@
|
|
|
1
|
-
# DuckDuckGo Search MCP Server
|
|
1
|
+
# DuckDuckGo Search MCP Server
|
|
2
2
|
|
|
3
|
-
A Model Context Protocol (MCP) server that provides web search
|
|
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
|
|
8
|
-
- **Content Fetching
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
|
|
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
|
-
###
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
### Global Usage
|
|
34
|
+
---
|
|
51
35
|
|
|
52
|
-
|
|
36
|
+
## MCP Server Usage
|
|
53
37
|
|
|
54
|
-
|
|
55
|
-
# Start the server
|
|
56
|
-
npx duckduckgo-websearch
|
|
38
|
+
### Claude Desktop
|
|
57
39
|
|
|
58
|
-
|
|
59
|
-
npx ddg-websearch
|
|
40
|
+
Edit your Claude Desktop config:
|
|
60
41
|
|
|
61
|
-
|
|
62
|
-
|
|
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
|
|
49
|
+
"command": "npx",
|
|
50
|
+
"args": ["duckduckgo-websearch"]
|
|
81
51
|
}
|
|
82
52
|
}
|
|
83
53
|
}
|
|
84
54
|
```
|
|
85
55
|
|
|
86
|
-
|
|
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
|
-
|
|
69
|
+
### Other MCP Clients
|
|
99
70
|
|
|
100
|
-
|
|
71
|
+
Any MCP-compatible client (Cursor, Cline, Continue, etc.) can connect via stdio transport using the same command above.
|
|
101
72
|
|
|
102
|
-
|
|
73
|
+
---
|
|
103
74
|
|
|
104
|
-
|
|
105
|
-
# Install dependencies
|
|
106
|
-
npm install
|
|
75
|
+
## MCP Tools
|
|
107
76
|
|
|
108
|
-
|
|
109
|
-
npm run build
|
|
77
|
+
### `search`
|
|
110
78
|
|
|
111
|
-
|
|
112
|
-
npm run dev
|
|
79
|
+
Search DuckDuckGo and return paginated results.
|
|
113
80
|
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
118
|
-
npm test
|
|
119
|
-
```
|
|
86
|
+
**Advanced Query Syntax** (DDG supports Google-style operators):
|
|
120
87
|
|
|
121
|
-
|
|
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
|
-
|
|
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
|
-
|
|
103
|
+
1. Page Title
|
|
104
|
+
URL: https://example.com/page
|
|
105
|
+
Summary: Brief description of the page content...
|
|
130
106
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
- `max_results`: Maximum number of results to return (default: 10)
|
|
107
|
+
2. ...
|
|
108
|
+
```
|
|
134
109
|
|
|
135
|
-
|
|
136
|
-
Formatted string containing search results with titles, URLs, and snippets.
|
|
110
|
+
---
|
|
137
111
|
|
|
138
|
-
###
|
|
112
|
+
### `fetch_content`
|
|
139
113
|
|
|
140
|
-
|
|
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
|
-
|
|
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
|
-
|
|
147
|
-
- `url`: The webpage URL to fetch content from
|
|
148
|
-
- `max_length`: Maximum content length to return (default: 8000)
|
|
121
|
+
---
|
|
149
122
|
|
|
150
|
-
|
|
151
|
-
Cleaned and formatted text content from the webpage.
|
|
123
|
+
## Library Usage (Node.js / Bun)
|
|
152
124
|
|
|
153
|
-
|
|
125
|
+
```typescript
|
|
126
|
+
import { WebSearch, WebFetcher } from 'duckduckgo-websearch';
|
|
154
127
|
|
|
155
|
-
|
|
128
|
+
// Search
|
|
129
|
+
const searcher = new WebSearch();
|
|
156
130
|
|
|
157
|
-
|
|
158
|
-
|
|
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
|
-
|
|
134
|
+
// Request more results — auto-paginates across multiple DDG pages
|
|
135
|
+
const results = await searcher.search('python tutorial', { maxResults: 50 });
|
|
162
136
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
141
|
+
// Format for LLM consumption
|
|
142
|
+
console.log(searcher.formatResultsForLLM(results));
|
|
169
143
|
|
|
170
|
-
|
|
171
|
-
|
|
144
|
+
// Fetch webpage content
|
|
145
|
+
const fetcher = new WebFetcher();
|
|
146
|
+
const content = await fetcher.fetchAndParse('https://example.com', 8000);
|
|
147
|
+
```
|
|
172
148
|
|
|
173
|
-
|
|
149
|
+
### SearchResult type
|
|
174
150
|
|
|
175
|
-
|
|
151
|
+
```typescript
|
|
152
|
+
interface SearchResult {
|
|
153
|
+
title: string;
|
|
154
|
+
link: string;
|
|
155
|
+
snippet: string;
|
|
156
|
+
position: number;
|
|
157
|
+
}
|
|
158
|
+
```
|
|
176
159
|
|
|
177
|
-
|
|
178
|
-
- `cheerio`: Server-side jQuery implementation for HTML parsing
|
|
179
|
-
- Node.js 内置 `fetch` API:用于 HTTP 请求(无需额外依赖)
|
|
160
|
+
### Error handling
|
|
180
161
|
|
|
181
|
-
|
|
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
|
-
|
|
175
|
+
`SearchError` codes:
|
|
184
176
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
184
|
+
---
|
|
191
185
|
|
|
192
|
-
|
|
186
|
+
## Development
|
|
193
187
|
|
|
194
188
|
```bash
|
|
195
|
-
|
|
196
|
-
|
|
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
|
-
|
|
192
|
+
npm install
|
|
193
|
+
npm run build # compile TypeScript → build/
|
|
202
194
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
npm run publish:check
|
|
195
|
+
# Run example test (Bun)
|
|
196
|
+
bun example/test.ts
|
|
206
197
|
|
|
207
|
-
#
|
|
208
|
-
|
|
198
|
+
# Run with Node
|
|
199
|
+
node -e "require('./build/index.js')"
|
|
209
200
|
```
|
|
210
201
|
|
|
211
|
-
|
|
202
|
+
---
|
|
212
203
|
|
|
213
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
220
|
+
---
|
|
230
221
|
|
|
231
|
-
|
|
222
|
+
## Rate Limits
|
|
232
223
|
|
|
233
|
-
|
|
224
|
+
| Operation | Limit |
|
|
225
|
+
|-----------|-------|
|
|
226
|
+
| Search | 30 requests / minute |
|
|
227
|
+
| Content Fetch | 20 requests / minute |
|
|
234
228
|
|
|
235
|
-
|
|
229
|
+
---
|
|
236
230
|
|
|
237
|
-
|
|
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
|
-
|
|
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
|
package/build/index.d.ts.map
CHANGED
|
@@ -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
|
package/build/index.js.map
CHANGED
|
@@ -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;Y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