Skip to main content
Glama
muzihuaner

SearXNG-MCP

by muzihuaner

SearXNG MCP Server

FastMCP に基づいて実装された SearXNG 検索 MCP サービスで、Streamable HTTP トランスポートを使用し、ローカル実行と Docker デプロイをサポートします。

SearXNG関連リンク:

公式ドキュメント:https://docs.searxng.org/

オンライン例:https://searx.space/

機能

  • MCP ツール search(query) を公開: キーワードに基づいて SearXNG インスタンスを呼び出し、検索結果の要約を返します。

  • HTTP エンドポイント http://<host>:<port>/mcp を介して MCP サービスを提供し、リモート/クロスドメイン呼び出しを容易にします。

  • ステートレス(stateless) Streamable HTTP モードを採用し、クライアントは Mcp-Session-Id を維持する必要がなく、直接並行呼び出しが可能です。

  • 環境変数による SearXNG インスタンスアドレスのカスタマイズをサポートし、プライベートデプロイに便利です。

Related MCP server: SearXNG MCP Server

環境変数

変数名

デフォルト値

説明

SEARXNG_URL

https://searxng.abc.com

SearXNG インスタンスのルートアドレス(JSONを有効にする必要あり)

HOST

0.0.0.0

サービスがリッスンするアドレス

PORT

9000

サービスがリッスンするポート

ローカル実行

# 安装依赖(建议使用虚拟环境)
pip install -r requirements.txt

# 可选:自定义 SearXNG 实例(只需填根地址)
export SEARXNG_URL="https://your-searxng-instance"

# 启动服务
python Server.py

起動後、MCP エンドポイントは次のとおりです:

http://localhost:9000/mcp

Docker デプロイ

イメージのビルド

docker build -t searxng-mcp .

コンテナの実行

docker run -d \
  --name searxng-mcp \
  -p 9000:9000 \
  -e SEARXNG_URL="https://searxng.abc.com" \
  searxng-mcp

ポートを変更する場合は、コンテナ内外のポートと PORT を同時に上書きできます:

docker run -d \
  --name searxng-mcp \
  -p 8080:8080 \
  -e PORT=8080 \
  searxng-mcp

オンラインイメージを使用

docker run -d \
  --name searxng-mcp \
  -p 9000:9000 \
  -e SEARXNG_URL="https://searxng.abc.com" \
  muzihuaner/searxng-mcp:latest

アクセスアドレス

デプロイ完了後、MCP エンドポイントの形式は次のとおりです:

http://<你的服务器域名或IP>:<端口>/mcp

例:http://localhost:9000/mcp または https://mcp.your-domain.com/mcp

クライアント設定

Streamable HTTP をサポートする MCP クライアントでは、サービスアドレスを上記の /mcp エンドポイントに設定するだけです。例:

{
  "mcpServers": {
    "searxng": {
      "url": "http://localhost:9000/mcp"
    }
  }
}

ツール説明

search(query: str) -> str

キーワードに基づいて SearXNG 検索を呼び出し、各結果エントリの content テキストを改行で連結して返します。

  • query: 検索キーワード。

  • 戻り値: 検索結果のテキスト内容。リクエストが失敗した場合は False を返します。

並行性とパフォーマンス

测试结果示例(局域网 / 上游 `so.xxx.cn`):

総リクエスト数: 100 並行ワーカー: 50 成功: 100 失敗: 0 総所要時間(秒): 67.68 スループット(QPS): 1.48 平均遅延(秒): 27.284 最小遅延(秒): 7.203 最大遅延(秒): 44.418


> 注意:端到端延迟主要取决于 SearXNG 上游实例的响应速度(本例平均约 27s 来自上游 `so.xxx.cn` 较慢),服务本身可稳定承载并发且零失败。若需提升吞吐,可:
> - 换用响应更快 / 自托管的 SearXNG 实例(通过 `SEARXNG_URL` 指定);

よくある質問

Q: クライアントが Missing session ID エラーを報告しますか? A: このサービスは stateless_http=True を有効にしており、セッションは不要です。それでもエラーが発生する場合は、クライアントが /mcp エンドポイントを指していることを確認してください。

Q: 本番環境で CORS を厳しくするにはどうすればよいですか? A: Server.pyCORSMiddleware を編集し、allow_origins=["*"] を具体的なオリジンリスト(例:["https://your-domain.com"])に変更します。

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    Enables web search capabilities through the Tavily API. Allows users to search the web for information using natural language queries via the MCP protocol.
    4
    1
  • A
    license
    A
    quality
    D
    maintenance
    Integrates with SearXNG metasearch engine to provide powerful web search capabilities across multiple search engines with filtering options for categories, languages, time ranges, and safe search levels. Enables comprehensive web searches, autocomplete suggestions, and search engine configuration access through MCP-compatible applications.
    4
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables privacy-focused web search via SearXNG for MCP clients, allowing users to perform searches with customizable parameters through natural language.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Free web search MCP server using SearXNG, supporting web search, news search, and search summaries.
    MIT

View all related MCP servers

Related MCP Connectors

  • Serper MCP — wraps the Serper Google Search API (serper.dev)

  • MCP server for Google search results via SERP API

  • Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/muzihuaner/SearXNG-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server