Skip to main content
Glama
MRNAQA

io.github.MRNAQA/sourceweave-web-search

by MRNAQA

SourceWeave Web Search

Python 3.12+ MIT License MCP Docker managed runtime

面向网络研究的搜索优先 MCP 服务器与 CLI。

[!NOTE] sourceweave-search-mcp 是默认的本地入口。当显式的 SOURCEWEAVE_SEARCH_* 端点变量不存在时,它会自动发现或启动本地由 Docker 支撑的堆栈。如果你已经自己运行这些服务,请设置显式端点,它将改用它已有端点。

概述快速开始受管本地运行时MCP 客户端设置CLI容器部署OpenWebUI运行时配置开发

概述

SourceWeave Web Search 为 MCP 客户端提供一套精简的三工具契约,用于网络研究:

  • search_web(query, domains?, urls?, effort?) 发现信息源并返回精简的结果,同时提供稳定的 page_id 句柄。

  • read_pages(page_ids, focus?)page_id 读取已存储的页面。

  • read_urls(urls, focus?) 直接读取 URL,无需先进行搜索。

它组合了:

组件

作用

SearXNG

搜索发现

Crawl4AI

干净 HTML 提取

Redis 或 Valkey

持久化页面缓存与 page_id 存储

MarkItDown

对 PDF 及其他受支持文件进行文档转换

Related MCP server: Deep Search MCP Server

快速开始

环境要求

  • Python 3.12+

  • 支持 Compose 的 Docker,用于默认的受管本地运行时

  • 仅当你想使用托管服务或自管理服务时,才需要显式设置 SOURCEWEAVE_SEARCH_* 端点

受管本地运行时

从已发布的包运行服务器:

uvx --from sourceweave-web-search sourceweave-search-mcp

或者通过 HTTP 启动 MCP 服务器:

uvx --from sourceweave-web-search sourceweave-search-mcp \
  --transport streamable-http \
  --host 127.0.0.1 \
  --port 8000

在没有设置任何端点环境变量时,sourceweave-search-mcp

模式

行为

找到受管堆栈

加入当前运行时状态目录下已有的 SourceWeave 受管堆栈

找到健康的外部堆栈

复用标准本地端口 190801923516379,但不取得所有权

没有可复用的堆栈

在标准端口或空闲本地端口上启动并监督一个由 Docker 支撑的堆栈

受管状态存储在 ~/.sourceweave-local/managed-runtime 下。同一台机器上的多个 MCP 进程按状态目录共享一个受管堆栈。

[!IMPORTANT] 受管运行时只会在最后一个活跃的 SourceWeave 受管进程退出时移除容器。命名卷会被保留,因此缓存数据能在重启后继续存在。如果最初的持有进程崩溃,后续进程可以依据 Docker 项目标识和持久化的运行时状态恢复同一个堆栈。

显式端点模式

如果你已经自行运行 SearXNG、Crawl4AI 和 Redis 或 Valkey,或者想指向托管服务,请设置显式端点,这样 MCP 入口将绕过受管 Docker 启动:

SOURCEWEAVE_SEARCH_SEARXNG_BASE_URL="http://127.0.0.1:19080/search?format=json&q=<query>" \
SOURCEWEAVE_SEARCH_CRAWL4AI_BASE_URL="http://127.0.0.1:19235" \
SOURCEWEAVE_SEARCH_CACHE_REDIS_URL="redis://127.0.0.1:16379/2" \
uvx --from sourceweave-web-search sourceweave-search-mcp

直接 CLI

sourceweave-search 用于直接运行工具。当支撑服务已经可用,或者你提供了显式端点时,可以使用它。它不会启动 Docker。

sourceweave-search --query "python programming" --read-first-pages 2
sourceweave-search --read-url "https://packaging.python.org/en/latest/"

[!TIP] 直接 CLI 也接受 --searxng-base-url--crawl4ai-base-url--cache-redis-url 覆盖参数。

MCP 客户端设置

OpenCode

opencode.json / opencode.jsonc / ~/.config/opencode/opencode.json 示例:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "sourceweave": {
      "type": "local",
      "command": [
        "uvx",
        "--from",
        "sourceweave-web-search",
        "sourceweave-search-mcp"
      ],
      "enabled": true,
      "timeout": 300000
    }
  }
}

如果要改为使用共享 HTTP 端点:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "sourceweave": {
      "type": "remote",
      "url": "http://127.0.0.1:18000/mcp",
      "enabled": true,
      "timeout": 300000
    }
  }
}

VS Code Copilot

.vscode/mcp.json 示例:

{
  "servers": {
    "sourceweave": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "--from",
        "sourceweave-web-search",
        "sourceweave-search-mcp"
      ]
    }
  }
}

如果要改为使用共享 HTTP 端点:

{
  "servers": {
    "sourceweave": {
      "type": "http",
      "url": "http://127.0.0.1:18000/mcp"
    }
  }
}

Claude Code

.mcp.json 示例:

{
  "mcpServers": {
    "sourceweave": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "--from",
        "sourceweave-web-search",
        "sourceweave-search-mcp"
      ]
    }
  }
}

如果要创建项目级共享配置,请将同一配置块放在仓库根目录的 .mcp.json 中。

CLI

当支撑服务已经可以访问时,直接 CLI 会很有用。它提供相同的搜索优先工作流,只是不带 MCP 包装层。

sourceweave-search --query "react useEffect cleanup example" --read-first-page
sourceweave-search --query "HTTP overview" --domain developer.mozilla.org --read-first-page
sourceweave-search --read-url "https://packaging.python.org/en/latest/"

容器部署

受管本地运行时用于主机侧的 uvxuv run 启动。容器化部署仍使用显式端点接线。

  • 镜像:ghcr.io/mrnaqa/sourceweave-web-search-mcp

  • 仓库内 Compose 入口:docker compose up -d --build mcp

容器运行示例:

docker run --rm -p 8000:8000 \
  -e SOURCEWEAVE_SEARCH_SEARXNG_BASE_URL="http://host.docker.internal:19080/search?format=json&q=<query>" \
  -e SOURCEWEAVE_SEARCH_CRAWL4AI_BASE_URL="http://host.docker.internal:19235" \
  -e SOURCEWEAVE_SEARCH_CACHE_REDIS_URL="redis://host.docker.internal:16379/2" \
  ghcr.io/mrnaqa/sourceweave-web-search-mcp:latest

OpenWebUI

此仓库还在 artifacts/sourceweave_web_search.py 提供了一个生成的独立 OpenWebUI 工具文件。

在仓库检出中,验证它与标准实现保持同步:

uv run sourceweave-build-openwebui --check

当你想使用独立的工具文件部署路径时,将该文件粘贴到 OpenWebUI。生成的文件会把默认端点改写为仓库内 Compose 服务名,因此开箱即可匹配容器部署路径。

运行时配置

可选环境变量:

变量

用途

SOURCEWEAVE_SEARCH_SEARXNG_BASE_URL

SearXNG 的 URL 模板。必须包含 <query>

SOURCEWEAVE_SEARCH_CRAWL4AI_BASE_URL

Crawl4AI 的基础 URL。

SOURCEWEAVE_SEARCH_CACHE_REDIS_URL

用于缓存的 Redis 或 Valkey URL。

FASTMCP_HOST

ssestreamable-http 传输使用的主机。

FASTMCP_PORT

ssestreamable-http 传输使用的端口。

如果端点变量未设置,sourceweave-search-mcp 默认使用受管本地运行时。

  • 标准主机端点仍是首选默认值,也是外部复用时的探测目标。

  • 当标准默认端口已被占用时,SourceWeave 受管堆栈可以使用其他空闲主机端口。

  • 同一台机器上的多个 MCP 进程按本地运行时状态目录共享一个受管堆栈。

默认端点值:

  • SearXNG:http://127.0.0.1:19080/search?format=json&q=<query>

  • Crawl4AI:http://127.0.0.1:19235

  • Redis:redis://127.0.0.1:16379/2

受管启动时的默认首选主机端口:

  • SearXNG:19080

  • Crawl4AI:19235

  • Redis:16379

  • MCP:使用 uvx 直接运行时为 8000;使用仓库的 mcp Compose 服务时,在 /mcp 路径下为 18000

开发

git clone https://github.com/MRNAQA/sourceweave-web-search.git
cd sourceweave-web-search
uv sync --locked --group dev
uv run sourceweave-search-mcp

有用的检查:

uv run sourceweave-build-openwebui --check
uv run sourceweave-search-mcp --help
uv run pytest tests/test_config.py tests/test_packaging.py tests/test_tool.py tests/test_managed_runtime.py -m "not integration"
A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
1dRelease cycle
7Releases (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

  • A
    license
    B
    quality
    C
    maintenance
    Enables web search and site-specific search capabilities through the Deepsearch model. Provides unified access to broad web retrieval and targeted site search functionality within the MCP ecosystem.
    2
    11
    5
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides comprehensive search capabilities including web search, content extraction, news search, academic search, and AI-powered multi-source research. Enables natural language access to web content and research through a production-ready MCP server.
  • A
    license
    B
    quality
    Not graded
    maintenance
    Provides advanced Google Custom Search functionality, web content extraction, and specialized research tools such as search analytics, multi-site search, and fact checking. Works as an MCP server compatible with any MCP client.
    10
    MIT

View all related MCP servers

Related MCP Connectors

  • Stealth web browser for agents: search, fetch, click and type through persistent sessions over MCP.

  • Agentic search over your Dewey document collections from any MCP-compatible client.

  • Access Kernel's cloud-based browsers and app actions via MCP (remote HTTP + OAuth).

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/MRNAQA/sourceweave-web-search'

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