DuckDuckGo Search with MCP Agent

by alihassanml

1 stars
413 downloads
Not rated
GitHub

About

This project demonstrates how to use DuckDuckGo MCP Server with a LangChain Groq LLM agent to perform intelligent search tasks via MCP (Micro Component Protocol).

Details

Author
alihassanml
GitHub stars
1
Downloads
413
Categories
Search

- DuckDuckGo MCP Server integration
- Groq LLM (deepseek-r1-distill-llama-70b) for reasoning
- Async Python execution
- Simple and modular code structure

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name DuckDuckGo Search with MCP Agent
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, install dependencies with pip install -r requirements.txt, set your GROQ_API_KEY in a .env file, install the MCP server via uvx -y duckduckgo-mcp-server, and run python main.py. The script starts an MCP client, connects to the DuckDuckGo MCP server, and uses the Groq LLM to perform a smart search.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "duckduckgo search with mcp agent": {
            "Duckduckgo-with-MCP": {
                "command": "uvx",
                "args": [
                    "-y",
                    "duckduckgo-mcp-server"
                ]
            }
        }
    }
}

McpServers

{
    "Duckduckgo-with-MCP": {
        "command": "uvx",
        "args": [
            "-y",
            "duckduckgo-mcp-server"
        ]
    }
}

DuckDuckGo Search with MCP Agent

This project demonstrates how to use DuckDuckGo MCP Server with a LangChain Groq LLM agent to perform intelligent search tasks via MCP (Micro Component Protocol).

---

Features

- MCP Server Integration (DuckDuckGo search) - Groq LLM (deepseek-r1-distill-llama-70b) for reasoning - Async Python execution - Simple and modular

---

Installation

1. Clone the repository:

git clone https://github.com/alihassanml/Duckduckgo-with-MCP.git
cd Duckduckgo-with-MCP

2. Install dependencies:

pip install -r requirements.txt
(Include libraries like langchain_groq, python-dotenv, etc. in your requirements.txt.)

3. Set up your .env file:

GROQ_API_KEY=your_groq_api_key_here

4. Install the MCP Server:

uvx -y duckduckgo-mcp-server

(Make sure uvx is installed. If not, install it.)

---

Usage

Run the main script:

python main.py

This will:
- Start the MCP client
- Connect to the duckduckgo-mcp-server
- Use the Groq LLM to perform a smart search
- Print the result

---

Example Code

import asyncio
import os
from dotenv import load_dotenv
from langchain_groq import ChatGroq  
from mcp_use import MCPAgent, MCPClient

async def main():
load_dotenv()
config = {
"mcpServers": {
"ddg-search": {
"command": "uvx",
"args": ["-y", "duckduckgo-mcp-server"]
}
}
}
client = MCPClient.from_dict(config)
llm = ChatGroq(model="deepseek-r1-distill-llama-70b")
agent = MCPAgent(llm=llm, client=client, max_steps=30)
result = await agent.run("Find the best restaurant in San Francisco")
print(f"\nResult: {result}")

if __name__ == "__main__":
asyncio.run(main())

---

Resources

- DuckDuckGo MCP Server - LangChain Groq Documentation - Micro Component Protocol (MCP)

---

License

This project is licensed under the MIT License.
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.