Skip to main content
Glama
tisDDM

SearXNG MCP Server

by tisDDM

SearXNG MCP サーバー

AIアシスタントがプライバシーを尊重するメタ検索エンジンであるSearXNGを使用してウェブ検索を実行できるようにする、モデルコンテキストプロトコル(MCP)サーバーです。SearX.spaceからランダムなインスタンスを自動的に選択することで、追加のデプロイメントなしですぐに使用できます。また、基本認証によるプライベートインスタンスもサポートしています。

特徴

  • ゼロ構成セットアップ: SearX.spaceからランダムなパブリックインスタンスを使用してすぐに動作します

  • プライベートインスタンスのサポート: オプションの基本認証を使用して独自のSearXNGインスタンスに接続します

  • カスタマイズ可能なパラメータを使用してウェブ検索を実行する

  • 複数の検索エンジンのサポート

  • プライバシー重視の検索結果

  • Markdown形式の検索結果

  • すべてのパラメータの適切なデフォルト値

注意 - パブリックインスタンスはこの目的では利用できない可能性があり、「ステータスコード429でリクエストが失敗しました」というメッセージが返されます。

Related MCP server: OneSearch MCP Server

インストール

前提条件

  • Node.js (v16 以上)

  • npm (v7以上)

  • SearXNG インスタンスへのアクセス (セルフホストまたはパブリック)

ソースからインストール

# Clone the repository
git clone https://github.com/tisDDM/searxng-mcp.git
cd searxng-mcp

# Install dependencies
npm install

# Build the project
npm run build

構成

SearXNG MCP サーバーは、次の環境変数を使用して構成できます。

  • SEARXNG_URL (オプション): SearXNGインスタンスのURL (例: https://searx.example.com )。指定しない場合は、 SearX.spaceからランダムにパブリックインスタンスが自動的に選択され、追加のデプロイメントなしでサーバーが使用可能になります。

  • USE_RANDOM_INSTANCE (オプション): URLが指定されていない場合にランダムインスタンスの選択を無効にするには、「false」に設定します。デフォルトは「true」です。

  • SEARXNG_USERNAME (オプション): プライベートインスタンスに接続する際の基本認証のユーザー名

  • SEARXNG_PASSWORD (オプション): プライベートインスタンスに接続する際の基本認証のパスワード

これらの環境変数は、プロジェクトのルート ディレクトリにある.envファイルで設定できます。

SEARXNG_URL=https://searx.example.com
SEARXNG_USERNAME=your_username
SEARXNG_PASSWORD=your_password

使用法

サーバーの実行

# If installed globally
searxngmcp

# If installed from source
node build/index.js

Claude Desktopとの統合

  1. クロードデスクトップを開く

  2. 設定 > MCPサーバーへ移動

  3. 次の構成で新しい MCP サーバーを追加します。

    {
      "mcpServers": {
        "searxngmcp": {
          "command": "searxngmcp",
          "env": {
            // Optional: If not provided, a random public instance will be used
            "SEARXNG_URL": "https://searx.example.com",
            // Optional: Only needed for private instances with authentication
            "SEARXNG_USERNAME": "your_username",
            "SEARXNG_PASSWORD": "your_password"
          },
          "disabled": false,
          "autoApprove": []
        }
      }
    }

VSCodeでClaudeと統合する

  1. VSCodeを開く

  2. 設定 > 拡張機能 > Claude > MCP設定に移動します

  3. 次の構成で新しい MCP サーバーを追加します。

    {
      "mcpServers": {
        "searxngmcp": {
          "command": "node",
          "args": ["/path/to/searxng-mcp/build/index.js"],
          "env": {
            // Optional: If not provided, a random public instance will be used
            "SEARXNG_URL": "https://searx.example.com",
            // Optional: Only needed for private instances with authentication
            "SEARXNG_USERNAME": "your_username",
            "SEARXNG_PASSWORD": "your_password"
          },
          "disabled": false,
          "autoApprove": []
        }
      }
    }

スモラジェントとの使用

SearXNG MCPは、AIエージェント構築用の軽量フレームワークであるSmolagentsと簡単に統合できます。これにより、Webを検索して結果を処理できる強力なリサーチエージェントを作成できます。

from smolagents import CodeAgent, LiteLLMModel, ToolCollection
from mcp import StdioServerParameters

# Configure the SearXNG MCP server
server_parameters = StdioServerParameters(
    command="node",
    args=["path/to/searxng-mcp/build/index.js"],
    env={
        "SEARXNG_URL": "https://your-searxng-instance.com",
        "SEARXNG_USERNAME": "your_username",  # Optional
        "SEARXNG_PASSWORD": "your_password"   # Optional
    }
)

# Create a tool collection from the MCP server
with ToolCollection.from_mcp(server_parameters) as tool_collection:
    # Initialize your LLM model
    model = LiteLLMModel(
        model_id="your-model-id",
        api_key="your-api-key",
        temperature=0.7
    )
    
    # Create an agent with the search tools
    search_agent = CodeAgent(
        name="search_agent",
        tools=tool_collection.tools,
        model=model
    )
    
    # Run the agent with a search prompt
    result = search_agent.run(
        "Perform a search about: 'climate change solutions' and summarize the top 5 results."
    )
    
    print(result)

利用可能なツール

検索検索

プライバシーを尊重するメタ検索エンジンSearXNGを使用してWeb検索を実行します。カスタマイズ可能なパラメータを使用して、関連するWebコンテンツを返します。

パラメータ

パラメータ

タイプ

説明

デフォルト

必須

クエリ

弦

検索クエリ

-

はい

言語

弦

検索結果の言語コード(例:'en'、'de'、'fr')

「en」

いいえ

時間範囲

弦

検索結果の期間。オプション: 「日」、「週」、「月」、「年」

ヌル

いいえ

カテゴリー

文字列の配列

検索するカテゴリ(例:「一般」、「画像」、「ニュース」)

ヌル

いいえ

エンジン

文字列の配列

使用する特定の検索エンジン

ヌル

いいえ

セーフサーチ

番号

セーフサーチレベル: 0 (オフ)、1 (中)、2 (厳密)

1

いいえ

ページノ

番号

結果のページ番号。最低1が必要です。

1

いいえ

最大結果数

番号

返される検索結果の最大数。範囲: 1~50

10

いいえ

例

// Example request
const result = await client.callTool('searxngsearch', {
  query: 'climate change solutions',
  language: 'en',
  time_range: 'year',
  categories: ['general', 'news'],
  safesearch: 1,
  max_results: 5
});

発達

設定

# Clone the repository
git clone https://github.com/tisDDM/searxng-mcp.git
cd searxng-mcp

# Install dependencies
npm install

建てる

npm run build

ウォッチモード(開発用)

npm run watch

MCP Inspectorによるテスト

npm run inspector

ライセンス

マサチューセッツ工科大学

Available Tools

1 tool
searxngsearchC

Perform web searches using SearXNG, a privacy-respecting metasearch engine. Returns relevant web content with customizable parameters.

ParametersJSON Schema
NameRequiredDescriptionDefault
categoriesNoCategories to search in (e.g., 'general', 'images', 'news'). Default: null (all categories).
enginesNoSpecific search engines to use. Default: null (all available engines).
languageNoLanguage code for search results (e.g., 'en', 'de', 'fr'). Default: 'en'en
max_resultsNoMaximum number of search results to return. Range: 1-50. Default: 10.
pagenoNoPage number for results. Must be minimum 1. Default: 1.
queryYesSearch query
safesearchNoSafe search level: 0 (off), 1 (moderate), 2 (strict). Default: 1 (moderate).
time_rangeNoTime range for search results. Options: 'day', 'week', 'month', 'year'. Default: null (no time restriction).

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions 'privacy-respecting' and 'returns relevant web content,' but doesn't disclose key behavioral traits like rate limits, authentication needs, error handling, or what 'relevant' entails (e.g., ranking, source diversity). For a search tool with no annotation coverage, this is a significant gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and front-loaded, stating the core purpose in the first sentence. The second sentence adds useful context about returns and parameters without redundancy. It could be slightly more structured (e.g., bullet points), but it's efficient with zero waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (8 parameters, no output schema, no annotations), the description is adequate but incomplete. It covers the basic purpose and hints at behavior, but lacks details on output format, error cases, or operational constraints. Without annotations or output schema, more context would help the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all 8 parameters. The description adds minimal value beyond the schema by mentioning 'customizable parameters' but doesn't provide additional semantics or context for parameter usage. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool performs web searches using SearXNG, specifying it's a privacy-respecting metasearch engine. It distinguishes the tool by mentioning its privacy focus and customizable parameters, though without siblings, differentiation isn't needed. However, it could be more specific about the exact verb and resource (e.g., 'search the web' rather than 'perform web searches').

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, prerequisites, or contextual constraints. It mentions 'customizable parameters' but doesn't explain when specific settings are appropriate. Without siblings, this is less critical, but it still lacks usage context for the agent.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev1.0.0
    • First observedsearxngsearch

TDQS

B3.1/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of confusion or overlap between tools. The tool's purpose is clearly defined as performing web searches using SearXNG, making it distinct by default.

Naming Consistency5/5

Since there is only one tool, naming consistency is inherently perfect. The tool name 'searxngsearch' follows a single pattern without any deviations or mixing of conventions.

Tool Count2/5

A single tool is too few for a server that appears to handle web searches, as it lacks operations for refining searches, managing results, or handling other aspects of a search engine's functionality. This feels thin and incomplete for the domain.

Completeness2/5

The tool surface is severely incomplete for a search engine server. It only provides a basic search function, with no tools for filtering results, handling pagination, accessing advanced search features, or managing search history, leading to significant gaps in coverage.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers