From 7e260a67a6b0da1501eeb185aa7bee8a562cf422 Mon Sep 17 00:00:00 2001 From: Brian Hetherman Date: Thu, 2 Apr 2026 00:33:24 -0400 Subject: [PATCH] Add README Co-Authored-By: Claude Opus 4.6 --- README.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5d4cef4 --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +# SearXNG MCP Server + +An MCP (Model Context Protocol) server that provides web search via a [SearXNG](https://github.com/searxng/searxng) instance. + +## Setup + +```bash +python -m venv venv +venv/Scripts/pip install -r requirements.txt # Windows +# or +venv/bin/pip install -r requirements.txt # Linux/macOS +``` + +## Usage + +### With Claude Code + +Add to your `.mcp.json` or `~/.claude/settings.json`: + +```json +{ + "mcpServers": { + "searxng": { + "command": "/path/to/venv/bin/python", + "args": ["/path/to/server.py"], + "env": { + "SEARXNG_URL": "http://your-searxng-instance:8080" + } + } + } +} +``` + +### Standalone + +```bash +SEARXNG_URL=http://your-searxng-instance:8080 python server.py +``` + +## Configuration + +| Environment Variable | Default | Description | +|---|---|---| +| `SEARXNG_URL` | `http://192.168.50.224:30053` | Base URL of your SearXNG instance | + +Your SearXNG instance must have JSON format enabled in its `settings.yml` under `search.formats`. + +## Tool: `web_search` + +Search the web using SearXNG. + +| Parameter | Type | Required | Description | +|---|---|---|---| +| `query` | string | yes | Search query | +| `categories` | string | no | Comma-separated: general, images, news, videos, music, files, it, science, social media | +| `language` | string | no | Language code (e.g. en, de, fr) | +| `pageno` | int | no | Page number (starting at 1) | +| `time_range` | string | no | day, week, month, or year | +| `safesearch` | int | no | 0=off, 1=moderate, 2=strict | +| `max_results` | int | no | Max results to return (default 10, max 50) | + +## Tests + +```bash +pip install pytest pytest-asyncio respx +pytest test_server.py -v +```