by ythx-101
Self-hosted web search for AI agents: a CLI + MCP server that wraps SearxNG to aggregate Google, Bing, DuckDuckGo, Brave and more — no API key, no paid search API. Works with Claude Code, OpenClaw, Antigravity and any shell; optional Tavily backend. 给 AI Agent 用的自托管联网搜索(SearxNG)。
From $49 · 30 days · terms & refunds
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
Automated security scan — not a certification.
# Add to your Claude Code skills
git clone https://github.com/ythx-101/ask-searchGuides for using ai agents skills like ask-search.
Web search powered by SearxNG. Aggregates multiple search engines, no API key needed (optional Tavily backend).
ask-search "your query" # top 10 results
ask-search "query" --num 5 # limit results
ask-search "AI news" --categories news # news only
ask-search "query" --lang zh-CN # Chinese results
ask-search "query" --urls-only # URL list (pipe to web_fetch)
ask-search "query" --json # raw JSON
ask-search "topic" to get candidatesweb_fetch on the URL for full content| Flag | Short | Description |
|---|---|---|
--num N |
-n |
Max results (default 10) |
--engines |
-e |
google,bing,duckduckgo,brave |
--lang |
-l |
zh-CN, en, ja, ko |
--categories |
-c |
general,news,images,science |
--json |
-j |
Raw JSON output |
--urls-only |
-u |
URLs only |
Requires SearxNG running locally, with json in search.formats (the bundled searxng/ Docker Compose setup does this). Set SEARXNG_URL if not on default port 8080.
bash install.sh # installs the `ask-search` command (sudo, or: bash install.sh ~/.local/bin)
Optional Tavily backend: SEARCH_PROVIDER=tavily + TAVILY_API_KEY (--engines/--lang/--categories are ignored in this mode).
Last scanned: 11/14/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-11-14T11:15:13.997Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}See how ask-search compares with popular alternatives.
Self-hosted web search for AI agents — no search API key needed
Works in OpenClaw · Claude Code · Antigravity · Any CLI
ask-search is a self-hosted web search CLI and MCP server for AI agents. It wraps SearxNG so Claude Code, OpenClaw, Antigravity or any shell can search Google, Bing, DuckDuckGo, Brave and more without a paid search API key. Tavily is an optional backend.
给 AI Agent 用的自托管联网搜索:包装 SearxNG,一条命令 / 一个 MCP server 就能聚合 Google、Bing、DuckDuckGo、Brave 等搜索结果,无需付费搜索 API key。
Python: CLI 3.8+; MCP server 3.10+ (required by the mcp package).
Your AI agent wants to search the web, but:
You just want your local agent to search Google and friends without a paid API.
ask-search wraps SearxNG — a self-hosted meta search engine that aggregates Google, Bing, DuckDuckGo, Brave and many more sources. One command, all results, no per-query fees.
ask-search "Claude Code vs Cursor 2026"
[1] Example result title
https://example.com/article-1
Example snippet text...
[google,brave]
[2] Another example result title
https://example.com/article-2
...
(illustrative output)
| Environment | Integration | Status |
|---|---|---|
| OpenClaw | CLI Skill (SKILL.md) |
✅ |
| Claude Code | CLI command | ✅ |
| Antigravity | MCP Server | ✅ |
| Any shell | ask-search CLI |
✅ |
1. Start SearxNG (Docker Compose, recommended)
git clone https://github.com/ythx-101/ask-search
cd ask-search/searxng
cp .env.example .env # then set SEARXNG_SECRET (python3 -c "import secrets; print(secrets.token_hex(32))")
docker compose up -d
Or with plain docker run:
docker run -d --name searxng \
-p 127.0.0.1:8080:8080 \
-e SEARXNG_SECRET=your-secret-key \
-v "$PWD/searxng/searxng.yml:/etc/searxng/settings.yml" \
searxng/searxng
2. Install the command
bash install.sh # or: sudo bash install.sh, or: bash install.sh ~/.local/bin
3. Search
ask-search "hello world"
git clone https://github.com/ythx-101/ask-search
cd ask-search
bash install.sh
export SEARXNG_URL=http://localhost:8080 # if not the default
ask-search "hello world"
Your SearxNG must have json enabled in search.formats in settings.yml:
search:
formats:
- html
- json
ask-search "query" # top 10 results
ask-search "query" --num 5 # limit results
ask-search "AI news" --categories news # news only
ask-search "query" --lang zh-CN # language filter
ask-search "query" --urls-only # URLs only (pipe to web_fetch)
ask-search "query" --json # raw JSON
ask-search "query" -e google,brave # specific engines
| Variable | Default | Description |
|---|---|---|
SEARXNG_URL |
http://localhost:8080 |
SearxNG endpoint |
SEARCH_PROVIDER |
searxng |
Search backend: searxng or tavily |
TAVILY_API_KEY |
(none) | Tavily API key (required when SEARCH_PROVIDER=tavily) — get one at app.tavily.com |
# SearxNG (default)
export SEARXNG_URL="http://localhost:8080"
ask-search "query"
# Tavily (opt-in)
export SEARCH_PROVIDER=tavily
export TAVILY_API_KEY=tvly-YOUR_API_KEY
ask-search "query"
{
"mcpServers": {
"ask-search": {
"command": "python3",
"args": ["/path/to/ask-search/mcp/server.py"],
"env": {
"SEARXNG_URL": "http://localhost:8080",
"TAVILY_API_KEY": "tvly-YOUR_API_KEY"
}
}
}
}
Requires Python 3.10+ and pip install mcp.
Claude Code one-liner:
claude mcp add ask-search -e SEARXNG_URL=http://localhost:8080 -- python3 /path/to/ask-search/mcp/server.py
MCP tools provided:
web_search — search via SearxNGweb_search_news — news search via SearxNGweb_search_tavily — search via Tavily API (requires TAVILY_API_KEY)Copy SKILL.md to your OpenClaw skills directory, or:
# OpenClaw skill loader
skill-add https://github.com/ythx-101/ask-search
Then in OpenClaw:
ask-search "latest news about X"
# 1. Search
ask-search "React Server Components performance 2026" --num 10
# 2. Got a promising URL? Deep-dive:
# Pass the URL to web_fetch / curl for full content
# 3. News mode
ask-search "GPT-5 release" --categories news --lang en
ask-search/
├── scripts/
│ └── core.py # Main logic, CLI entry point
├── mcp/
│ └── server.py # MCP server for AG/CC integration
├── searxng/ # Docker Compose + settings.yml for SearxNG
├── tests/ # unit tests (stdlib unittest, no network)
├── install.sh # Installer
├── SKILL.md # OpenClaw skill descriptor
├── llms.txt # Summary for LLM crawlers
└── README.md
json in search.formats in settings.ymlpass_ip in limiter.toml127.0.0.1 for security unless you need remote access| Option | API key | Self-hosted | Notes |
|---|---|---|---|
| ask-search + SearxNG | No | Yes | You maintain a SearxNG container |
| ask-search + Tavily | Yes (Tavily) | No | Use when you don't want to run SearxNG |
| Commercial search APIs | Yes | No | Pay-per-use |
| Built-in agent web search | Depends on platform | No | Queries go through the platform provider |
| Perplexica | No | Yes | Full AI search app with a UI; ask-search is a minimal CLI take on the same idea |
Privacy note: no third-party search API sees your queries; SearxNG forwards them to upstream engines from your own server.
Does ask-search need an API key?
Not in the default SearxNG mode. In Tavily mode (SEARCH_PROVIDER=tavily) you need TAVILY_API_KEY.
How do I use it in Claude Code?
Call the CLI from Bash (ask-search "query"), or register the MCP server (see MCP Integration above).
Why do I get 403 or "SearxNG did not return JSON"?
json must be listed in search.formats in SearxNG's settings.yml (the bundled searxng/searxng.yml does this). If requests are blocked by the bot limiter, add your IP to pass_ip in limiter.toml.
Is it really private? No third-party search API sees your queries, but SearxNG still forwards them to upstream engines (Google, Bing, etc.) from your own server's IP.
How do I search in Chinese or get news only?
ask-search "query" --lang zh-CN and ask-search "query" --categories news.
Can I use Tavily instead of SearxNG?
Yes: export SEARCH_PROVIDER=tavily TAVILY_API_KEY=tvly-YOUR_API_KEY, and install tavily-python (pip install tavily-python; install.sh does this automatically when TAVILY_API_KEY is set). In Tavily mode --engines, --lang and --categories are ignored.
Does it work on Windows?
It needs Python 3 and curl; install.sh is a bash script, so on Windows use WSL. Not tested on native Windows.
How is it different from Perplexica? Perplexica is a full AI search application with a UI. ask-search only returns search results (title, URL, snippet) for an agent to consume, via one CLI command or an MCP server.
ask-search 是给 AI Agent 用的自托管联网搜索工具:包装 SearxNG 元搜索引擎,聚合 Google、Bing、DuckDuckGo、Brave 等结果,无需 API Key(也可选用 Tavily)。支持 Claude Code 搜索、OpenClaw 技能和 MCP 搜索服务器。
快速开始:
cd searxng && cp .env.example .env && docker compose up -d 启动 SearxNGbash install.sh 安装命令ask-search "你好" --lang zh-CNask-search returns URLs + snippets from search engine indexes. When your agent needs the full page content (deep-dive via curl / web_fetch), some sites will block depending on your server's network environment:
| Site | Search (SearxNG) | Deep-dive (curl/fetch) | Why |
|---|---|---|---|
| Most sites | ✅ | ✅ | No aggressive anti-bot |
| ✅ | ❌ VPS IP blocked | Reddit blocks datacenter IPs | |
| Zhihu (知乎) | ✅ | ❌ Login wall + fingerprint | Requires browser JS + login |
| Medium | ✅ | ⚠️ Paywall | Partial content only |
Key insight: Search always works because SearxNG queries search engines (Google, Brave, etc.), not the target sites directly. The search engines have already indexed the content. The problem only appears when your agent tries to fetch the full page.
If you have a machine on a residential network (home server, laptop, etc.), create an SSH SOCKS tunnel:
# On your VPS/server:
ssh -f -N -D 127.0.0.1:1082 user@your-home-machine
# Then fetch through the proxy:
curl -x socks5h://127.0.0.1:1082 "https://reddit.com/r/example/comments/xxx.json"
For Reddit specifically, append .json to any post URL for structured data:
# Returns full post + all comments as JSON
curl -x socks5h://127.0.0.1:1082 \
"https://www.reddit.com/r/LocalLLaMA/comments/xxxxx/post_title.json"
To persist the tunnel as a systemd service:
# /etc/systemd/system/socks-proxy.service
[Unit]
Description=SSH SOCKS Proxy for web scraping
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/ssh -N -D 127.0.0.1:1082 -o Serve
ask-search is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by ythx-101. Self-hosted web search for AI agents: a CLI + MCP server that wraps SearxNG to aggregate Google, Bing, DuckDuckGo, Brave and more — no API key, no paid search API. Works with Claude Code, OpenClaw, Antigravity and any shell; optional Tavily backend. 给 AI Agent 用的自托管联网搜索(SearxNG)。. It has 540 GitHub stars.
Yes. ask-search passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/ythx-101/ask-search" and add it to your Claude Code skills directory (see the Installation section above). ask-search ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
ask-search is primarily written in Python. It is open-source under ythx-101 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh ask-search against similar tools.
No comments yet. Be the first to share your thoughts!