Purpose: This repository contains the configuration and documentation for the HasData-hosted DuckDuckGo MCP server, with the goal of exposing DuckDuckGo search results as a tool to AI clients so models can obtain parseable structured data without touching HTML pages.
Main capabilities: Returns organic results with fields such as position, title, link, displayedLink, source, and snippet; ads are placed separately in the ads array; the searchAssist field carries DuckDuckGo's own AI answer; pagination is used for paging. Supports 37 region codes (kl parameter); cc and setLang can separate country and language. The service exposes 5 resources, each corresponding to a parameter with a fixed value; reading resources does not consume credits. The apis query parameter can limit the exposed tools, for example ?apis=duckduckgo shows only one tool, and it can also be combined with google_serp, bing_serp, etc.
Usage: The client must support streamable HTTP and carry custom request headers. The server URL is https://mcp.hasdata.com/mcp?apis=duckduckgo,凭证为 HasData API key (create one for free in the console). Clients that support OAuth can add this URL as a connector and log in; clients that only support stdio can use the @hasdata/duckduckgo-mcp (npm) or hasdata-duckduckgo-mcp (PyPI) launcher. Claude Desktop reads the key from an environment variable via the stdio launcher; Cursor, Windsurf, VS Code, Codex, Gemini, etc. configure the remote server according to their respective documentation formats, and Windsurf uses the serverUrl field. The tool name is hasdata_duckduckgo_serp_getSearchResults; when calling, send either q or nextPageToken; if both are sent, the cursor takes precedence and q is ignored. When paginating, position restarts from 1 on each page; absolute ranking requires accumulating the number of organic results collected so far.
Use cases: ranking data collection requiring batch, stable structured output; comparing the same query across regions; extracting paid ad slots separately; enabling agents to autonomously call search in clients such as Claude Code, Claude Desktop, Cursor, and Windsurf.
Limitations: Does not provide page scraping or content extraction, and does not support image, news vertical search, or autocomplete. Each call consumes 10 credits, and each page of pagination counts as one call. The free tier has 1,000 credits per month and concurrency of 5; paid plans have concurrency ranging from 5 to 500. Tool call errors are returned as text with isError: true rather than HTTP error codes; when the key is missing, the connection itself returns 401. Queries with no real matches still return one page of loosely related results and are not marked as no match. Data is scraped in real time, not cached. Only public data is accessed; compliance responsibility rests with the user.