Skip to main content
Glama
mcp-searxng-local

mcp-searxng-local

by dduartee

mcp-searxng-local

License: MIT Node tests

MCP server for web search via SearXNG — zero 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.

See API Reference for full parameter tables.

Setup

opencode mcp add mcp-searxng-local -- node /home/user/mcp-searxng-local/dist/index.js

Or add to your MCP client config manually. See Install Guide for all clients (OpenCode, Claude Code, Cursor, VS Code, Windsurf, Zed).

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

API Reference

Parameter tables, return types, GitHub optimization

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

Doc Guide

How to organize documentation in open source repos

Contributing

See CONTRIBUTING.md for development setup, code style, and PR process. See CHANGELOG.md for release history.

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.

Inputs: url (required), mode, query, maxChars.

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.

Inputs: query (required), count, pageno, engines, +8 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    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

    ActivityStale
    ResponsivenessNo recent community 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.
      133 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      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