-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
124ff86
commit 64f8e4d
Showing
5 changed files
with
88 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,37 @@ | ||
# DuckDuckGo MCP Server | ||
|
||
MCP server providing search functionality via DuckDuckGo's HTML interface. | ||
|
||
## Core Concepts | ||
## Components | ||
|
||
### Resources | ||
Single resource endpoint for search results: | ||
Single resource endpoint for search interface: | ||
```duckduckgo://search``` | ||
|
||
### Tools | ||
Search tool with configurable result count: | ||
```json | ||
- **duckduckgo_search** | ||
- Performs a search using DuckDuckGo and returns the top search results | ||
- Inputs: | ||
- `query` (string, required): The search query to look up | ||
- `numResults` (number, optional): Number of results to return (default: 10) | ||
- Returns titles, snippets, and URLs of the search results | ||
|
||
## Usage Example | ||
```javascript | ||
// Example tool call | ||
{ | ||
"name": "search", | ||
"name": "duckduckgo_search", | ||
"arguments": { | ||
"query": "your search query", | ||
"numResults": 5 // optional, defaults to 5 | ||
"numResults": 10 | ||
} | ||
} | ||
``` | ||
|
||
## Implementation Details | ||
- HTML scraping via JSDOM | ||
- Clean result formatting with titles, snippets, and URLs | ||
- Error handling for network/parsing issues | ||
- Request rate limiting built-in via DuckDuckGo's interface | ||
|
||
## Usage Example | ||
```typescript | ||
// Search tool response format | ||
// Example response format: | ||
{ | ||
content: [{ | ||
type: "text", | ||
text: "Title: Example Result\nSnippet: Result description...\nURL: https://..." | ||
"content": [{ | ||
"type": "text", | ||
"text": "Title: Result Title\nSnippet: Result description...\nURL: https://example.com\n\nTitle: Another Result\n..." | ||
}] | ||
} | ||
``` | ||
|
||
## Development | ||
Requires Node.js and npm. Uses ES modules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters