web-search-mcp
Provides free web search, content fetching, image search, and deep research via SearXNG, no API keys required.
README
Free Web Search MCP 🔍
MCP server สำหรับ ค้นหาเว็บ + อ่านเนื้อหาหน้าเว็บ แบบฟรี 100% ไม่ต้องสมัคร ไม่ต้องมี API key ของ Google/Bing — ใช้ SearXNG (meta-search ที่รันเองบน Docker)
ให้ OpenWebUI หรือ CLI ที่ไม่มี search engine สามารถ "เสิร์ชอินเทอร์เน็ต" ได้
เครื่องมือ (tools) ที่ให้
| Tool | หน้าที่ |
|---|---|
web_search(query, num_results, language) |
ค้นหาเว็บ คืนชื่อเรื่อง + ลิงก์ + สรุปย่อ |
fetch_url(url, max_chars) |
ดึงเนื้อหาหลักของหน้าเว็บ แปลงเป็นข้อความสะอาด |
image_search(query, num_results, language) |
ค้นรูปภาพ คืน markdown ฝังรูป + ลิงก์แหล่งที่มา |
deep_research(query, num_sources, max_chars_per_source, include_images, language) |
วิจัยเชิงลึก: ค้นหลายแหล่งพร้อมกัน ดึงเนื้อหาเต็ม รวมเป็นเอกสารเดียวพร้อมเลขอ้างอิง [1][2]… + รูปภาพ + รายการแหล่งอ้างอิง |
Deep Research ทำงานยังไง? ตัว MCP รวบรวม "หลักฐาน" จากหลายแหล่ง (ฟรี ไม่ต้องมี LLM/API key) แล้วส่งเนื้อหา+อ้างอิง+รูปกลับไป ให้ LLM ใน OpenWebUI เป็นคนเรียบเรียงสรุปโดยอ้างอิงเลข [n] — ได้ผลแนวเดียวกับ Deep Research โดยไม่เสียเงิน
สถาปัตยกรรม
OpenWebUI ──HTTP/OpenAPI──> mcpo ──MCP stdio──> server.py ──HTTP──> SearXNG ──> อินเทอร์เน็ต
CLI (Claude Code/Cline) ───────────MCP stdio──> server.py ──┘
วิธีติดตั้ง (Docker — แนะนำ)
cd "Code VSTH/web-search-mcp"
# 1) ตั้ง secret_key ของ SearXNG ให้เป็นค่าสุ่ม
# แก้ไฟล์ searxng/settings.yml บรรทัด secret_key
# 2) (ทางเลือก) ตั้ง API key ให้ mcpo
cp .env.example .env # แล้วใส่ MCPO_API_KEY ถ้าต้องการ
# 3) สั่งรันทั้งระบบ
docker compose up -d --build
ตรวจสอบ:
- SearXNG : http://localhost:8080 (ลองค้นหาดูได้)
- OpenAPI docs : http://localhost:8000/docs (จะเห็น web_search / fetch_url)
- ทดสอบ JSON API ของ SearXNG :
curl "http://localhost:8080/search?q=test&format=json"
ต่อกับ OpenWebUI
- เปิด OpenWebUI → Settings → Tools (หรือ Admin → Settings → Tools / Functions → External Tools)
- Add Tool Server ใส่ URL:
http://localhost:8000ถ้า OpenWebUI รันใน Docker คนละ network ให้ใช้
http://host.docker.internal:8000หรือเอา servicemcpไปอยู่ network เดียวกับ OpenWebUI แล้วใช้ชื่อ service - ถ้าตั้ง
MCPO_API_KEYไว้ ให้ใส่ key นั้นในช่อง API key - บันทึก แล้วเปิดใช้งานในแชท — โมเดลจะเรียก
web_search/fetch_urlได้เอง
ต่อกับ CLI ที่พูด MCP (Claude Code / Cline ฯลฯ)
รันแบบ stdio โดยตรง (ไม่ต้องใช้ mcpo). ติดตั้ง deps ในเครื่องก่อน:
pip install -r mcp/requirements.txt
ตัวอย่าง config (เช่น claude_desktop_config.json หรือ MCP config ของ CLI):
{
"mcpServers": {
"web-search": {
"command": "python",
"args": ["C:\\Users\\LAPTOP-BACKER\\Code VSTH\\web-search-mcp\\mcp\\server.py"],
"env": { "SEARXNG_URL": "http://localhost:8080" }
}
}
}
ต้องให้ container
searxngรันอยู่ (docker compose up -d searxng) เพื่อให้SEARXNG_URLใช้งานได้
เพิ่มใน Claude Code ได้ด้วย:
claude mcp add web-search -e SEARXNG_URL=http://localhost:8080 -- python "C:/Users/LAPTOP-BACKER/Code VSTH/web-search-mcp/mcp/server.py"
ปรับแต่ง (env)
| ตัวแปร | ค่าเริ่มต้น | ความหมาย |
|---|---|---|
SEARXNG_URL |
http://searxng:8080 |
ที่อยู่ SearXNG |
HTTP_TIMEOUT |
20 |
timeout (วินาที) |
MAX_RESULTS_CAP |
20 |
เพดานจำนวนผลลัพธ์ |
RESEARCH_CONCURRENCY |
5 |
จำนวนหน้าที่ deep_research ดึงพร้อมกัน |
MCPO_API_KEY |
(ว่าง) | API key ของ OpenAPI endpoint |
หมายเหตุ
- ทุกอย่างฟรี ไม่มีค่าใช้จ่าย แต่ SearXNG ดึงจาก engine สาธารณะ — ถ้ายิงถี่มากบาง engine อาจ rate-limit (แก้ได้โดยเปิด/ปิด engine ใน
searxng/settings.yml) - เปลี่ยน
secret_keyในsearxng/settings.ymlก่อนใช้งานจริงเสมอ
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.