网页搜索服务

一个基于SearXNG的网页搜索服务,提供隐私保护的网页搜索功能,并返回标题、URL和文本片段。

  • by Artyom-K-Dev
  • Rust
  • 本地部署
  • 更新于
在 GitHub 查看 Artyom-K-Dev/search-web-mcp

使用说明

搜索Web MCP服务器

使用SearXNG实例提供web搜索功能的模型上下文协议(MCP)服务器。

特性

  • 网页搜索:通过SearXNG进行尊重隐私的网络搜索
  • 片段提取:从搜索结果中返回标题、URL和文本片段

用法

Docker(推荐)

将此添加到您的 mcp.json (需要一个正在运行的SearXNG实例):

{
  "mcpServers": {
    "search-web": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e", "SEARXNG_API_URL=http://host.docker.internal:8080",
        "--add-host=host.docker.internal:host-gateway",
        "ghcr.io/artyom-k-dev/search-web-mcp:latest"
      ]
    }
  }
}

或手动运行:

docker run -i --rm \
  -e SEARXNG_API_URL=http://host.docker.internal:8080 \
  --add-host=host.docker.internal:host-gateway \
  ghcr.io/artyom-k-dev/search-web-mcp:latest

本地开发

  1. 确保你有一个正在运行的SearXNG实例(例如,通过Docker):

    docker-compose up -d
    
  2. 运行服务器:

    export SEARXNG_API_URL=http://localhost:8080
    cargo run --release
    

可用工具

  • search:使用SearXNG搜索网络。
    • 论据:
      • query:搜索查询字符串

配置

环境变量 描述 默认值
SEARXNG_API_URL SearXNG实例的基本URL http://localhost:8080