ddg-ai-chat
Interact with AI models like GPT, Llama, and Claude via DuckDuckGo to get answers, insights, or assistance by sending messages or questions directly within the MCP server.
Instructions
Chat with DuckDuckGo AI
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keywords | Yes | Message or question to send to the AI | |
| model | No | AI model to use | gpt-4o-mini |
Implementation Reference
- src/ddg_mcp/server.py:368-387 (handler)Executes the 'ddg-ai-chat' tool: validates input, calls DuckDuckGo's DDGS.chat() with keywords and optional model, formats and returns the AI response as TextContent.elif name == "ddg-ai-chat": keywords = arguments.get("keywords") if not keywords: raise ValueError("Missing keywords") model = arguments.get("model", "gpt-4o-mini") # Perform AI chat ddgs = DDGS() result = ddgs.chat( keywords=keywords, model=model ) return [ types.TextContent( type="text", text=f"DuckDuckGo AI ({model}) response:\n\n{result}", ) ]
- src/ddg_mcp/server.py:161-172 (registration)Registers the 'ddg-ai-chat' tool via @server.list_tools(), including its description and JSON inputSchema for 'keywords' (required string) and 'model' (optional enum).types.Tool( name="ddg-ai-chat", description="Chat with DuckDuckGo AI", inputSchema={ "type": "object", "properties": { "keywords": {"type": "string", "description": "Message or question to send to the AI"}, "model": {"type": "string", "enum": ["gpt-4o-mini", "llama-3.3-70b", "claude-3-haiku", "o3-mini", "mistral-small-3"], "description": "AI model to use", "default": "gpt-4o-mini"}, }, "required": ["keywords"], }, ),
- src/ddg_mcp/server.py:164-172 (schema)Input schema for 'ddg-ai-chat' tool: object with required 'keywords' string and optional 'model' enum.inputSchema={ "type": "object", "properties": { "keywords": {"type": "string", "description": "Message or question to send to the AI"}, "model": {"type": "string", "enum": ["gpt-4o-mini", "llama-3.3-70b", "claude-3-haiku", "o3-mini", "mistral-small-3"], "description": "AI model to use", "default": "gpt-4o-mini"}, }, "required": ["keywords"], }, ),