Sponsored by Deepsite.site

MCP Node DuckDuckGo Server

Created By
yapweijun19968 months ago
The MCP Node DuckDuckGo Server is a modular Node.js application that allows developers to integrate and test DuckDuckGo search and web content fetching capabilities through a simple HTTP API. It uses Express to establish endpoints, axios to make outbound HTTP requests, and Cheerio for parsing HTML.
Content

MCP Node DuckDuckGo Server

A Node.js application serving as an MCP server that offers two main tools:

  • Search: Query DuckDuckGo and retrieve formatted search results.
  • Fetch Content: Retrieve and parse text content from any webpage URL.

Table of Contents

Overview

The MCP Node DuckDuckGo Server is a Node.js server that provides a modular interface (via HTTP endpoints) to query DuckDuckGo and fetch webpage content. This project showcases:

  • Express for server creation.
  • Axios for making HTTP requests.
  • Cheerio for parsing HTML.

Features

  • DuckDuckGo Search: Uses a POST API to execute search queries and return DuckDuckGo results formatted for further processing.
  • Web Content Fetching: Retrieves and parses text content from a given URL.
  • Rate Limiting: Provides basic rate limiting to manage the request frequency.
  • Extensible MCP Server: Tools are organized as modules, making it easy to add or modify functionality.

Requirements

  • Node.js (v12 or higher)
  • npm

Installation

  1. Clone the Repository
    Clone the repository from GitHub:

    git clone <repository-url>
    
  2. Navigate to the Project Folder

    cd mcp-node-duckduckgo-server
    
  3. Install Dependencies
    Install required packages using npm:

    npm install express axios cheerio
    

Usage

Starting the Server

Run the server by executing:

node mcp-node-duckduckgo-server.js

You should see a log message similar to:

MCP Server "ddg-search" running on port 3000

Available Endpoints

List Tools

To list all available tools, open a new terminal window and run:

curl http://localhost:3000/tools

This should output a JSON list of registered tools (e.g., "search" and "fetchContent").

Search Tool

Execute a search query using the search tool:

curl -X POST http://localhost:3000/run-tool -H "Content-Type: application/json" -d "{\"toolName\":\"search\",\"params\":{\"query\":\"test query\",\"maxResults\":5}}"

The response will contain the formatted search results from DuckDuckGo.

Fetch Content Tool

Fetch content from a specific webpage:

curl -X POST http://localhost:3000/run-tool -H "Content-Type: application/json" -d "{\"toolName\":\"fetchContent\",\"params\":{\"url\":\"https://www.channelnewsasia.com/singapore/ge2025-general-election-may-3-parliament-dissolved-5064316\"}}"

The server will return a text snippet from the fetched webpage.

Logging and Debugging

  • The server logs informational and error messages to the terminal.
  • Use these logs to debug issues such as timeouts, HTTP errors, or unexpected behavior in responses.

Contributing

Contributions are welcome! If you want to contribute:

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/YourFeature).
  3. Commit your changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature/YourFeature).
  5. Open a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
WindsurfThe new purpose-built IDE to harness magic
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
DeepChatYour AI Partner on Desktop
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Amap Maps高德地图官方 MCP Server
CursorThe AI Code Editor
Playwright McpPlaywright MCP server
Serper MCP ServerA Serper MCP Server
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Tavily Mcp
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
ChatWiseThe second fastest AI chatbot™
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.