An MCP server implementation that integrates the SearXNG API, providing web search capabilities. - Web Search: General queries, news, articles, with pagination. - URL Content Reading: Advanced content extraction with pagination, section filtering, and heading extraction. - Intelligent Caching: URL content is cached with TTL (Time-To-Live) to improve performance and reduce redundant requests. - Pag
Add this skill
npx mdskills install ihor-sokoliuk/mcp-searxngProvides web search via SearXNG with clear setup but lacks detail on tool functionality
1# SearXNG MCP Server23An [MCP server](https://modelcontextprotocol.io/introduction) implementation that integrates the [SearXNG](https://docs.searxng.org) API, providing web search capabilities.45[](https://www.npmjs.com/package/mcp-searxng)67[](https://hub.docker.com/r/isokoliuk/mcp-searxng)89<a href="https://glama.ai/mcp/servers/0j7jjyt7m9"><img width="380" height="200" src="https://glama.ai/mcp/servers/0j7jjyt7m9/badge" alt="SearXNG Server MCP server" /></a>1011## Features1213- **Web Search**: General queries, news, articles, with pagination.14- **URL Content Reading**: Advanced content extraction with pagination, section filtering, and heading extraction.15- **Intelligent Caching**: URL content is cached with TTL (Time-To-Live) to improve performance and reduce redundant requests.16- **Pagination**: Control which page of results to retrieve.17- **Time Filtering**: Filter results by time range (day, month, year).18- **Language Selection**: Filter results by preferred language.19- **Safe Search**: Control content filtering level for search results.2021## Tools2223- **searxng_web_search**24 - Execute web searches with pagination25 - Inputs:26 - `query` (string): The search query. This string is passed to external search services.27 - `pageno` (number, optional): Search page number, starts at 1 (default 1)28 - `time_range` (string, optional): Filter results by time range - one of: "day", "month", "year" (default: none)29 - `language` (string, optional): Language code for results (e.g., "en", "fr", "de") or "all" (default: "all")30 - `safesearch` (number, optional): Safe search filter level (0: None, 1: Moderate, 2: Strict) (default: instance setting)3132- **web_url_read**33 - Read and convert the content from a URL to markdown with advanced content extraction options34 - Inputs:35 - `url` (string): The URL to fetch and process36 - `startChar` (number, optional): Starting character position for content extraction (default: 0)37 - `maxLength` (number, optional): Maximum number of characters to return38 - `section` (string, optional): Extract content under a specific heading (searches for heading text)39 - `paragraphRange` (string, optional): Return specific paragraph ranges (e.g., '1-5', '3', '10-')40 - `readHeadings` (boolean, optional): Return only a list of headings instead of full content4142## Configuration4344### Environment Variables4546#### Required47- **`SEARXNG_URL`**: SearXNG instance URL (default: `http://localhost:8080`)48 - Format: `<protocol>://<hostname>[:<port>]`49 - Example: `https://search.example.com`5051#### Optional52- **`AUTH_USERNAME`** / **`AUTH_PASSWORD`**: HTTP Basic Auth credentials for password-protected instances53- **`USER_AGENT`**: Custom User-Agent header (e.g., `MyBot/1.0`)54- **`HTTP_PROXY`** / **`HTTPS_PROXY`**: Proxy URLs for routing traffic55 - Format: `http://[username:password@]proxy.host:port`56- **`NO_PROXY`**: Comma-separated bypass list (e.g., `localhost,.internal,example.com`)5758## Installation & Configuration5960### [NPX](https://www.npmjs.com/package/mcp-searxng)6162```json63{64 "mcpServers": {65 "searxng": {66 "command": "npx",67 "args": ["-y", "mcp-searxng"],68 "env": {69 "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL"70 }71 }72 }73}74```7576<details>77<summary>Full Configuration Example (All Options)</summary>7879```json80{81 "mcpServers": {82 "searxng": {83 "command": "npx",84 "args": ["-y", "mcp-searxng"],85 "env": {86 "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL",87 "AUTH_USERNAME": "your_username",88 "AUTH_PASSWORD": "your_password",89 "USER_AGENT": "MyBot/1.0",90 "HTTP_PROXY": "http://proxy.company.com:8080",91 "HTTPS_PROXY": "http://proxy.company.com:8080",92 "NO_PROXY": "localhost,127.0.0.1,.local,.internal"93 }94 }95 }96}97```9899**Note:** Mix and match environment variables as needed. All optional variables can be used independently or together.100101</details>102103### [NPM](https://www.npmjs.com/package/mcp-searxng)104105```bash106npm install -g mcp-searxng107```108109```json110{111 "mcpServers": {112 "searxng": {113 "command": "mcp-searxng",114 "env": {115 "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL"116 }117 }118 }119}120```121122<details>123<summary>Full Configuration Example (All Options)</summary>124125```json126{127 "mcpServers": {128 "searxng": {129 "command": "mcp-searxng",130 "env": {131 "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL",132 "AUTH_USERNAME": "your_username",133 "AUTH_PASSWORD": "your_password",134 "USER_AGENT": "MyBot/1.0",135 "HTTP_PROXY": "http://proxy.company.com:8080",136 "HTTPS_PROXY": "http://proxy.company.com:8080",137 "NO_PROXY": "localhost,127.0.0.1,.local,.internal"138 }139 }140 }141}142```143144</details>145146### Docker147148#### Using [Pre-built Image from Docker Hub](https://hub.docker.com/r/isokoliuk/mcp-searxng)149150```bash151docker pull isokoliuk/mcp-searxng:latest152```153154```json155{156 "mcpServers": {157 "searxng": {158 "command": "docker",159 "args": [160 "run", "-i", "--rm",161 "-e", "SEARXNG_URL",162 "isokoliuk/mcp-searxng:latest"163 ],164 "env": {165 "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL"166 }167 }168 }169}170```171172<details>173<summary>Full Configuration Example (All Options)</summary>174175```json176{177 "mcpServers": {178 "searxng": {179 "command": "docker",180 "args": [181 "run", "-i", "--rm",182 "-e", "SEARXNG_URL",183 "-e", "AUTH_USERNAME",184 "-e", "AUTH_PASSWORD",185 "-e", "USER_AGENT",186 "-e", "HTTP_PROXY",187 "-e", "HTTPS_PROXY",188 "-e", "NO_PROXY",189 "isokoliuk/mcp-searxng:latest"190 ],191 "env": {192 "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL",193 "AUTH_USERNAME": "your_username",194 "AUTH_PASSWORD": "your_password",195 "USER_AGENT": "MyBot/1.0",196 "HTTP_PROXY": "http://proxy.company.com:8080",197 "HTTPS_PROXY": "http://proxy.company.com:8080",198 "NO_PROXY": "localhost,127.0.0.1,.local,.internal"199 }200 }201 }202}203```204205**Note:** Add only the `-e` flags and env variables you need.206207</details>208209#### Build Locally210211```bash212docker build -t mcp-searxng:latest -f Dockerfile .213```214215Use the same configuration as above, replacing `isokoliuk/mcp-searxng:latest` with `mcp-searxng:latest`.216217#### Docker Compose218219Create a `docker-compose.yml` file:220221```yaml222services:223 mcp-searxng:224 image: isokoliuk/mcp-searxng:latest225 stdin_open: true226 environment:227 - SEARXNG_URL=YOUR_SEARXNG_INSTANCE_URL228 # Add any optional variables as needed:229 # - AUTH_USERNAME=your_username230 # - AUTH_PASSWORD=your_password231 # - USER_AGENT=MyBot/1.0232 # - HTTP_PROXY=http://proxy.company.com:8080233 # - HTTPS_PROXY=http://proxy.company.com:8080234 # - NO_PROXY=localhost,127.0.0.1,.local,.internal235```236237Then configure your MCP client:238239```json240{241 "mcpServers": {242 "searxng": {243 "command": "docker-compose",244 "args": ["run", "--rm", "mcp-searxng"]245 }246 }247}248```249250### HTTP Transport (Optional)251252The server supports both STDIO (default) and HTTP transports. Set `MCP_HTTP_PORT` to enable HTTP mode.253254```json255{256 "mcpServers": {257 "searxng-http": {258 "command": "mcp-searxng",259 "env": {260 "SEARXNG_URL": "YOUR_SEARXNG_INSTANCE_URL",261 "MCP_HTTP_PORT": "3000"262 }263 }264 }265}266```267268**HTTP Endpoints:**269- **MCP Protocol**: `POST/GET/DELETE /mcp`270- **Health Check**: `GET /health`271272**Testing:**273```bash274MCP_HTTP_PORT=3000 SEARXNG_URL=http://localhost:8080 mcp-searxng275curl http://localhost:3000/health276```277278## Running evals279280```bash281SEARXNG_URL=YOUR_URL OPENAI_API_KEY=your-key npx mcp-eval evals.ts src/index.ts282```283284## For Developers285286### Contributing287288We welcome contributions! Follow these guidelines:289290**Coding Standards:**291- Use TypeScript with strict type safety292- Follow existing error handling patterns293- Write concise, informative error messages294- Include unit tests for new functionality295- Maintain 90%+ test coverage296- Test with MCP inspector before submitting297- Run evals to verify functionality298299**Workflow:**3003011. **Fork and clone:**302 ```bash303 git clone https://github.com/YOUR_USERNAME/mcp-searxng.git304 cd mcp-searxng305 git remote add upstream https://github.com/ihor-sokoliuk/mcp-searxng.git306 ```3073082. **Setup:**309 ```bash310 npm install311 npm run watch # Development mode with file watching312 ```3133143. **Development:**315 ```bash316 git checkout -b feature/your-feature-name317 # Make changes in src/318 npm run build319 npm test320 npm run test:coverage321 npm run inspector322 ```3233244. **Submit:**325 ```bash326 git commit -m "feat: description"327 git push origin feature/your-feature-name328 # Create PR on GitHub329 ```330331### Testing332333```bash334npm test # Run all tests335npm run test:coverage # Generate coverage report336npm run test:watch # Watch mode337```338339**Coverage:** 100% success rate with comprehensive unit tests covering error handling, types, proxy configs, resources, and logging.340341## License342343This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.344
Full transparency — inspect the skill content before installing.