mcp-searxng is a Node.js server that acts as an integration layer between AI assistants adhering to the Model Context Protocol (MCP) and a SearXNG instance. It enables AI models to perform web searches and read URL content by abstracting the SearXNG API. The current stable version is 1.0.3, with frequent minor releases focusing on bug fixes, performance enhancements, and new features. Key differentiators include robust web search with pagination, advanced URL content extraction (including sections, paragraph ranges, and headings), intelligent caching, and comprehensive time/language/safe search filtering. It's crucial to note that this is a standalone server and not a plugin for SearXNG itself; it connects to any existing SearXNG instance via its HTTP JSON API.
npm install mcp-searxngVerified import paths — ran on the pinned version, not inferred.
This code demonstrates how to programmatically start the MCP SearXNG server, an alternative to running it via the `npx` command. It initializes the server using environment variables and handles graceful shutdown signals.
Ensure you have a running SearXNG instance available at the URL specified by `SEARXNG_URL`. Do not attempt to install `mcp-searxng` within your SearXNG setup.
Upgrade to version 1.0.3 or higher to prevent crashes related to server instance re-initialization. Ensure your deployment strategy correctly manages server lifecycles.
Always set the `SEARXNG_URL` environment variable to a valid and accessible SearXNG instance URL. Verify the URL is correctly formatted and that the SearXNG instance is running and reachable from the `mcp-searxng` server.
Consult the `mcp-searxng` documentation or SearXNG's documentation regarding JSON format 403 errors. This often involves checking SearXNG configuration (e.g., `settings.json`) for allowed request types, user agents, or IP restrictions.
Carefully review the proxy documentation for `mcp-searxng` and ensure all relevant environment variables (e.g., `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`) are correctly configured to match your network environment. Test connectivity thoroughly.
Ensure any custom parsing logic for `mcp-searxng`'s STDIO output accounts for this change if you are running older versions or have strict log processing requirements. Upgrade to v0.9.1+ for better MCP compliance.
Check network connectivity between `mcp-searxng` and your SearXNG instance. Verify proxy settings, firewall rules, and ensure the SearXNG server is stable and responsive. Examine SearXNG logs for connection-related errors.
Set the `SEARXNG_URL` environment variable to the full URL of your SearXNG instance (e.g., `https://my-searxng.example.com`). This is typically done in the `env` section of your MCP client configuration or command-line environment.
Verify that your SearXNG instance is configured to accept requests from the `mcp-searxng` server, and that it allows JSON output. Check SearXNG's `settings.json` for security-related configurations like `allowed_hosts`, `allowed_users`, or `user_agent` requirements. Ensure no firewalls are blocking the requests.
Ensure you are using ECMAScript Modules (ESM) `import { McpServer } from 'mcp-searxng';` and that your `package.json` specifies `"type": "module"` or your file has a `.mjs` extension. Confirm `McpServer` is indeed a class and not a function or object.No dependency data recorded yet.