io.github.jgador/websharp

编码与调试

by jgador

为 LLMs 提供网页搜索与文章正文提取能力,便于获取可用的 Web 内容。

什么是 io.github.jgador/websharp

为 LLMs 提供网页搜索与文章正文提取能力,便于获取可用的 Web 内容。

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
urlsarray<string>requiredOne 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).

常见问题

io.github.jgador/websharp 是什么?

为 LLMs 提供网页搜索与文章正文提取能力,便于获取可用的 Web 内容。

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描114.1k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描114.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描114.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.4k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
52.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.3k

评论