npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hanai/mcp-server-searxng

v0.1.0

Published

Self-hosted MCP server that wraps SearXNG's /search API as a single search tool, served over MCP Streamable HTTP.

Readme

@hanai/mcp-server-searxng

A self-hosted MCP server that wraps SearXNG's /search API as a single search tool, served over MCP Streamable HTTP. Deployable on Bun, Docker, and Cloudflare Workers.

Tool

search — parameters: query (required), categories, engines, language, pageno, time_range (day|month|year), safesearch (0|1|2). Returns results as a Markdown list. categories and engines are comma-separated lists.

Configuration

Copy config.example.json to config.json and edit. AppConfig covers both the upstream SearXNG endpoints and this server's own bearer tokens:

  • endpoints[]{ url, headers? }, at least one. headers are sent to that endpoint.
  • mcp.path — optional MCP endpoint path, default /mcp. Use /searxng/mcp only when your gateway forwards that full path to this app; if the gateway strips /searxng, keep the default /mcp.
  • mcp.bearerTokens[] — one or more tokens; any is accepted on the MCP endpoint.
  • mcp.allowedHosts[] — optional. Required for non-localhost deployments (Cloudflare Workers, or any host reached via a real domain/IP): set it to the hostname(s) this server is reached at, otherwise every request is rejected with 403.
  • requestTimeoutMs — optional, default 10000.

SearXNG prerequisite

Every configured endpoint must have json listed under search.formats in its settings.yml. This server always requests format=json; an endpoint without it returns 403 on every request.

Deployment note: request-body limits

Bearer auth is this server's primary protection, but the MCP HTTP layer (createMcpHonoApp) parses a request's JSON body before the bearer-token check runs. On Bun/VPS there is no built-in body-size limit, so an unauthenticated client could send a large body that gets buffered and parsed before being rejected with 401. Put a reverse proxy or platform limit in front that caps request body size (e.g. Traefik/nginx maxRequestBodyBytes; Cloudflare Workers enforces its own limits). This matches the intended self-hosted-behind-a-proxy deployment model.

Run

Bun (local / VPS)

bun install && CONFIG_PATH=./config.json bun run src/entry-bun.ts (port via PORT, default 3000).

Published package CLI:

bunx @hanai/mcp-server-searxng@latest

Docker

docker compose up (mounts ./config.json, runs the published package via bunx).

Cloudflare Workers

bunx wrangler secret put CONFIG_JSON then bunx wrangler deploy.

Development

  • bun test — run the automated suite.
  • bun run typecheck — type-check with tsc --noEmit.
  • bun run build — bundle the Bun entry to dist/entry-bun.js (published as mcp-server-searxng).
  • bun run scripts/manual-search.ts <query> — manual integration check against a real instance.

Verify-before-code rule

Any use of a library/framework/API must be verified against current official docs (via context7) and, for SearXNG behavior, against https://docs.searxng.org/dev/search_api.html before writing code. This applies for the whole lifetime of the project.