HasData DuckDuckGo

com.hasdata由 hasdata.com 发布官方发布者v1.0.7更新于 Oct 24, 2026

DuckDuckGo search as JSON. Ranked results, ads in their own array, 37 regions.

发布方自己的服务:HasData Airbnb

已验证Streamable HTTP可网页运行网页搜索与抓取数据与分析

概览

AI 生成的概览

托管的 DuckDuckGo 搜索 MCP 服务器,以结构化 JSON 返回排序后的自然结果、单独的广告数组和 DuckDuckGo 的 AI 回答,支持 37 个地区。

可以做什么
  • 执行 DuckDuckGo 搜索,返回解析后的自然结果,含位置、标题、链接、显示链接、来源、摘要、日期和站内链接
  • 从独立的广告数组读取付费位置,并读取 DuckDuckGo 自带的 Search Assist AI 回答
  • 按 kl 地区代码定位,或用 cc 与 setLang 分别指定国家和语言,并可逐次设置 safeSearch 与 deviceType
  • 使用每次响应返回的游标翻页
  • 以资源形式读取地区、语言、safeSearch 和 deviceType 的固定取值列表,不消耗额度
适用场景
适合需要实时网页搜索结果且要求稳定可解析结构的场景,例如排名追踪、同一查询跨多个地区对比,或把广告与自然结果分开。若每天只在单个助手里做少量搜索,自托管的免费服务器也是合理选择。
运行要求
需要 HasData API 密钥:远程端点通过 x-api-key 请求头传递,npm 或 PyPI 的 stdio 启动器通过 HASDATA_API_KEY 环境变量读取。需要支持带自定义请求头的 streamable HTTP 客户端,或 Node.js、uv 运行启动器,并能访问托管端点。
安装前请注意
每次成功调用消耗 10 个额度,即使没有找到结果也计费,翻页每页一次调用;免费额度为每月 1,000 个。密钥错误不会在连接时暴露,而是在首次工具调用中报错。查询会发送到 HasData 的服务器并由其抓取页面;自动化访问可能受平台条款限制,采集的数据可能包含个人信息。

安装

在 SourceWeft 中

  1. 打开 控制台中的 HasData DuckDuckGo,将其添加到工作区。
  2. 连接 x-api-key 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/com.hasdata%2Fduckduckgo/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "hasdata-duckduckgo": {
      "type": "http",
      "url": "https://mcp.hasdata.com/mcp?apis=duckduckgo",
      "headers": {
        "x-api-key": "<YOUR_API_KEY>"
      }
    }
  }
}

README

DuckDuckGo MCP Server

A hosted DuckDuckGo MCP server that gives Claude, Cursor, Windsurf and any other MCP client DuckDuckGo search results as structured JSON. Ranked organic results with positions, ads in their own array, DuckDuckGo's own AI answer, and 37 regions to target. Built for volume and for parsing, with no local browser and no fallback chain to configure.

1,000 free credits every month, no card required, which is 100 searches.

https://mcp.hasdata.com/mcp?apis=duckduckgo

[Glama score] [tool contract] [MCP] [Regions]

Contents

What you need

An MCP client that speaks streamable HTTP with custom headers. A HasData API key from the dashboard, free to create. Nothing else. This is a remote server, so the simplest path is a URL and a header, with no browser package to add and no local process to keep up. A stdio-only client can use the @hasdata/duckduckgo-mcp (npm) or hasdata-duckduckgo-mcp (PyPI) launcher instead.

Quick start

The server URL is the same for every client. We run it hands-on in Claude Code and Claude Desktop. The other blocks follow each client's own documented format for a remote server.

FieldValue
URLhttps://mcp.hasdata.com/mcp?apis=duckduckgo
TransportHTTP, streamable
Auth headerx-api-key: HASDATA_API_KEY

Clients with OAuth support can add the same URL as a connector and sign in without putting a key in a config file.

Claude Code
bash
claude mcp add --transport http duckduckgo "https://mcp.hasdata.com/mcp?apis=duckduckgo" \  --header "x-api-key: HASDATA_API_KEY"
Claude Desktop

Settings, then Connectors, then Add custom connector, then paste https://mcp.hasdata.com/mcp?apis=duckduckgo and sign in.

For the config-file route, Claude Desktop loads only local (stdio) servers, so it reaches a remote server through a stdio launcher. The @hasdata/duckduckgo-mcp package is that launcher, and it reads the key from the environment. Add this to claude_desktop_config.json:

json
{  "mcpServers": {    "duckduckgo": {      "command": "npx",      "args": ["-y", "@hasdata/duckduckgo-mcp"],      "env": { "HASDATA_API_KEY": "YOUR_KEY" }    }  }}

Python instead of Node? Swap the launcher for the PyPI package, which uvx runs without a manual install:

json
{  "mcpServers": {    "duckduckgo": {      "command": "uvx",      "args": ["hasdata-duckduckgo-mcp"],      "env": { "HASDATA_API_KEY": "YOUR_KEY" }    }  }}
Cursor

~/.cursor/mcp.json for every project, or .cursor/mcp.json for one:

json
{  "mcpServers": {    "duckduckgo": {      "url": "https://mcp.hasdata.com/mcp?apis=duckduckgo",      "headers": { "x-api-key": "HASDATA_API_KEY" }    }  }}
Windsurf

~/.codeium/windsurf/mcp_config.json. Windsurf calls the field serverUrl, not url:

json
{  "mcpServers": {    "duckduckgo": {      "serverUrl": "https://mcp.hasdata.com/mcp?apis=duckduckgo",      "headers": { "x-api-key": "HASDATA_API_KEY" }    }  }}
Cline
json
{  "mcpServers": {    "duckduckgo": {      "url": "https://mcp.hasdata.com/mcp?apis=duckduckgo",      "type": "streamableHttp",      "headers": { "x-api-key": "HASDATA_API_KEY" },      "disabled": false    }  }}
VS Code

.vscode/mcp.json in the workspace:

json
{  "servers": {    "duckduckgo": {      "type": "http",      "url": "https://mcp.hasdata.com/mcp?apis=duckduckgo",      "headers": { "x-api-key": "HASDATA_API_KEY" }    }  }}
Codex CLI

~/.codex/config.toml:

toml
[mcp_servers.duckduckgo]url = "https://mcp.hasdata.com/mcp?apis=duckduckgo"
[mcp_servers.duckduckgo.headers]"x-api-key" = "HASDATA_API_KEY"
Gemini CLI

~/.gemini/settings.json:

json
{  "mcpServers": {    "duckduckgo": {      "httpUrl": "https://mcp.hasdata.com/mcp?apis=duckduckgo",      "headers": { "x-api-key": "HASDATA_API_KEY" }    }  }}

Example prompts

Prompts, not code. Paste one in and the agent calls the tool itself. Each is annotated with the calls it takes, because in MCP the model decides how many calls to make and every successful call costs 10 credits.

Search DuckDuckGo for "model context protocol" and give me the top ten results with their positions and domains.

One call, 10 credits.

Run the query "vpn review" in the German region and again in the US region, then tell me which domains appear in one and not the other.

Two calls, 20 credits. Region is a parameter. The same query in two markets is two calls.

Search for "best crm software" and list only the paid placements, with the advertiser domain for each.

One call, 10 credits. Ads arrive in their own array and need no filtering heuristics.

Take the query "model context protocol" and walk the first three pages, then tell me which domains hold more than one position.

Three calls, 30 credits. Each page after the first is a fresh call with the cursor, and drop q from the arguments once you have one.

Search "who invented the transistor" and show me DuckDuckGo's own AI answer next to the organic results it drew on.

One call, 10 credits.

Two of those are the reason this server exists. Region targeting is a first-class parameter across 37 markets. Comparing one query across countries is a loop and not a proxy setup. And paid placements come back separately from organic, which keeps rank tracking from depending on guessing which result was an ad.

Paging costs a call each time. A prompt that walks ten pages is ten calls and 100 credits.

Tools

ToolWhat it returns
hasdata_duckduckgo_serp_getSearchResultsOrganic results (title, url, snippet, displayed url, position, date, sitelinks, video metadata), ads, and the Search Assist AI answer. 10 credits a call

One tool. Samples below are trimmed from real calls, and the results in them change as the web changes. Read them as shapes.

The samples are the payload, not the whole response. A tools/call result carries one text block, and that text is itself JSON holding url, status, text and json, with the scraped data under json. From a raw JSON-RPC response the path is result.content[0].text, parsed, then .json. A chat client unwraps that for you and code talking to the endpoint directly does not.

Get DuckDuckGo search results

hasdata_duckduckgo_serp_getSearchResults

Fetches a DuckDuckGo results page and returns it parsed.

ParameterTypeNotes
qstringThe search term. Either q or nextPageToken has to be present
nextPageTokenstringCursor from pagination.nextPageToken in the previous response. Wins if you send both, and the q you sent alongside it is ignored without a warning
klstringRegion as <country>-<language>, 37 values from us-en and de-de to jp-jp and wt-wt for no region
ccstringTwo-letter country, 36 values. An alternative to kl when paired with setLang
setLangstringInterface and result language, 33 values
safeSearchstringoff, moderate or strict
deviceTypestringdesktop, mobile or tablet

Send either q or nextPageToken. Sending neither returns 422 naming both fields, because the requirement is conditional and the schema cannot express it as a plain required list. Sending both is not an error either, the cursor wins and the query goes nowhere, so an agent that keeps q in the arguments while paging silently reads the wrong result set.

position counts inside the page it came from, not across the whole result set. Page two comes back with positions starting at 1 again, and page size is not fixed either, so pages of 10, 15 and 14 results all turn up. Absolute rank is therefore the number of organic results you have already collected plus position, not anything you can derive from the page number. Build a rank dataset without that and every page contributes its own number one.

Returns organicResults, ads, searchAssist and pagination. Organic entries carry position, title, link, displayedLink, source and snippet, plus a date, sitelinks and video metadata where DuckDuckGo shows them. searchAssist holds DuckDuckGo's own AI answer for the query.

ads and searchAssist are absent when the page has neither, so test for the key before reading it. organicResults can be absent too, so read it with a default rather than treating its presence as given. A query with no real matches still comes back as a full page of loosely related entries, which is not how "nothing found" usually looks.

json
{  "organicResults": [    {      "position": 1,      "title": "What is the Model Context Protocol (MCP)?",      "link": "https://modelcontextprotocol.io/docs/getting-started/intro",      "displayedLink": "modelcontextprotocol.io › docs › getting-started › intro",      "source": "modelcontextprotocol.io",      "snippet": "MCP is an open-source standard for connecting AI applications to external systems."    }  ],  "ads": [    { "position": 1, "title": "Make Agents Accountable", "link": "https://www.gravitee.io/platform/ai-agent-management" }  ],  "searchAssist": {    "answer": "Model Context Protocol (MCP) is an open standard from Anthropic that lets LLMs connect to external tools, systems, and data sources using a shared interface."  },  "pagination": { "nextPageToken": "eyJ1cmwiOiJodHRwczovL2xpbmtzLmR1Y2tkdWNrZ28uY29t…" }}

Prompts and resources

The server exposes 5 resources, one per parameter whose accepted values are a fixed list. Reading one is cheaper than learning the vocabulary from a rejected call, and it costs no credits. Each URI is hasdata://duckduckgo/<parameter>.

ParameterValuesWhat it selects
kl37DuckDuckGo 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.
cc36The two-letter country code for the country to search from. Combined with setLang to form the DuckDuckGo region. Ignored if kl is set.
setLang33The 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.
safeSearch3Adult Content Filtering option.
deviceType3Specify the device type for the search.

The list is served without an API key, so a client can read it before a user has signed up.

Errors and failure paths

Your client almost never sees an HTTP error code from a tool call. The MCP layer answers 200 and puts the failure inside the result, with isError set to true and the reason as text. The agent reads a message where you might expect a status line.

A wrong key surfaces as tool output, not as a failed connection. Listing tools accepts any non-empty key, so the client completes its handshake and shows green. The first tool call then comes back with isError: true and the text HasData API error: 401 Unauthorized. Watch for that string, because nothing earlier in the flow reports the problem.

A missing key is the one real HTTP error. Authorization runs before any tool, and the connection itself fails with 401.

An argument that breaks the schema is rejected before it becomes a search. The server answers with isError: true and the text MCP error -32602: Input validation error, naming the field. Nothing is fetched and nothing is charged.

Neither q nor nextPageToken returns 422 with an errors array naming both fields and the requiredIfNotExists rule that ties them together.

A query with nothing behind it still returns results. DuckDuckGo decides relevance, so a nonsense string comes back as a normal page of ten loosely related entries with ads and searchAssist absent. Nothing marks it as a miss, which matters if you are building an alert on "no coverage for this brand".

Results that carry data also carry a requestMetadata.id worth quoting in support.

Pricing, free tier and limits

Every call costs 10 credits. The number of results does not change the price. A full page costs the same as a page with one entry.

The free tier is 1,000 credits every month with no card, which is 100 searches. It renews with the billing cycle, so a low-volume agent runs on the free tier indefinitely.

Paid plans start at $59 a month for 200,000 credits, which is 20,000 searches. The unit price falls with volume, from $2.95 per 1,000 searches on the entry plan to $1.19 on Basic and $0.83 across the Growth tiers. Current numbers live on the pricing page.

Your plan also sets concurrency. The free tier allows 5 requests at a time, Startup 5, Basic 15, and the Growth tiers run from 50 to 500. Handle the overflow case defensively in anything unattended, because an agent that fans out will reach the ceiling before you do.

A request that comes back non-200 is not billed. A successful call that finds nothing is still a call.

Tool selection

The apis query parameter decides which tools your agent sees. Fewer tools means less context spent on tool definitions, and fewer chances for the model to reach for the wrong one.

?apis=duckduckgo                        the one tool in this repo?apis=duckduckgo,google_serp            add Google search?apis=duckduckgo,bing_serp,google_serp  three engines side by side

The parameter takes provider names like duckduckgo and individual API names like google_maps_search. Misspelled names are ignored. If every name is wrong the request fails with 400, and the body lists both what it did not recognise and every valid value. Drop the parameter and the same endpoint exposes all 57 HasData tools.

Three engines in one agent is the common reason to widen the list here, because comparing the same query across DuckDuckGo, Google and Bing is a single prompt once all three are exposed.

How it compares

The realistic alternative is a self-hosted server. The popular ones are Python packages you run locally, they reach DuckDuckGo from your own machine, and they hand the model a formatted text block. That works well for a research assistant answering one question at a time. It stops working when you want volume and a stable shape.

Self-hosted serverThis server
What a search returnsA formatted text string built for the model to readJSON with position, title, link, displayedLink, source, snippet, dates and sitelinks
Paid placementsStripped out with the rest of the noiseKept in a separate ads array
PaginationA max_results cap on a single pageCursor in every response
RegionsOne region code37 region codes, or country and language set separately
SafeSearchFixed when the server starts, deliberately not callable by the agentPer call
Who fetches the pageYour machine, over httpx, with an optional curl_cffi backend and a fallback to configureOurs
ThroughputSelf-throttled to 30 searches a minutePlan concurrency, from 1 on the free tier to 1,500
What you runA Python environment, an optional extra, and container or proxy settings when it is not on localhostA URL and a header
Page content extractionA fetch_content toolNot offered
CostFree10 credits a call

Two rows carry most of the decision. A text blob is the right output for a chat answer and the wrong one for a rank dataset, because reconstructing position out of prose is work you should not be doing. And the fetching being ours means the backend question goes away, along with picking between httpx and a browser-impersonating client, installing the extra that the fallback depends on, and reading a stack trace when a plain HTTP client stops getting a page back.

Everything else on that list is a real trade. A self-hosted server is free, needs no account, keeps your queries on your own machine, and fetches page content, which this server does not do. If you run a handful of searches a day inside one assistant, it is the better fit. This one is for the case where the number of searches, the number of regions, or the shape of the output starts to matter.

Against DuckDuckGo's own API. api.duckduckgo.com is the Instant Answer API, and it returns an encyclopedia abstract when one exists rather than a results page. There is no official endpoint that hands you ranked web results, which is why every option here parses the page.

What this server does not do. No page fetching or content extraction, no image or news verticals, no autocomplete. It returns the results page, parsed.

FAQ

Is there an official DuckDuckGo MCP server?

No. DuckDuckGo publishes no MCP server. Every option is built by somebody else. Most are open-source projects that run locally, and this one is a hosted server maintained by HasData.

What is a DuckDuckGo MCP server?

A server that exposes DuckDuckGo search as a tool an AI client can call. The client sends a tool call over the Model Context Protocol, the server runs the search and returns structured JSON, and the model works with the result and never sees a page of HTML.

Do I need a DuckDuckGo account or API key?

No. The only credential is your HasData key. DuckDuckGo has no developer programme to sign up for, and the Instant Answer API it does publish returns no search results.

Do I need to host or run anything?

No. This is a remote MCP server on streamable HTTP. Nothing to install, no Python environment, no browser package, no process to restart.

Is the data live or cached?

Live. Each call fetches the results page at request time and carries its own requestMetadata.id. Two identical calls are two separate fetches and not a replay of a stored copy.

Can I compare the same query across regions?

Yes, and that is the main reason to use a parameter instead of a proxy. kl takes 37 region codes, and cc with setLang splits country and language when you need them apart. Each region is its own call.

What happens when DuckDuckGo changes its layout?

Nothing on your side. We track the changes and keep the response schema stable, so field names and types stay put. A block with nothing to report is absent from the response, so read ads and searchAssist with a default.

Can I use this together with other HasData APIs?

Yes. The apis parameter takes a list, and ?apis=duckduckgo,google_serp,bing_serp gives your agent three search engines at once.

Can I sign in with OAuth instead of pasting a key?

Yes, in clients that support it. Claude Desktop and Cursor can add the endpoint as a connector and sign in. Unattended agents and scripts use the x-api-key header.

Compliance and personal data

HasData accesses publicly available data only. A platform's terms may restrict automated access, and you are responsible for your own compliance. Where the data you collect includes personal information, make sure you have a lawful basis for it under GDPR, CCPA or the equivalent rules in your jurisdiction.

HasData links

Product page and request builderDuckDuckGo SERP API
Server documentationMCP server docs
Every HasData tool in one serverHasData/hasdata-mcp
Client walkthroughsMCP clients and integrations
The other search engines we parseGoogle, Bing and 53 more APIs
Plans and credit costsPlans and credit costs
Keys and usageHasData dashboard
Node launcher on npm@hasdata/duckduckgo-mcp
Python launcher on PyPIhasdata-duckduckgo-mcp

Development

This repository is configuration and documentation for a remote server. There is no build step and nothing to containerize.

The tests in test/ assert the tool contract, the part that can break without a commit here. They check that ?apis=duckduckgo returns exactly one tool, that its name has not changed, that the parameters this README documents still exist with the enums it quotes, and that the key in use is actually accepted. That last check runs a real search and costs 10 credits, which is the price of a canary that can fail for the right reason.

bash
# macOS and LinuxHASDATA_API_KEY=your_key_here npm test
# Windows PowerShell$env:HASDATA_API_KEY="your_key_here"; npm test

The same suite runs in CI on every push and once a week on a schedule, because the upstream tool list can change without anyone touching this repository. A failure means the tool list moved, the key stopped working, or the endpoint was unreachable, and the assertion message says which.

Contributing

Corrections to the parameter table and the response sample are the most useful contribution, because those are the parts that drift. Include the call you made and the response you got. Pull requests from forks run the suite without a key, and the live checks skip instead of going red.

License

MIT. See LICENSE.

来源:README.md,提交 294437f

工具

0
SourceWeft 尚未读取此服务器的工具。

版本历史

3
  1. v1.0.7最新Sep 24, 2026
  2. v1.0.6Sep 22, 2026
  3. v1.0.5Sep 16, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Hasdata 集成