websharp-mcp
Provides web search and readable page extraction tools via MCP, using SearXNG metasearch and SmartReader content extraction, with Docker support for local deployment.
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.jsonprofile.
Available MCP tools
web_search
| Parameter | Type | Default | Notes |
|---|---|---|---|
query |
string | required | Free-form search string submitted to the configured search backend (defaults to SearXNG). |
limit |
integer | 10 | Maximum 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. |
categories |
string | "general" |
Comma-separated categories forwarded to the backend (for SearXNG, examples include general,it,science). |
language |
string | "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.
structuredContentcontains 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
| Parameter | Type | Default | Notes |
|---|---|---|---|
urls |
array<string> | required | One 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.
structuredContentis not populated; all data is returned in the text block.
Run everything with Docker Compose
- Install Docker Desktop (or another OCI-compatible runtime) and ensure it is running.
- 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--buildon the first run or whenever the Dockerfile changes). - Wait until the
websharp-mcpcontainer reportsNow listening on: http://0.0.0.0:8080. - The MCP server is now reachable at
http://localhost:8081(mapped from container port 8080). SearXNG is available athttp://localhost:8080/for inspection.
Build the Docker image manually
Run the server image build without Docker Compose from the repository root:
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
- Start (or keep running) the compose stack above.
- Launch the Inspector with the included client profile:
npx -y @modelcontextprotocol/inspector --config .\.mcp.json --server websharp-mcp - Copy the printed token into the Inspector UI by opening
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=<token>in your browser. - In the Inspector UI, pick the
websharp-mcpserver 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__BaseUrltohttp://localhost:8080before 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
/. InDEBUGbuilds you can hit/__routesto inspect the configured ASP.NET endpoints.
Configuration
| Environment variable | Default | Description |
|---|---|---|
ASPNETCORE_URLS |
http://0.0.0.0:8080 (Docker) |
Listening address(es) for the HTTP server. Override to change the exposed MCP port. |
Searxng__BaseUrl |
http://searxng:8080 |
Base URL of the SearXNG instance. Required if you are not running the bundled Docker service. Must be an absolute URI. |
Cors__AllowAnyOrigin |
true |
Permit all origins. Set to false when you want to limit callers via Cors__AllowedOrigins__0=<origin> style keys. |
Cors__AllowAnyHeader |
true |
Allow all request headers. |
Cors__AllowAnyMethod |
true |
Allow all HTTP methods. |
Cors__AllowCredentials |
false |
When 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__BaseUrlat your hosted SearXNG deployment (for examplehttps://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.ymlto 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.jsonfor a ready-to-use inspector profile.
License
This project is available under the MIT license (see LICENSE).
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。