spences10

mcp-duckduckgo-search

Community spences10
Updated

MCP server for DuckDuckGo search

mcp-duckduckgo-search

A Model Context Protocol (MCP) server for integrating DuckDuckGosearch capabilities with LLMs. This server provides comprehensive websearch functionality with support for various result types andfiltering options.

Features

  • ๐Ÿ” Comprehensive web search using DuckDuckGo's search engine
  • ๐Ÿ“Š Rich result types including:
    • Knowledge graph information
    • Organic search results
    • News articles
    • Video content
    • Image results
    • Related searches
  • ๐ŸŒ Region-specific search support
  • ๐Ÿ›ก๏ธ Configurable safe search levels
  • ๐Ÿ“… Date-based filtering options
  • ๐Ÿ“„ Pagination support
  • ๐Ÿ’พ Built-in result caching
  • ๐Ÿ”’ Safe search options (off, moderate, strict)

Configuration

This server requires configuration through your MCP client. Here areexamples for different environments:

Cline Configuration

Add this to your Cline MCP settings:

{
	"mcpServers": {
		"mcp-duckduckgo-search": {
			"command": "npx",
			"args": ["-y", "mcp-duckduckgo-search"],
			"env": {
				"SERPAPI_KEY": "your-serpapi-api-key"
			}
		}
	}
}

Claude Desktop with WSL Configuration

For WSL environments, add this to your Claude Desktop configuration:

{
	"mcpServers": {
		"mcp-duckduckgo-search": {
			"command": "wsl.exe",
			"args": [
				"bash",
				"-c",
				"source ~/.nvm/nvm.sh && SERPAPI_KEY=your-serpapi-api-key /home/username/.nvm/versions/node/v20.12.1/bin/npx mcp-duckduckgo-search"
			]
		}
	}
}

Environment Variables

The server requires the following environment variable:

  • SERPAPI_KEY: Your SerpAPI key (required)

API

The server implements a single MCP tool with configurable parameters:

ddg_search

Perform web searches using the DuckDuckGo search engine.

Parameters:

  • query (string, required): Search query
  • region (string, optional): Region code (e.g., us-en, uk-en)(default: us-en)
  • safe_search (string, optional): Safe search level (off, moderate,strict) (default: moderate)
  • date_filter (string, optional): Filter results by date:
    • 'd': past day
    • 'w': past week
    • 'm': past month
    • 'y': past year
    • Custom range: '2023-01-01..2023-12-31'
  • start (number, optional): Result offset for pagination
  • no_cache (boolean, optional): Bypass cache for fresh results(default: false)

Response includes:

  • Knowledge graph data when available
  • Organic search results
  • News articles
  • Video content
  • Image results
  • Related searches
  • Search metadata

Development

Setup

  1. Clone the repository
  2. Install dependencies:
pnpm install
  1. Build the project:
pnpm build
  1. Run in development mode:
pnpm dev

Publishing

The project uses changesets for version management. To publish:

  1. Create a changeset:
pnpm changeset
  1. Version the package:
pnpm changeset version
  1. Publish to npm:
pnpm release

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see the LICENSE file for details.

Acknowledgments

MCP Server ยท Populars

MCP Server ยท New

    chatmcp

    mcpso

    directory for Awesome MCP Servers

    Community chatmcp
    TBXark

    MCP Proxy Server

    An MCP proxy server that aggregates and serves multiple MCP resource servers through a single HTTP server.

    Community TBXark
    ttommyth

    interactive-mcp

    Ask users questions from your LLM! interactive-mcp: Local, cross-platform MCP server for interactive prompts, chat & notifications.

    Community ttommyth
    lpigeon

    ros-mcp-server

    The ROS MCP Server is designed to support robots in performing complex tasks and adapting effectively to various environments by providing a set of functions that transform natural language commands, entered by a user through an LLM, into ROS commands for robot control.

    Community lpigeon
    emicklei

    melrose-mcp

    interactive programming of melodies, producing MIDI

    Community emicklei