snf
A Model Context Protocol server for DuckDuckGo search and web content fetching (using ocaml-mcp by avsm)
claude mcp add --transport stdio mseri-snf-mcp docker run -i snf-mcp \ --env RUST_LOG="Optional: log level if applicable" \ --env SNF_OPTS="Optional: set options for the dockerized server" \ --env OCAML_GC_HEAP="Optional: adjust OCaml heap settings"
How to use
This MCP server, snf, exposes web fetch and search capabilities implemented in OCaml using the eio runtime. It provides tools to perform DuckDuckGo web searches, search Wikipedia, and fetch or convert web page content into clean HTML or Markdown. The server adheres to the MCP specification, enabling clients to query and invoke tools through a JSON-RPC like interface. Use the tools to first list available capabilities, then call specific tools with the required arguments to obtain results.
Available tools include: search (DuckDuckGo web search), search_wikipedia (Wikipedia search), fetch_content (fetch and parse webpage content), and fetch_markdown (fetch and parse content as Markdown). Each tool accepts a query or URL and supports optional parameters such as max_results, max_length, and start_from to control result size and offsets. The server is built with asynchronous IO (Eio) and includes rate limiting to respect service limits: 30 search requests per minute for DuckDuckGo and Wikipedia, and 20 fetch requests per minute for content fetching.
How to install
Prerequisites:
- OCaml toolchain (OPAM and Dune)
- Git
Install and run from source:
-
Clone the repository: git clone https://github.com/your-repo/snfi-mcp.git cd snf_mcp
-
Install dependencies (OPAM): opam install . --deps-only
-
Build the project (Dune): dune build
-
Install the binary to your PATH (OPAM/Dune): dune install
-
Run the server (example in HTTP mode on port 8080): dune exec snf-mcp --serve 8080
Notes:
- The README references the OPAM-based workflow and provides commands for both stdio and HTTP modes. Depending on your environment, you may use the OPAM switch you have configured or build in a local switch.
- If you plan to integrate with MCP clients, you can also configure stdio mode by starting the server with the --stdio flag and piping JSON-RPC messages.
Additional notes
Tips and caveats:
- Rate limiting is enforced for both search (DuckDuckGo and Wikipedia) and fetch_content/fetch_markdown. If you hit limits, the server will wait or throttle requests automatically.
- For best results with DuckDuckGo, remember that search results are parsed from HTML; variations in page structure can affect parsing quality.
- When using stdio mode for LLM integrations, ensure your client handles streaming JSON-RPC responses if the MCP implementation uses such semantics.
- If you encounter issues, enable debug logging (as described in the README) to get more insight into requests, responses, and rate-limiting behavior.
Related MCP Servers
gpt-researcher
An autonomous agent that conducts deep research on any data using any LLM providers.
ddgs
A metasearch library that aggregates results from diverse web search services
mcp-searxng
MCP Server for SearXNG
academic-search
Academic Paper Search MCP Server for Claude Desktop integration. Allows Claude to access data from Semantic Scholar and Crossref.
wanaku
Wanaku MCP Router
data-commons-search
🔭 Search server to access data from various open access data publishers