
MCP Node DuckDuckGo Server
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.
what is MCP Node DuckDuckGo Server?
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.
how to use MCP Node DuckDuckGo Server?
To use the server, clone the repository, install the dependencies, and run the server. You can then access various endpoints to perform searches or fetch content.
key features of MCP Node DuckDuckGo Server?
- DuckDuckGo Search: Execute search queries and return formatted results.
- Web Content Fetching: Retrieve and parse text content from any webpage URL.
- Rate Limiting: Manage request frequency to prevent overload.
- Extensible MCP Server: Easily add or modify functionality through modules.
use cases of MCP Node DuckDuckGo Server?
- Integrating DuckDuckGo search functionality into applications.
- Fetching and parsing content from web pages for data analysis.
- Building tools that require web scraping capabilities.
FAQ from MCP Node DuckDuckGo Server?
- What technologies does the server use?
The server uses Node.js, Express, Axios, and Cheerio.
- How do I start the server?
Run
node mcp-node-duckduckgo-server.js
after installing the dependencies.
- Can I contribute to the project?
Yes! Contributions are welcome, and you can fork the repository to add features.
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
-
Clone the Repository
Clone the repository from GitHub:git clone <repository-url>
-
Navigate to the Project Folder
cd mcp-node-duckduckgo-server
-
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:
- Fork the repository.
- Create your feature branch (
git checkout -b feature/YourFeature
). - Commit your changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature/YourFeature
). - Open a Pull Request.
License
This project is licensed under the MIT License. See the LICENSE file for details.