mcp-searxng

MCP Server for SearXNG

GitHub Stars

198

User Rating

5.0

(1)

Favorites

0

Views

168

Forks

37

Issues

4

Installation
Difficulty
Intermediate
Estimated Time
10-20 minutes
Requirements
Node.js: 18.0.0以上
npm: 8.0.0以上
+1 more

Installation

Installation

Prerequisites

Please specify required software and versions:
Node.js: 18.0.0 or higher
npm: 8.0.0 or higher
Claude Desktop: Latest version

Installation Steps

1. Clone Repository

bash
git clone https://github.com/ihor-sokoliuk/mcp-searxng.git
cd mcp-searxng

2. Install Dependencies

bash
npm install

3. Configure Claude Desktop

Edit claude_desktop_config.json to add the MCP server:
json
{
  "mcpServers": {
    "searxng": {
      "command": "npx",
      "args": ["-y", "mcp-searxng"],
      "env": {
        "SEARXNG_URL": "http://localhost:8080"
      }
    }
  }
}

4. Start Server

bash
npm start

Troubleshooting

Common Issues

Issue: Server won't start Solution: Check Node.js version and reinstall dependencies. Issue: Not recognized by Claude Desktop Solution: Verify configuration file path and syntax.

Configuration

Configuration

Basic Configuration

Setting the SEARXNG_URL

1Choose a SearxNG instance from the [list of public instances](https://searx.space/) or use your local environment.
2Set the SEARXNG_URL environment variable to the instance URL.
3The default SEARXNG_URL value is http://localhost:8080.

Using Authentication

If you are using a password protected SearxNG instance you can set a username and password for HTTP Basic Auth:
Set the AUTH_USERNAME environmental variable to your username
Set the AUTH_PASSWORD environmental variable to your password

Configuration Example

json
{
  "mcpServers": {
    "searxng": {
      "command": "npx",
      "args": ["-y", "mcp-searxng"],
      "env": {
        "SEARXNG_URL": "http://localhost:8080"
      }
    }
  }
}

Examples

Examples

Basic Usage

Here are basic usage examples for the MCP server:

Using with Claude Desktop

1Verify MCP Server Startup
Open Claude Desktop and confirm that the configuration has been loaded correctly.
2Execute Basic Commands

   Available tools from this MCP server:
   - searxng_web_search: Execute web searches with pagination
   - web_url_read: Read and convert the content from a URL to markdown
   

Programmatic Usage

javascript
// JavaScript example (Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');

const client = new MCPClient();
await client.connect();

// Execute tool
const result = await client.callTool('searxng_web_search', {
  query: 'latest technology news',
  pageno: 1,
  time_range: 'month',
  language: 'en',
  safesearch: 1
});

console.log(result);

Advanced Examples

Automation Script

bash
#!/bin/bash

Batch processing example

for file in *.txt; do mcp-tool process "$file" done

API Integration

python

Python example

import requests import json def call_mcp_tool(tool_name, params): response = requests.post( 'http://localhost:3000/mcp/call', json={ 'tool': tool_name, 'parameters': params } ) return response.json()

Usage example

result = call_mcp_tool('searxng_web_search', { 'query': 'latest news', 'language': 'en' })

Use Cases

Search for specific news articles and display results with pagination.
Use language filters to retrieve search results in a specific language.
Search for articles published in the last month.
Enable safe search to get filtered results.

Additional Resources