About duckdata
duckdata is a local bridge to HasData’s hosted DuckDuckGo MCP server, for clients that need structured search results. It forwards a read-only search tool and keeps ads separate from ranked organic results.
Key features
- 01Fetch ranked DuckDuckGo results
- 02Separate ads from organic results
- 03Filter by region, language, and device
- 04Set SafeSearch and paginate results
Use cases
- 01Retrieve search results for an Agent
- 02Continue a search using a page token
MCP support
It exposes the upstream DuckDuckGo search tool to MCP clients and forwards calls to the hosted HasData MCP server, returning results unchanged.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
1Saved tool list · updated 2d ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| q | string | No | Specify the search term for which you want to scrape the SERP. Required unless `nextPageToken` is provided (which carries the query of the page it continues). |
| cc | enum | No | The two-letter country code for the country to search from. Combined with `setLang` to form the DuckDuckGo region. Ignored if `kl` is set.ar | au | at | be | br | ca | cl | dk | fi | fr | de | hk | in | id | it | jp | kr | my | mx | nl | nz | no | cn | pl | pt | ph | ru | sa | za | es | se | ch | tw | tr | gb | us |
| kl | enum | No | DuckDuckGo region code in `<country>-<language>` form (e.g. `us-en`, `de-de`). Sets country and interface language at once; takes precedence over `cc`/`setLang`. Use `wt-wt` for no region.ar-es | au-en | at-de | be-nl | be-fr | br-pt | ca-en | ca-fr | cl-es | dk-da | fi-fi | fr-fr | de-de | hk-tzh | in-en | id-en | it-it | jp-jp | kr-kr | my-en | mx-es | nl-nl | nz-en | no-no | cn-zh | pl-pl | ph-en | ru-ru | za-en | es-es | se-sv | ch-de | tw-tzh | tr-tr | uk-en | us-en | wt-wt |
| setLang | enum | No | The preferred result/interface language code — usually two letters (e.g. `en`, `de`), with script-tag variants for some languages (e.g. `zh-hans`, `zh-hant`). Combined with `cc` to form the DuckDuckGo region. Ignored if `kl` is set.ar | ca | zh-hans | zh-hant | hr | cs | da | nl | en | et | fi | fr | de | he | hu | it | ja | ko | lv | lt | nb | pl | pt | ro | ru | sk | sl | es | sv | th | tr | uk | vi |
| deviceType | enum | No | Specify the device type for the search.desktop | mobile | tablet |
| safeSearch | enum | No | Adult Content Filtering option.off | moderate | strict |
| nextPageToken | string | No | Opaque token returned in each response as `nextPageToken`. Pass it back (in place of `q`) to fetch the next page of results. It carries a pre-signed page URL bound to the original request's session, so it must be used as-is and cannot be constructed manually. Absent when there are no further pages. |
Details
From the project READMEduckdata
duckdata is a small local bridge to the hosted HasData DuckDuckGo MCP server, which returns DuckDuckGo search results as JSON. Ask for a query and it comes back as ranked organic results — title, URL, snippet, displayed URL, position, date, sitelinks and video metadata — with the ads kept in their own separate array, plus the Search Assist AI answer when the upstream supplies one.
The bridge holds no results of its own. It serves the upstream server's tool list locally, exactly as captured from the live endpoint, and forwards each tool call upstream, returning the result untouched. The captured surface is a single read-only search fetch. There is no write, messaging, or payment tool in it.
Tools
hasdata_duckduckgo_serp_getSearchResults— fetch a DuckDuckGo SERP. The captured schema carries norequiredarray:qis the search term (required unlessnextPageTokenis provided, which carries the query it continues). Target a region withkl(a<country>-<language>code such asus-enorde-de, across 37 regions), or combineccwithsetLanginstead —kltakes precedence. Filter adult content withsafeSearch(off,moderate, orstrict), pick a form factor withdeviceType(desktop,mobile, ortablet), and page with the opaquenextPageTokenreturned by the previous response.
Configuration
HASDATA_DUCKDUCKGO_MCP_URL(optional) — override the upstream endpoint. Defaults tohttps://mcp.hasdata.com/mcp?apis=duckduckgo. (The override hook is this rebuild's own labelled reconstruction.)HASDATA_API_KEY(optional) — when set, every upstream request carries anx-api-key: <key>header, for the caller's own HasData API key. When it is not set, no key header is sent. (The header name and the env name are pinned by the original's registry record; forwarding the key from this env var is a labelled reconstruction — the original surface was captured keyless.)
Forwarding mechanics
On the first tool call the client opens a streamable
HTTP session with the upstream: a JSON-RPC
initialize request (protocolVersion 2025-03-26,
clientInfo name duckdata), then a
notifications/initialized notification, then the
tools/call request carrying the caller's arguments
unchanged. When the upstream answers initialize
with an Mcp-Session-Id header, that value rides on
every later request of the session, which is reused
for the life of the process. Replies may arrive as
plain JSON or as server-sent events; both are read.
Successful upstream results pass through verbatim,
including any isError flag the upstream sets.
Failures — a JSON-RPC error, a non-2xx status, an
unreadable response, or a request that cannot be
completed — come back as an isError result whose
text starts with duckdata error: (this rendering
is this rebuild's own labelled reconstruction).
CLI
The tool is also a subcommand taking one JSON argument string:
npx @reneturcios/duckdata hasdata_duckduckgo_serp_getSearchResults '{"q":"open source search","kl":"us-en","safeSearch":"moderate","deviceType":"desktop"}'
npx @reneturcios/duckdata --version
Exit codes: 0 on success, 1 on an isError
result, 2 on a usage error.
MCP server
npx -y @reneturcios/duckdata mcp
MCP client config:
{
"mcpServers": {
"duckdata": {
"command": "npx",
"args": ["-y", "@reneturcios/duckdata", "mcp"]
}
}
}
Docker
docker run -i ghcr.io/cloudcorprecords/duckdata
docker run --rm ghcr.io/cloudcorprecords/duckdata --version
The container's default command is mcp, so the first
form is a stdio MCP server; any other arguments reach
the CLI normally.
Development
npm install
npm run build
npm test
npm run dev
The test suite runs entirely against a stubbed JSON-RPC upstream — no live network calls.
License
MIT — see LICENSE.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.