nickclyde/duckduckgo-mcp-server

A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.

What it solves

This project provides a way for Large Language Models (LLMs) to perform web searches and retrieve webpage content using DuckDuckGo. It solves the problem of LLMs having outdated knowledge or lacking access to real-time information by giving them a standardized interface to search the web and parse content from the resulting links.

How it works

It is implemented as a Model Context Protocol (MCP) server. It provides three primary tools for an AI assistant:

  1. Search: Queries DuckDuckGo and returns formatted results with titles and snippets.
  2. Content Fetching: Retrieves the text or markdown of a specific webpage. It includes a cache to avoid redundant downloads and supports multiple parsing modes (text, main content, or markdown).
  3. Link Expansion: Converts short internal reference tokens (ref://) back into full URLs, which the server uses to save context window space when search results contain very long URLs.

To bypass bot detection and TLS fingerprinting, the server can use a curl backend (via curl_cffi) to impersonate a real browser.

Who it’s for

This is for developers building AI agents or using MCP-compatible clients (like Claude Desktop or Claude Code) who want to give their models the ability to browse the web and extract information from websites.

Highlights

  • LLM-Optimized Output: Results are formatted specifically for consumption by AI models.
  • Bot Detection Bypass: Optional browser impersonation via curl to avoid being blocked by Cloudflare or DuckDuckGo.
  • Context Saving: Replaces long URLs with short tokens to preserve the LLM's context window.
  • Built-in Safety: Includes SSRF protection to prevent the AI from accessing private internal networks and configurable SafeSearch levels.
  • Rate Limiting: Integrated protection against rate limits for both searching and fetching content.

Related

  • Project
  • Project
  • Project
  • Project
  • Project