-
Notifications
You must be signed in to change notification settings - Fork 129
Description
Hi!
I'm trying to run your DuckDuckGo MCP server inside a Docker container, but I'm encountering a deadlock issue. The server starts correctly, but when it receives a POST request for the search tool, the process hangs indefinitely and the client receives a "Connection reset by peer" error.
Environment:
- Host OS: Ubuntu/Debian-based Linux
- Docker: Recent version (e.g., 26.x)
- Installation Method: Building the Docker image from source using the provided
Dockerfile.
Steps to Reproduce:
- Clone the repository:
git clone [https://github.com/nickclyde/duckduckgo-mcp-server.git](https://github.com/nickclyde/duckduckgo-mcp-server.git)
- Navigate into the directory:
cd duckduckgo-mcp-server - Build the Docker image:
docker build -t my-duckduckgo-server . - Run the container in the foreground to observe its output (in Terminal 1):
docker run -it --rm -p 8080:8080 --name mcp-duckduckgo my-duckduckgo-server sh -c "python -m duckduckgo_mcp_server.server" - In a second terminal (Terminal 2), send a search request:
curl -X POST -H "Content-Type: application/json" -d '{"tool": "search", "parameters": {"query": "test"}}' http://localhost:8080/
Expected Behavior:
The curl command in Terminal 2 should receive a JSON response with search results.
Actual Behavior:
- The
curlcommand in Terminal 2 fails with the error:curl: (56) Recv failure: Connection reset by peer. - The server process in Terminal 1 does not crash or print any error messages. It just hangs and becomes unresponsive.
Diagnostic Steps Taken:
We have thoroughly debugged the environment and can confirm the following:
- The container has full network connectivity. From an interactive shell inside the container, both
ping duckduckgo.comandcurl -v https://duckduckgo.comwork perfectly, confirming DNS and SSL/TLS are working correctly. - The
docker logsfor the container are always empty, as the process never logs an error before hanging. - The issue persists even after changing the base image in the Dockerfile from
python:3.11-alpinetopython:3.11-slimand explicitly installingca-certificates.
This strongly suggests the issue is not with the Docker environment, networking, or SSL, but likely an internal deadlock within the Python application itself when it attempts to make the outbound request to DuckDuckGo.
Thanks for creating this tool! Let me know if you need any more information from my side.