Labsco
hypersniper05 logo

MCP-WebSearch-SearXNG

from hypersniper05

Lets your model (or autonomous agent) browse the web, run searches across many engines at once, and surface images directly in your front end.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

WebSearch SearXNG + MCP Server

A self-hosted SearXNG metasearch engine paired with the mcp-searxng MCP server, built for LLMs, agents, and tool-using applications. Lets your model (or autonomous agent) browse the web, run searches across many engines at once, and surface images directly in your front end. Runs entirely on your own machine via Docker, accessed from your browser, and speaks MCP over HTTP Streamable transport so it plugs into any MCP-compatible client (Claude Desktop, Cline, Open WebUI, LM Studio, custom agent frameworks, etc.). Enhanced with image/video/category search, offset pagination, and smart base64 image resizing for vision-capable models. Both services stay on your local network, so nothing leaves your box unless you ask it to. No ads, no telemetry, no third-party trackers, no accounts โ€” the SearXNG frontend is privacy-by-design and the MCP patches add zero phone-home of their own.

SearXNG web frontend at localhost:8888
SearXNG frontend โ€” the privacy-respecting metasearch UI at localhost:8888. Same backend the MCP server queries internally.
LLM autonomously calling searxng_web_search and web_url_read
Autonomous tool chain โ€” model fires multiple searxng_web_search calls in parallel, then chains into web_url_read to pull full article text.
Article continuation extracted via web_url_read
Clean text extraction โ€” long-form article content pulled by web_url_read, boilerplate stripped, ready for the model to summarize.



Synthesized AI news briefing with inline image
Inline image in news briefing โ€” image fetched and resized through web_url_read's sharp pipeline. No external CDN, served as a base64 MCP image block.
Multi-query meme search
Multi-query parallel search โ€” queries separated by | fan out several searxng_web_search calls at once, landing on the "It's Gonna Be May" meme.
Multiple inline meme images returned by web_url_read
Native image blocks โ€” multiple images returned inline. The detail parameter (low/medium/high) controls resize quality vs. token cost.

Endpoints Summary

ServiceURLPurpose
SearXNG UIhttp://localhost:8888Web search interface
SearXNG APIhttp://localhost:8888/searchJSON search API
MCP Serverhttp://localhost:3001/mcpMCP Streamable HTTP
MCP Healthhttp://localhost:3001/healthHealth check endpoint

Need TLS for an HTTPS-only client? The cleanest path is Tailscale Serve if both ends are on a tailnet (real Let's Encrypt-trusted cert, zero per-client setup), or a reverse proxy like Caddy / nginx with your own cert otherwise. Either is added in front of the existing HTTP MCP endpoint without any changes to this stack.

MCP Tools

Web search with category, pagination, and filtering support.

ParameterTypeDescription
querystringSearch query (required)
categoriesstringgeneral, images, videos, news, music, files, it, science, social media, map
max_resultsnumberResults per batch (default: 20 general, 10 images/videos)
offsetnumberSkip N results for pagination (e.g., 10 for results 11-20)
pagenonumberSearXNG page number
time_rangestringday, month, year
languagestringLanguage code (e.g., en, fr)
safesearchnumber0 (none), 1 (moderate), 2 (strict)

2. web_url_read

Fetches and reads URLs. Auto-detects image URLs and returns resized base64 image blocks.

ParameterTypeDescription
urlstringURL to read (required)
detailstringImage resize level: low (448px, ~256 tokens), medium (768px, ~756 tokens, default), high (1280px, ~2048 tokens)
startCharnumberCharacter offset for text pagination
maxLengthnumberMax characters to return
sectionstringExtract content under a heading
paragraphRangestringParagraph range (e.g., 1-5)
readHeadingsbooleanReturn headings only

Image Search Flow

  1. searxng_web_search({query: "sunset", categories: "images"}) โ†’ returns image URLs + metadata
  2. Pick an image โ†’ web_url_read({url: "https://example.com/sunset.jpg", detail: "medium"}) โ†’ returns resized base64 image
  3. To see more results โ†’ searxng_web_search({query: "sunset", categories: "images", offset: 10}) โ†’ results 11-20

Custom Patch Files

All patches are in mcp-searxng-patches/ and mounted read-only into the container:

FilePurpose
DockerfileExtends base image with sharp for image resizing
types.jsTool schemas with categories, offset, max_results, detail parameters
search.jsCategory-aware search formatting, offset pagination, image/video result fields
url-reader.jsfetchImage() with sharp resizing (3 detail presets), base64 MCP image blocks
index.jsTool handler wiring, image URL detection, detail passthrough

Tested With

  • Qwen3.6 35B A3B โ€” runs both searxng_web_search (including multi-query and category filters) and web_url_read (text + image modes) reliably. Tool selection, parameter inference, and result interpretation all work well with this model.

Notes

  • MCP server uses HTTP Streamable transport (not stdio or SSE-only)
  • SearXNG connects internally via Docker hostname searxng:8080
  • All data stays local โ€” no external API keys needed
  • Custom patches are MIT-licensed, audited, no filesystem/shell access, no telemetry
  • Search engines: Bing, Startpage, Mojeek, Yahoo active; Google with mobile UI (may intermittently block)