{"library":"mcp-searxng","title":"SearXNG Model Context Protocol Server","description":"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.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install mcp-searxng"],"cli":null},"imports":["import { McpServer } from 'mcp-searxng';","import { SearxngWebSearchTool } from 'mcp-searxng';","import { McpSearxngServerOptions } from 'mcp-searxng';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { McpServer } from 'mcp-searxng';\n\ninterface EnvConfig {\n  SEARXNG_URL: string;\n  MCP_LOG_LEVEL?: string;\n  // Add other relevant environment variables here as needed\n}\n\nasync function startMcpSearxngServer() {\n  const config: EnvConfig = {\n    SEARXNG_URL: process.env.SEARXNG_URL ?? '',\n    MCP_LOG_LEVEL: process.env.MCP_LOG_LEVEL\n  };\n\n  if (!config.SEARXNG_URL) {\n    console.error('Error: SEARXNG_URL environment variable is required.');\n    process.exit(1);\n  }\n\n  console.log(`Attempting to start MCP SearXNG server for URL: ${config.SEARXNG_URL}`);\n\n  try {\n    // Assuming McpServer constructor takes an options object derived from env\n    // and automatically registers internal tools like SearxngWebSearchTool.\n    const server = new McpServer({\n      searxngUrl: config.SEARXNG_URL,\n      logLevel: config.MCP_LOG_LEVEL || 'info'\n      // Add other options like proxy settings if exposed programmatically\n    });\n\n    await server.start();\n    console.log('MCP SearXNG server successfully started. Listening for MCP messages on STDIO.');\n\n    process.on('SIGINT', async () => {\n      console.log('SIGINT received. Shutting down server...');\n      await server.stop(); // Assuming a stop method exists\n      process.exit(0);\n    });\n\n    process.on('SIGTERM', async () => {\n      console.log('SIGTERM received. Shutting down server...');\n      await server.stop();\n      process.exit(0);\n    });\n\n  } catch (error) {\n    console.error('Failed to start MCP SearXNG server:', error instanceof Error ? error.message : String(error));\n    process.exit(1);\n  }\n}\n\nstartMcpSearxngServer();","lang":"typescript","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}