mcp-duckduckgo 1.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 ADDED
@@ -0,0 +1,43 @@
1
+ # @cooperiano/duckduckgo-mcp
2
+
3
+ Free web search MCP server using DuckDuckGo.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @cooperiano/duckduckgo-mcp
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ### As MCP Server
14
+
15
+ Add to your Claude Code configuration:
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "duckduckgo-mcp": {
21
+ "command": "npx",
22
+ "args": ["-y", "@cooperiano/duckduckgo-mcp"]
23
+ }
24
+ }
25
+ }
26
+ ```
27
+
28
+ ### MCP Tools
29
+
30
+ - `search_web` - Search the web using DuckDuckGo
31
+ - `query` (required): Search query
32
+ - `limit` (optional): Maximum number of results (default: 10)
33
+
34
+ ## Examples
35
+
36
+ ```bash
37
+ # In Claude Code
38
+ > Use search_web tool to search for "Go programming language"
39
+ ```
40
+
41
+ ## License
42
+
43
+ MIT
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+
7
+ const binaryPath = path.join(__dirname, 'duckduckgo-mcp');
8
+
9
+ // Check if binary exists
10
+ if (!fs.existsSync(binaryPath)) {
11
+ console.error('Binary not found. Please reinstall the package.');
12
+ process.exit(1);
13
+ }
14
+
15
+ // Run the binary
16
+ try {
17
+ execSync(binaryPath, { stdio: 'inherit' });
18
+ } catch (error) {
19
+ process.exit(error.status);
20
+ }
package/install.js ADDED
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const os = require('os');
7
+ const https = require('https');
8
+
9
+ const VERSION = '1.0.0';
10
+ const BASE_URL = `https://github.com/Cooperiano/duckduckgo-mcp/releases/download/v${VERSION}`;
11
+
12
+ function getPlatform() {
13
+ const platform = os.platform();
14
+ const arch = os.arch();
15
+
16
+ if (platform === 'linux' && arch === 'x64') return 'linux-amd64';
17
+ if (platform === 'linux' && arch === 'arm64') return 'linux-arm64';
18
+ if (platform === 'darwin' && arch === 'x64') return 'darwin-amd64';
19
+ if (platform === 'darwin' && arch === 'arm64') return 'darwin-arm64';
20
+ if (platform === 'win32' && arch === 'x64') return 'windows-amd64';
21
+
22
+ throw new Error(`Unsupported platform: ${platform}-${arch}`);
23
+ }
24
+
25
+ function downloadFile(url, dest) {
26
+ return new Promise((resolve, reject) => {
27
+ const file = fs.createWriteStream(dest);
28
+ https.get(url, (response) => {
29
+ if (response.statusCode === 302) {
30
+ // Follow redirect
31
+ https.get(response.headers.location, (redirectResponse) => {
32
+ redirectResponse.pipe(file);
33
+ file.on('finish', () => {
34
+ file.close();
35
+ resolve();
36
+ });
37
+ }).on('error', reject);
38
+ } else {
39
+ response.pipe(file);
40
+ file.on('finish', () => {
41
+ file.close();
42
+ resolve();
43
+ });
44
+ }
45
+ }).on('error', reject);
46
+ });
47
+ }
48
+
49
+ async function install() {
50
+ const platform = getPlatform();
51
+ const binaryName = `duckduckgo-mcp-${platform}`;
52
+ const url = `${BASE_URL}/${binaryName}`;
53
+ const destDir = path.join(__dirname, 'bin');
54
+ const destFile = path.join(destDir, 'duckduckgo-mcp');
55
+
56
+ console.log(`Downloading duckduckgo-mcp for ${platform}...`);
57
+
58
+ // Create bin directory
59
+ if (!fs.existsSync(destDir)) {
60
+ fs.mkdirSync(destDir, { recursive: true });
61
+ }
62
+
63
+ try {
64
+ await downloadFile(url, destFile);
65
+ fs.chmodSync(destFile, '755');
66
+ console.log('Installation complete!');
67
+ } catch (error) {
68
+ console.error('Installation failed:', error.message);
69
+ process.exit(1);
70
+ }
71
+ }
72
+
73
+ install();
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "mcp-duckduckgo",
3
+ "version": "1.0.0",
4
+ "description": "Free web search MCP server using DuckDuckGo",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "duckduckgo-mcp": "./bin/duckduckgo-mcp.js"
8
+ },
9
+ "scripts": {
10
+ "postinstall": "node install.js"
11
+ },
12
+ "keywords": [
13
+ "mcp",
14
+ "search",
15
+ "duckduckgo",
16
+ "web-search",
17
+ "claude"
18
+ ],
19
+ "author": "Cooperiano",
20
+ "license": "MIT",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/Cooperiano/duckduckgo-mcp.git"
24
+ },
25
+ "engines": {
26
+ "node": ">=14.0.0"
27
+ },
28
+ "files": [
29
+ "bin/",
30
+ "index.js",
31
+ "install.js",
32
+ "README.md"
33
+ ]
34
+ }