This package provides a Model Context Protocol (MCP) server implemented in TypeScript, enabling AI agents and applications to perform web searches using DuckDuckGo. Currently at version 0.1.2, it is in active development, with minor releases likely to address features and fixes. Its core functionality revolves around exposing a `duckduckgo_search` tool, which allows clients to query the web with parameters like `query`, `count`, and `safeSearch`. Key differentiators include its adherence to the MCP standard, robust rate limiting (1 req/sec, 15000 req/month), and integrated error handling, making it a reliable bridge for AI applications needing up-to-date search capabilities without direct API integration. It requires Node.js >= 18 and pnpm >= 8.0.0 to run, and is designed to be invoked as a command-line process rather than imported as a traditional JavaScript library.
npm install duckduckgo-mcp-serverVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to quickly run the DuckDuckGo MCP server using npx and integrate its capabilities into a client application like Claude Desktop. This setup allows the client to utilize the 'duckduckgo_search' tool via the Model Context Protocol.
Implement client-side rate limiting or retry mechanisms with exponential backoff to ensure requests adhere to the server's specified limits.
Monitor the GitHub repository for updates and breaking changes. Pin exact versions in production deployments and thoroughly test before upgrading.
Utilize the provided `pnpm run inspector` command, which launches the MCP Inspector, to effectively debug stdio communication between your client and the server. Ensure your client correctly formats MCP messages.
Install Node.js (which includes npm and npx) from nodejs.org, ensuring it's version >=18. Verify installation with `node -v` and `npm -v`.
Implement a delay or a queuing mechanism on the client-side to ensure requests adhere to the server's rate limits (1 req/sec, 15,000 req/month).
Adjust file permissions for the affected configuration file (e.g., `claude_desktop_config.json`) to allow write access for the current user. On Unix-like systems, `chmod 600 /path/to/file.json` might be required.