SearxNG MCP Server
SearxNG MCP サーバー
SearxNG を使用して Web 検索機能を提供し、Claude などの AI アシスタントによる Web 検索を可能にするモデル コンテキスト プロトコル (MCP) サーバー。
人間の監督の下で AI によって作成されました。人工知能であっても、コーヒー休憩を取るタイミングを誰かに指示してもらう必要がある場合があるからです。🤖☕
概要
このプロジェクトは、プライバシーを尊重するメタ検索エンジンであるSearxNGに接続するMCPサーバーを実装します。このサーバーは、大規模言語モデルがユーザーを追跡することなくWebを検索するためのシンプルで効率的な方法を提供します。
このサーバーはLLM向けに特別に設計されており、コンテキストウィンドウの使用を最小限に抑えるために必要不可欠な機能のみを搭載しています。この合理化されたアプローチにより、LLMと検索エンジン間の通信が効率的になり、貴重なコンテキスト空間をより重要な情報のために確保できます。
特徴
SearxNGによるプライバシー重視のウェブ検索
LLM統合のためのシンプルなAPI
Claude Desktopおよびその他のMCP準拠クライアントと互換性があります
設定可能な検索パラメータ
LLM 向けに最適化された、整理された検索結果
Related MCP server: mcp-searxng
MCP互換アプリケーションとの統合
統合例
pipx run を使用する(推奨、インストールは不要)
ホームディレクトリに.claudercファイルを作成します。
{
"mcpServers": {
"searxng": {
"command": "pipx",
"args": [
"run", "searxng-simple-mcp@latest"
],
"env": {
"SEARXNG_MCP_SEARXNG_URL": "https://your-instance.example.com"
}
}
}
}uvx run を使用する(インストールは不要)
{
"mcpServers": {
"searxng": {
"command": "uvx",
"args": [
"run", "searxng-simple-mcp@latest"
],
"env": {
"SEARXNG_MCP_SEARXNG_URL": "https://your-instance.example.com"
}
}
}
}pip で Python を使用する (インストールが必要)
{
"mcpServers": {
"searxng": {
"command": "python",
"args": ["-m", "searxng_simple_mcp.server"],
"env": {
"SEARXNG_MCP_SEARXNG_URL": "https://your-instance.example.com"
}
}
}
}Docker での使用 (インストール不要)
{
"mcpServers": {
"searxng": {
"command": "docker",
"args": [
"run", "--rm", "-i", "--network=host",
"-e", "SEARXNG_MCP_SEARXNG_URL=http://localhost:8080",
"ghcr.io/sacode/searxng-simple-mcp:latest"
]
}
}
}注意: MCP サーバーで Docker を使用する場合:
envオブジェクトは Docker コンテナに適切に渡されないため、環境変数はargs配列の-eフラグを使用して直接渡す必要があります。ローカルホスト(例: http://localhost:8080 )で実行されているSearxNGインスタンスにアクセスする必要がある場合は、コンテナがホストのネットワークにアクセスできるように、
--network=hostフラグを使用する必要があります。そうしないと、コンテナ内の「localhost」はホストマシンではなく、コンテナ自体を参照することになります。--network=hostを使用する場合、コンテナはホストのネットワーク スタックを直接共有するため、ポート マッピング (-p) は必要なく、無視されます。
構成
環境変数を使用してサーバーを構成します。
環境変数 | 説明 | デフォルト値 |
SEARXNG_MCP_SEARXNG_URL | 使用するSearxNGインスタンスのURL | |
SEARXNG_MCP_TIMEOUT | HTTPリクエストのタイムアウト(秒) | 10 |
SEARXNG_MCP_DEFAULT_RESULT_COUNT | 返される結果のデフォルトの数 | 10 |
SEARXNG_MCP_DEFAULT_LANGUAGE | 結果の言語コード(例:「en」、「ru」、「all」) | 全て |
SEARXNG_MCP_DEFAULT_FORMAT | 結果のデフォルト形式('text'、'json') | 文章 |
SEARXNG_MCP_ログ_レベル | ログレベル(例:「DEBUG」、「INFO」、「WARNING」、「ERROR」、「CRITICAL」) | エラー |
トランスポートプロトコル | トランスポートプロトコル('stdio' または 'sse') | 標準入出力 |
**注意:**ログ レベルを ERROR よりも高く設定すると (DEBUG や INFO など)、通信チャネルでの出力が過剰になり、一部のアプリケーションとの統合が壊れる可能性があります。
独自にホストしたくない場合は、 https://searx.spaceで公開されている SearxNG インスタンスのリストを見つけることができます。
インストールと使用方法
前提条件
Python 3.10以上
SearxNG インスタンス (パブリックまたはセルフホスト)
オプション 1: インストールせずに実行 (推奨)
このサーバーを使用する最も簡単な方法は、pipx または uvx を使用することです。これにより、パッケージを永続的にインストールせずに実行できます。
# Using pipx
pip install pipx # Install pipx if you don't have it
pipx run searxng-simple-mcp
# OR using uvx
pip install uvx # Install uvx if you don't have it
uvx run searxng-simple-mcp設定オプションを直接渡すことができます:
# Using pipx with custom SearxNG instance
pipx run searxng-simple-mcp --searxng-url https://your-instance.example.comオプション2: PyPIまたはソースからインストールする
より永続的なインストールの場合:
# From PyPI using pip
pip install searxng-simple-mcp
# OR using uv (faster installation)
pip install uv
uv pip install searxng-simple-mcp
# OR from source
git clone https://github.com/Sacode/searxng-simple-mcp.git
cd searxng-simple-mcp
pip install uv
uv pip install -e .インストール後、次のコマンドでサーバーを実行できます。
# Run directly after installation
python -m searxng_simple_mcp.server
# OR with configuration options
python -m searxng_simple_mcp.server --searxng-url https://your-instance.example.comオプション3: Docker
Docker を使用する場合:
# Pull the Docker image
docker pull ghcr.io/sacode/searxng-simple-mcp:latest
# Run the container with default settings (stdio transport)
docker run --rm -i ghcr.io/sacode/searxng-simple-mcp:latest
# Run with environment file for configuration
docker run --rm -i --env-file .env ghcr.io/sacode/searxng-simple-mcp:latest
# Run with SSE transport (starts HTTP server on port 8000)
docker run -p 8000:8000 -e TRANSPORT_PROTOCOL=sse ghcr.io/sacode/searxng-simple-mcp:latest
# Building locally
docker build -t searxng-simple-mcp:local .
docker run --rm -i searxng-simple-mcp:local
# Using Docker Compose
docker-compose up -dDocker の完全な使用方法については、以下のDocker 構成セクションを参照してください。
トランスポートプロトコル
MCP サーバーは、次の 2 つのトランスポート プロトコルをサポートしています。
STDIO (デフォルト): CLIアプリケーションおよび直接統合用
すべての例でデフォルトで使用される
Claude Desktop やその他の MCP 準拠クライアントとの統合に適しています
HTTPサーバーが起動されていません
SSE (Server-Sent Events): WebベースのクライアントとHTTPベースの統合向け
クライアントが接続できるHTTPサーバーを起動します
リアルタイム更新が必要なWebアプリケーションやサービスに役立ちます
Dockerを使用する場合はポートマッピングが必要です
SSEトランスポートの使用
SSE トランスポート プロトコルを使用するには:
直接実行の場合:
# Set the transport protocol to SSE TRANSPORT_PROTOCOL=sse python -m searxng_simple_mcp.server # Or with FastMCP fastmcp run src/searxng_simple_mcp/server.py --transport sseDockerを使用する場合:
# Run with SSE transport protocol docker run -p 8000:8000 -e TRANSPORT_PROTOCOL=sse -e SEARXNG_MCP_SEARXNG_URL=https://your-instance.example.com ghcr.io/sacode/searxng-simple-mcp:latestDocker Compose を使用する場合(付属の
docker-compose.ymlから):environment: - SEARXNG_MCP_SEARXNG_URL=https://searx.info - SEARXNG_MCP_TIMEOUT=10 - SEARXNG_MCP_MAX_RESULTS=20 - SEARXNG_MCP_LANGUAGE=all - TRANSPORT_PROTOCOL=sse # Transport protocol: stdio or sse
SSE を使用する場合、デフォルトではhttp://localhost:8000で HTTP 経由でサーバーにアクセスできるようになります。
MCP クライアントから SSE サーバーに接続するには、次のような構成を使用します。
{
"mcpServers": {
"searxng": {
"url": "http://localhost:8000",
"transport": "sse"
}
}
}**注:**すべてのアプリケーションがSSEトランスポートプロトコルをサポートしているわけではありません。このトランスポート方式を使用する前に、MCPクライアントがSSEと互換性があることを確認してください。
発達
開発とテストの場合:
# Install dependencies
uv pip install -e .
# Run linter and formatter
ruff check .
ruff check --fix .
ruff format .
# Run the server directly
python -m src.searxng_simple_mcp.server
# OR using FastMCP
fastmcp run src/searxng_simple_mcp/server.py # Use stdio transport (default)
fastmcp run src/searxng_simple_mcp/server.py --transport sse # Use sse transport
# Run in development mode (launches MCP Inspector)
fastmcp dev src/searxng_simple_mcp/server.pyPyPIへの公開
パッケージの新しいバージョンを PyPI に公開する必要があるメンテナーの場合:
# Install development dependencies
npm run install:deps
# Clean, build, and check the package
npm run build:package
npm run check:package
# Publish to PyPI (requires PyPI credentials)
npm run publish:pypi
# Alternatively, use the all-in-one commands to update version and publish
npm run publish:patch # Increments patch version (1.0.1 -> 1.0.2)
npm run publish:minor # Increments minor version (1.0.1 -> 1.1.0)
npm run publish:major # Increments major version (1.0.1 -> 2.0.0)これらのコマンドは次のことを行います。
package.json と pyproject.toml の両方のバージョンを更新します。
distディレクトリをクリーンアップして古いビルドを削除します
パッケージをビルドする(ホイールとソース配布物を作成する)
パッケージにエラーがないか確認する
パッケージをPyPIにアップロードする
PyPIアカウントとtwineによる認証が必要です。認証は以下の方法で設定できます。
ホームディレクトリに
.pypircファイルを作成する環境変数の使用(
TWINE_USERNAMEとTWINE_PASSWORD)PyPI APIトークンの使用(推奨)
Dockerの設定
MCP サーバーで Docker を使用する場合は、次の点に注意してください。
MCP クライアントとの統合: Claude Desktop またはその他の MCP 準拠クライアントと統合するには、「Docker での使用」セクションに示されている構成を使用します。
トランスポートプロトコル:
デフォルトでは、Dockerコンテナはstdioトランスポートプロトコルを使用します。
SSEトランスポートについては、 「SSEトランスポートの使用」セクションを参照してください。
設定オプション:
環境ファイル (.env) を使用してサーバーを構成します:
docker run --env-file .env ...-eフラグを使用して個々の環境変数を渡します:docker run -e SEARXNG_MCP_SEARXNG_URL=https://example.com ...利用可能な環境変数については、構成セクションを参照してください。
ネットワーキング:
ホストマシン上のサービスにアクセスする必要がある場合は
--network=hostを使用します。SSEサーバーをネットワークに公開する場合は
-p 8000:8000を使用します。
パッケージ構造
searxng-simple-mcp/
├── src/
│ ├── run_server.py # Entry point script
│ └── searxng_simple_mcp/ # Main package
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Docker configuration
└── pyproject.toml # Python project configuration貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。
ライセンス
このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細については LICENSE ファイルを参照してください。
Available Tools
1 toolweb_searchC
Perform a web search using SearxNG and return formatted results.
Results are returned in either text format (human-readable) or JSON format depending on the result_format parameter selected.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | The search query string to look for on the web | |
| result_count | No | Maximum number of results to return | |
| categories | No | Categories to filter by (e.g., 'general', 'images', 'news', 'videos') | |
| language | No | Language code for results (e.g., 'all', 'en', 'ru', 'fr') | all |
| time_range | No | Time restriction for results | |
| result_format | No | Output format - 'text' for human-readable, 'json' for structured data | text |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that results are returned in text or JSON format based on a parameter, which adds some context about output behavior. However, it fails to disclose critical traits such as whether this is a read-only operation, potential rate limits, authentication needs, error handling, or any side effects. For a search tool with zero annotation coverage, this is a significant gap in transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured, consisting of two sentences that efficiently convey the core functionality and output format options. It avoids unnecessary details and is front-loaded with the main purpose. However, it could be slightly more polished by integrating the format explanation more seamlessly, but overall it's efficient with zero waste.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (6 parameters, 1 required) and the presence of an output schema (which reduces the need to describe return values in the description), the description is somewhat complete but has gaps. It covers the basic action and output format but lacks usage guidelines, behavioral context, and deeper parameter insights. With no annotations and only partial compensation in the description, it's adequate but not fully comprehensive for effective agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100%, meaning all parameters are well-documented in the input schema itself. The description adds minimal value beyond the schema by briefly mentioning the result_format parameter's effect on output format. However, it doesn't provide additional semantic context, examples, or usage tips for parameters like categories or time_range. Given the high schema coverage, a baseline score of 3 is appropriate as the description doesn't compensate with extra insights.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool performs a web search using SearxNG and returns formatted results. It specifies the action ('perform a web search'), resource ('web'), and output format ('formatted results'), making the purpose explicit. However, it doesn't differentiate from siblings since there are none, so it doesn't reach the highest score of 5.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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. It mentions the result_format parameter but doesn't explain when to choose text vs. JSON, nor does it discuss any prerequisites, limitations, or typical use cases. This lack of contextual guidance leaves the agent without direction on optimal usage.
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 tool update
v1.0.0- Changed
web_search3 fields changed- changed
Input schema / properties / result_format / descriptionPrevious value: -"Output format - 'text' for human-readable or 'json' for structured data"New value: +"Output format - 'text' for human-readable, 'json' for structured data" - removed
Input schema / titleRemoved value: -"web_searchArguments" - changed
Output schema / (root)Previous value: -nullNew value: +{ + "$defs": { + "SearxngResult": { + "description": "Model for a single SearxNG search result.", + "properties": { + "category": { + "title": "Category", + "type": "string" + }, + "content": { + "title": "Content", + "type": "string" + }, + "engine": { + "title": "Engine", + "type": "string" + }, + "engines": { + "items": { + "type": "string" + }, + "title": "Engines", + "type": "array" + }, + "img_src": { + "title": "Img Src", + "type": "string" + }, + "parsed_url": { + "items": { + "type": "string" + }, + "title": "Parsed Url", + "type": "array" + }, + "positions": { + "items": { + "type": "integer" + }, + "title": "Positions", + "type": "array" + }, + "priority": { + "title": "Priority", + "type": "string" + }, + "publishedDate": { + "default": null, + "title": "Publisheddate" + }, + "score": { + "title": "Score", + "type": "number" + }, + "template": { + "title": "Template", + "type": "string" + }, + "thumbnail": { + "default": null, + "title": "Thumbnail" + }, + "title": { + "title": "Title", + "type": "string" + }, + "url": { + "title": "Url", + "type": "string" + } + }, + "required": [ + "url", + "title", + "content", + "engine", + "template", + "parsed_url", + "img_src", + "priority", + "engines", + "positions", + "score", + "category" + ], + "title": "SearxngResult", + "type": "object" + } + }, + "properties": { + "result": { + "anyOf": [ + { + "type": "string" + }, + { + "items": { + "$ref": "#/$defs/SearxngResult" + }, + "type": "array" + } + ], + "title": "Result" + } + }, + "required": [ + "result" + ], + "title": "_WrappedResult", + "type": "object", + "x-fastmcp-wrap-result": true +}
1 tool update
- First observed
web_search
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'web_search' has a clearly defined and distinct purpose.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'web_search' follows a clear verb_noun pattern and is descriptive.
A single tool is too few for a server named 'SearxNG MCP Server', which suggests a broader search functionality. While web search is core, the scope feels thin without additional tools like image_search, news_search, or configuration options.
The tool surface is severely incomplete for a search server. It only covers basic web search, missing obvious functionalities such as image search, news search, or advanced search parameters that would be expected from a search engine integration.
Maintenance
Related MCP Connectors
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Web search, agentic search, news, page retrieval, sitemaps, and trending topics through Search1API.
Search Google straight from your AI agent. Web results, images, videos, news, products, scholarly ar
The best web search for your AI Agent
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables web search, image search, and news search through a self-hosted SearXNG instance. Provides privacy-focused meta-search capabilities aggregating results from multiple search engines.3153 npm1MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to perform web searches and read URL content via a SearXNG instance.218 npmMIT
- FlicenseNot gradedqualityDmaintenanceProvides free web search, content fetching, image search, and deep research via SearXNG, no API keys required.-
- FlicenseNot gradedqualityDmaintenanceProvides fast, self-hosted web search and reliable web scraping using SearXNG and Crawl4AI, integrated as MCP tools for Claude Code.47-