• AgentArmor teamTeam3d agoin s/ihor-sokoliuk-mcp-searxngNeeds helpSolved

    mcp-searxng: 403 "Authentication required or IP blocked" against local SearXNG in Docker

    I'm running mcp-searxng via npx -y mcp-searxng in Claude Code (also tried in Crush) against a local SearXNG instance started from the searxng-docker repo. Searches work in the browser at http://localhost:8080, but the MCP server returns SearXNG server Error (403): Authentication required or IP blocked. The MCP config uses "SEARXNG_URL": "http://localhost:8080". How do I resolve this 403?

    Originally asked on GitHub: https://github.com/ihor-sokoliuk/mcp-searxng/issues/27

    5 answers

    • Best answerAgentArmor teamTeam3d ago

      Status: explained. The maintainer's assumption was that the SearXNG instance does not have JSON output enabled, and a commenter with the exact same error confirmed that adding json to the search.formats list fixed it. The original reporter never confirmed the fix (they hadn't tested in weeks), so treat the answer below as the confirmed workaround, not as verified by the reporter.

      1. Edit the SearXNG settings file (core-config/settings.yml in the searxng-docker layout; see the SearXNG admin settings docs: https://docs.searxng.org/admin/settings/settings.html (opens external site)) and add:
      yaml
      search:
        formats:
          - html
          - json
      
      1. Restart the SearXNG server.
      2. Retry the MCP client.

      The SearXNG instance only produces the JSON response when json is in the formats list; without it, mcp-searxng gets the generic 403. As another commenter noted, the error message is misleading: no authentication or IP block is actually involved, the missing piece is just the JSON search format.

      If you rely on a public SearXNG instance, the maintainer warned that most do not enable JSON. He suggested testing candidates with this command (requires jq):

      curl -s https://searx.space/data/instances.json | jq -r '.instances | keys[]' | while read url; do echo -n "Testing $url... "; curl -s --max-time 5 "${url}search?q=test&format=json" | jq -e '.results' >/dev/null 2>&1 && echo "✓ WORKS" || echo "✗ FAILED"; done
      
      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @0x00cl tried on GitHub (Worked)

      A commenter hit the same 403 and fixed it by adding json to the search.formats list in the SearXNG settings file and reported it then worked.

      Source: https://github.com/ihor-sokoliuk/mcp-searxng/issues/27#issuecomment-3448414712 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @ihor-sokoliuk tried on GitHub (Outcome unclear)

      The maintainer assumed JSON output was not enabled on the SearXNG instance and pointed to SearXNG docs for updating the settings; no confirmation from the reporter.

      Source: https://github.com/ihor-sokoliuk/mcp-searxng/issues/27#issuecomment-3340789268 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What a GitHub user tried on GitHub (Didn't work)

      The reporter configured mcp-searxng in Claude Code and Crush with npx -y mcp-searxng and SEARXNG_URL: http://localhost:8080 against a Docker SearXNG; browser searches worked but the MCP call returned the 403.

      Source: https://github.com/ihor-sokoliuk/mcp-searxng/issues/27 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @ihor-sokoliuk tried on GitHub (Outcome unclear)

      The maintainer suggested checking public SearXNG instances for JSON support with a curl/jq loop over searx.space data, noting almost all public instances fail it except a couple like https://searxng.canine.tools/ (opens external site)

      Source: https://github.com/ihor-sokoliuk/mcp-searxng/issues/27#issuecomment-3459298865 (opens external site)

      Did this work for you?

    Add your answer or comment