Skip to main content
Glama
dduartee

mcp-searxng-local

by dduartee

mcp-searxng-local

License: MIT Node tests

MCP server for web search via SearXNGzero API keys, zero cost, 100% local.

Prerequisites

Related MCP server: mcp_server_searXNG

Quick Start

git clone https://github.com/dduartee/mcp-searxng-local
cd mcp-searxng-local
npm install && npm run build
docker compose up -d

# Verify
curl -s "http://localhost:4000/search?q=test&format=json" | python3 -c "import sys,json; print(len(json.load(sys.stdin).get('results',[])), 'results')"

For Termux (no Docker), see the Termux Install Guide.

Tools

Tool

Description

web_search

Search via Google, DuckDuckGo, Brave, Wikipedia, arXiv. Supports domain/date filters, engine selection.

web_search_advanced

Same as web_search — unified handler. Hint for the LLM to use filters more carefully.

web_fetch

Extract page content. mode=highlights returns relevant excerpts (~98% smaller). Optimized for GitHub URLs.

Parameter

Type

Default

Description

query

string

(required)

Search query

count

number

10

Results (1-50)

pageno

number

1

Page number

categories

enum

general, news, images, files, video, music

time_range

enum

day, month, year

language

string

pt-BR, en-US, etc.

includeDomains

string[]

Only results from these domains

excludeDomains

string[]

Exclude these domains

engines

string

google,duckduckgo,brave,wikipedia,arxiv

safesearch

number

0=off, 1=moderate, 2=strict

startPublishedDate

string

ISO date (client-side filter)

endPublishedDate

string

ISO date (client-side filter)

web_fetch parameters

Parameter

Type

Default

Description

url

string

(required)

Full URL

maxChars

number

5000

Character limit (100-50000)

mode

enum

text

text (full page) or highlights (relevant excerpts)

query

string

Required for highlights mode

Setup

After adding the config, restart your MCP client for the tools to appear.

Replace /home/user/mcp-searxng-local with your actual clone path.

OpenCode

opencode mcp add mcp-searxng-local -- node /home/user/mcp-searxng-local/dist/index.js
// ./opencode.json (project) or ~/.config/opencode/opencode.json (global)
{ "mcp": { "mcp-searxng-local": { "type": "local", "command": ["node", "/home/user/mcp-searxng-local/dist/index.js"] } } }

Claude Code / Cursor / VS Code / Windsurf

{
  "mcpServers": {
    "mcp-searxng-local": {
      "command": "node",
      "args": ["/home/user/mcp-searxng-local/dist/index.js"]
    }
  }
}

For VS Code use "servers" instead of "mcpServers". For Windsurf, config goes in ~/.windsurf/mcp.json. See the Install Guide for all client configs.

Configuration

All env vars are optional — defaults work for local SearXNG on port 4000.

Env var

Default

Description

SEARXNG_HOST

localhost

SearXNG host

SEARXNG_PORT

4000

SearXNG port

SEARXNG_TIMEOUT

10000

HTTP timeout (ms)

SEARXNG_FALLBACK_URLS

Comma-separated public SearXNG URLs (auto-retry when local engines are blocked)

GITHUB_TOKEN

GitHub PAT — raises API rate limit from 60 to 5000 req/h

DEBUG

false

Enable verbose logging

Also accepts MCP_SEARCH_LOCAL_ prefix (e.g. MCP_SEARCH_LOCAL_SEARXNG_HOST).

The server loads .env files automatically via dotenv.

Troubleshooting

Symptom

Fix

Tools don't appear

Run npm run build, verify dist/index.js exists

web_search connection error

SearXNG not running: docker compose up -d

## Unresponsive Engines

Auto-fallback handles this. Add SEARXNG_FALLBACK_URLS for more options

Highlights returns full page

Use mode=text with smaller maxChars

See Install Guide for full troubleshooting.

Documentation

Doc

Description

Install Guide

Local, clone, global+plugin, and all MCP client configs

Termux Install

SearXNG native install on Android — no Docker

Architecture

Request flow, design decisions, directory structure

Examples

JSON-RPC payloads, agent workflows, CLI testing

Comparison

vs Exa, Brave, SearXNG raw, Chrome DevTools

GitHub Fetch

Optimized GitHub URL handling in web_fetch

Search Insights

What AI agents actually need from search

License

MIT

Available Tools

3 tools
web_fetchA
Read-onlyIdempotent

Extracts page content as clean text. Supports two modes: "text" (full page, default) and "highlights" (most relevant excerpts for a query, ~10x fewer tokens). Prefer "highlights" with a query for factual searches. Use "text" for deep analysis. Ideal for reading articles, documentation and blogs.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesFull page URL to extract content from (ex: https://example.com)
modeNoMode: "text" returns full page; "highlights" extracts relevant excerpts (requires query)text
queryNoQuery to extract highlights — use the same query from web_search that led to this URL
maxCharsNoMaximum content characters (100-50000, default 5000)

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, destructiveHint. The description adds behavioral context by explaining output format (clean text), token efficiency of highlights mode, and ideal use cases. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, front-loaded with purpose, then modes and usage. Every sentence adds value; no wasted words. Highly efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description sufficiently explains the output (clean text, excerpts, token savings). It lacks explicit error handling or constraints, but the tool is straightforward and annotations cover safety. Adequate for typical use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline 3. The description adds value by explaining the distinction between modes and recommending when to use each, as well as the use of query with highlights. This goes beyond the schema's terse descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool extracts page content as clean text and distinguishes two modes. It differentiates from siblings (web_search, web_search_advanced) by focusing on content extraction rather than search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit guidance: prefer 'highlights' with a query for factual searches and 'text' for deep analysis. Implicitly advises against using this for searching, which is the role of sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

web_search_advancedA
Read-onlyIdempotent

Advanced web search with full filter control: domains, exact dates, specific engines, categories, safe search. Use when you need precise filtering — e.g. "articles from the last month only from arxiv.org and github.com". Includes direct answers, infoboxes, suggestions and spelling corrections.

ParametersJSON Schema
NameRequiredDescriptionDefault
countNoNumber of results (1-50, default 10)
queryYesSearch term. Ex: "latest artificial intelligence news 2026"
pagenoNoResults page (default 1)
enginesNoSelect engines: google, duckduckgo, brave, wikipedia, arxiv (comma-separated)
languageNoLanguage code: pt-BR, en-US, etc.
categoriesNoCategoria: general, news, images, files, video, music
safesearchNoSafe search: 0=off, 1=moderate, 2=strict
time_rangeNoTime filter: day, month, or year
excludeDomainsNoExclude results from these domains (ex: ["pinterest.com"])
includeDomainsNoOnly results from these domains (ex: ["github.com", "wikipedia.org"])
endPublishedDateNoISO date: "2024-12-31" — filter results published before this date (client-side)
startPublishedDateNoISO date: "2024-01-01" — filter results published after this date (client-side)

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already indicate readOnlyHint=true and idempotentHint=true. The description adds value by disclosing additional behavioral traits: includes direct answers, infoboxes, suggestions, and spelling corrections. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences. The first sentence states the core function and key features. The second provides usage guidance and additional features. Every word adds value, and the important information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 12 parameters and no output schema, the description covers the tool's purpose, key parameters, and what the response includes (direct answers, suggestions). It could be more complete about the exact output structure, but it provides sufficient context for an agent to understand the tool's capabilities.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with each parameter documented. The description adds value beyond the schema by providing an example usage that illustrates how to combine parameters (e.g., 'from the last month only from arxiv.org and github.com'). This helps agents understand parameter interaction.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it is an advanced web search with full filter control, listing specific capabilities like domain, date, and engine filters. It distinguishes itself from siblings by emphasizing precision filtering, but does not explicitly contrast with web_search or web_fetch.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a usage example and indicates when to use precise filtering ('Use when you need precise filtering'). However, it lacks explicit guidance on when not to use this tool or alternatives like a simpler web_search.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 3 tool updatesv0.1.0
    • First observedweb_fetch
    • First observedweb_search
    • First observedweb_search_advanced

TDQS

A4.3/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: web_fetch retrieves page content, web_search performs standard web search, and web_search_advanced offers granular filters. No overlap in functionality.

Naming Consistency5/5

All tools follow the 'web_verb' pattern using snake_case, with 'web_search_advanced' being a clear extension. Consistent and predictable.

Tool Count5/5

Three tools is perfectly scoped for a web search server: basic search, advanced search, and content fetching. Each tool earns its place without redundancy.

Completeness5/5

Covers the full search-fetch lifecycle: both basic and advanced search with filters, categories, and time ranges, plus page content extraction. No obvious gaps.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server that wraps a local SearXNG instance to provide private, customizable web search capabilities. It enables AI assistants to perform queries with support for specific parameters like results limits, language, and time ranges.
    109 npm
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A privacy-friendly web search MCP server using SearXNG, enabling searches across multiple engines and categories.
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Free web search MCP server using SearXNG, supporting web search, news search, and search summaries.
    MIT