Websharp

io.github.jgador由 GitHub 帳號 jgador 發布vv0.99.0-rc2更新於 Oct 24, 2026

Search the web and extract article text for LLMs.

概覽

AI 產生的概覽

一個本機 MCP 伺服器,讓助理透過 SearXNG 實例進行網頁搜尋,並從網頁擷取可讀的文章正文。

可以做什麼
透過 SearXNG 元搜尋後端搜尋網頁,支援結果數量、分類與語言篩選,回傳文字摘要以及結構化結果中繼資料和相關建議。擷取並解析一個或多個網頁 URL,取出可讀正文,包含標題、摘要、偵測語言與逐頁錯誤資訊。
適用情境
適合助理需要最新網頁結果或乾淨文章正文來做依據支撐、事實查核與研究的場合,前提是你願意同時執行一個 SearXNG 實例。
執行需求
以本機 Docker 容器執行(建議使用 Docker Compose),或以 .NET 9 SDK 從原始碼執行。需要可存取的 SearXNG 端點;未使用內附 Docker 服務時,透過環境變數 Searxng__BaseUrl 指定。MCP 端點預設監聽 8081 埠,可用 ASPNETCORE_URLS 變更。
安裝前請注意
HTTP 傳輸不含身分驗證,CORS 預設允許任意來源、標頭與方法;對外暴露前應收緊這些設定,並置於反向代理、通道或 VPN 之後。擷取的頁面與搜尋查詢會送到所設定的 SearXNG 實例以及被讀取的網站。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Websharp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

WebSharp MCP HTTP Server

WebSharp is a Model Context Protocol (MCP) server written in C# (.NET 9) that exposes web search and readable page extraction tools over the streamable HTTP transport. It pairs a SearXNG metasearch instance with the SmartReader content extraction library and ships with Docker assets so you can run everything locally with one command.

Highlights

  • Streamable HTTP MCP endpoint served by ASP.NET Core via ModelContextProtocol.AspNetCore.
  • SearXNG-backed metasearch tool that returns both a readable summary and structured JSON metadata.
  • SmartReader-powered page reader tools for single URLs or batches, ideal for grounding and fact checking workflows.
  • Container-first development story with Docker Compose and an inspector-ready .mcp.json profile.

Available MCP tools

web_search

ParameterTypeDefaultNotes
querystringrequiredFree-form search string submitted to the configured search backend (defaults to SearXNG).
limitinteger10Maximum number of results to surface in the text summary. When set to 0 or negative, the parameter is omitted and the backend decides the result count.
categoriesstring"general"Comma-separated categories forwarded to the backend (for SearXNG, examples include general,it,science).
languagestring"en"Language tag forwarded to the backend. When using the default SearXNG instance, see its language list.

Response

  • Text summary showing the top results, related suggestions, and any unresponsive engines.
  • structuredContent contains a JSON object with:
    • query: echo of the evaluated query string.
    • items: array of result objects (title, url, content, engine/engines, category, positions, parsed_url).
    • suggestions: related queries returned by the backend (SearXNG surfaces them when available).
    • unresponsive_engines: list of engines that timed out or failed, with optional messages.
    • error: present when the search could not be completed.

web_page_read

ParameterTypeDefaultNotes
urlsarrayrequiredOne or more absolute HTTP/HTTPS URLs to fetch and parse.

Response

  • When a single URL is provided, returns the article title, excerpt, a preview of the readable text (~800 characters), and footer metadata (source URL, detected language).
  • When multiple URLs are provided, the summary includes overall success/failure counts, per-page details (title, URL, full text, language), and error messages for any failures. Requests run concurrently and honor the MCP cancellation token.
  • structuredContent is not populated; all data is returned in the text block.

Run everything with Docker Compose

  1. Install Docker Desktop (or another OCI-compatible runtime) and ensure it is running.
  2. From the repository root, start both the SearXNG dependency and the MCP server:
    docker compose -f docker-compose.yaml --project-name websharp up -d (add --build on the first run or whenever the Dockerfile changes).
  3. Wait until the websharp-mcp container reports Now listening on: http://0.0.0.0:8080.
  4. The MCP server is now reachable at http://localhost:8081 (mapped from container port 8080). SearXNG is available at http://localhost:8080/ for inspection.

Build the Docker image manually

Run the server image build without Docker Compose from the repository root:

powershell
docker build -f .\src\WebSharp.Mcp.Http\Dockerfile -t jessegador/websharp-mcp:v0.99.0-rc2 --no-cache src

Update -t to match the image registry and tag you plan to publish.

Connect with the MCP Inspector

  1. Start (or keep running) the compose stack above.
  2. Launch the Inspector with the included client profile:
    npx -y @modelcontextprotocol/inspector --config .\.mcp.json --server websharp-mcp
  3. Copy the printed token into the Inspector UI by opening http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=<token> in your browser.
  4. In the Inspector UI, pick the websharp-mcp server to explore the available tools and try calls right away.

Running from source

  • Install the .NET 9 SDK.
  • Ensure you have access to a SearXNG endpoint. The easiest option is to keep using the Docker Compose service and export Searxng__BaseUrl to http://localhost:8080 before starting the app.
  • Launch the server:
    dotnet run --project src/WebSharp.Mcp.Http/WebSharp.Mcp.Http.csproj --urls http://localhost:8081
  • The MCP endpoint listens on /. In DEBUG builds you can hit /__routes to inspect the configured ASP.NET endpoints.

Configuration

Environment variableDefaultDescription
ASPNETCORE_URLShttp://0.0.0.0:8080 (Docker)Listening address(es) for the HTTP server. Override to change the exposed MCP port.
Searxng__BaseUrlhttp://searxng:8080Base URL of the SearXNG instance. Required if you are not running the bundled Docker service. Must be an absolute URI.
Cors__AllowAnyOrigintruePermit all origins. Set to false when you want to limit callers via Cors__AllowedOrigins__0=<origin> style keys.
Cors__AllowAnyHeadertrueAllow all request headers.
Cors__AllowAnyMethodtrueAllow all HTTP methods.
Cors__AllowCredentialsfalseWhen true, credentials are accepted and you must explicitly enumerate origins.
Cors__AllowedOrigins__{n}(empty)Optional origin allowlist entries when AllowAnyOrigin is false.
Cors__AllowedHeaders__{n}(empty)Optional header allowlist.
Cors__AllowedMethods__{n}(empty)Optional method allowlist.

All configuration values can also be supplied via appsettings.json/appsettings.Development.json. The Docker Compose definition mounts the correct defaults for local experimentation.

Using a different SearXNG instance

  • Point Searxng__BaseUrl at your hosted SearXNG deployment (for example https://searxng.example.com).
  • Make sure the endpoint you target exposes the SearXNG Search API and permits the categories/languages you request.
  • Consider adjusting the bundled searxng/settings.yml to tune activated engines, safe search, or rate limits before publishing to the MCP registry.

Security notes

  • The HTTP transport does not include authentication. Run behind a reverse proxy, tunnel, or VPN when exposing beyond localhost.
  • CORS defaults to permissive settings for debugging. Tighten them before deploying to shared environments.
  • The server respects MCP cancellation tokens, and page fetches enforce short HTTP timeouts to avoid hanging client sessions.

Registry metadata

  • Name: websharp-mcp
  • Transport: streamable-http
  • Endpoint: /
  • See .mcp.json for a ready-to-use inspector profile.

License

This project is available under the MIT license (see LICENSE).

來源:README.md,提交 43ba586

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. vv0.99.0-rc2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分