mcp-searxng
SearXNG MCPサーバーは、ウェブ検索機能を提供するMCPサーバーの実装です。ユーザーは、一般的なクエリ、ニュース、記事を検索でき、結果をページネーションや時間範囲、言語でフィルタリングすることが可能です。安全検索機能も搭載しており、検索結果のコンテンツフィルタリングレベルを制御できます。
GitHubスター
198
ユーザー評価
5.0
(1件)
お気に入り
0
閲覧数
130
フォーク
37
イシュー
4
インストール方法
難易度
中級推定所要時間
10-20 分
必要な環境
Node.js: 18.0.0以上
npm: 8.0.0以上
+1 more
インストール方法
インストール方法
前提条件
必要なソフトウェアとバージョンを明記してください。Node.js: 18.0.0以上
npm: 8.0.0以上
Claude Desktop: 最新版
インストール手順
1. リポジトリのクローン
bash
git clone https://github.com/ihor-sokoliuk/mcp-searxng.git
cd mcp-searxng
2. 依存関係のインストール
bash
npm install
3. Claude Desktop設定
claude_desktop_config.json
を編集してMCPサーバーを追加:
json
{
"mcpServers": {
"searxng": {
"command": "npx",
"args": ["-y", "mcp-searxng"],
"env": {
"SEARXNG_URL": "http://localhost:8080"
}
}
}
}
4. サーバーの起動
bash
npm start
トラブルシューティング
よくある問題
問題: サーバーが起動しない 解決策: Node.jsのバージョンを確認し、依存関係を再インストールしてください。 問題: Claude Desktopで認識されない 解決策: 設定ファイルのパスと構文を確認してください。設定方法
設定方法
基本設定
SEARXNG_URLの設定
1[公開インスタンスのリスト](https://searx.space/)からSearxNGインスタンスを選択するか、ローカル環境を使用します。
2
SEARXNG_URL
環境変数をインスタンスのURLに設定します。3デフォルトの
SEARXNG_URL
値はhttp://localhost:8080
です。認証の使用
パスワード保護されたSearxNGインスタンスを使用している場合、HTTP Basic Authのためにユーザー名とパスワードを設定できます:AUTH_USERNAME
環境変数にユーザー名を設定AUTH_PASSWORD
環境変数にパスワードを設定設定例
json
{
"mcpServers": {
"searxng": {
"command": "npx",
"args": ["-y", "mcp-searxng"],
"env": {
"SEARXNG_URL": "http://localhost:8080"
}
}
}
}
使用例
使用例
基本的な使用方法
MCPサーバーの基本的な使用方法を以下に示します:Claude Desktopでの使用
1MCPサーバーの起動確認
Claude Desktopを開き、設定が正しく読み込まれていることを確認してください。
2基本コマンドの実行
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
プログラムでの使用
javascript
// JavaScript例(Node.js)
const { MCPClient } = require('@modelcontextprotocol/client');
const client = new MCPClient();
await client.connect();
// ツールの実行
const result = await client.callTool('searxng_web_search', {
query: 'latest technology news',
pageno: 1,
time_range: 'month',
language: 'en',
safesearch: 1
});
console.log(result);
応用例
自動化スクリプト
bash
#!/bin/bash
バッチ処理の例
for file in *.txt; do
mcp-tool process "$file"
done
API統合
python
Python例
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()
使用例
result = call_mcp_tool('searxng_web_search', {
'query': 'latest news',
'language': 'en'
})
使用ケース
特定のニュース記事を検索し、結果をページネーションで表示する。
特定の言語での検索結果を取得するために、言語フィルタを使用する。
過去1ヶ月の間に公開された記事を検索する。
安全検索を有効にして、フィルタリングされた結果を取得する。