MS

mseri/snf-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

8 stars 7 forks 质量 64 趋势 16ISC

A Model Context Protocol server for DuckDuckGo search and web content fetching (using ocaml-mcp by avsm)

概览

A Model Context Protocol (MCP) server that provides web search, Wikipedia search, and web content fetching capabilities, written in OCaml using the eio asynchronous runtime. - : Search the web using DuckDuckGo's search engine - : Search Wikipedia for articles and content - : Fetch and parse content from web pages, with support for both cleaned-up HTML and Markdown formats - : Built-in rate limiting to respect service limits - : Fully compatible with the Model Context Protocol specification (vendoring https://tangled.sh/@anil.recoil.org/ocaml-mcp/) - : Built on Eio for efficient concurrent operations Search DuckDuckGo and return formatted results. - query (string, required): The search query string - max_results (integer, optional): Maximum number of results to return (default: 10) Search Wikipedia and return formatted results.

README

以下为原文 README 节选,完整内容请查看原文。

Web fetch and search MCP Server

A Model Context Protocol (MCP) server that provides web search, Wikipedia search, and web content fetching capabilities, written in OCaml using the eio asynchronous runtime.

Features

  • DuckDuckGo Search: Search the web using DuckDuckGo’s search engine
  • Wikipedia Search: Search Wikipedia for articles and content
  • Web Content Fetching: Fetch and parse content from web pages, with support for both cleaned-up HTML and Markdown formats
  • Rate Limiting: Built-in rate limiting to respect service limits
  • MCP Protocol: Fully compatible with the Model Context Protocol specification (vendoring )
  • Asynchronous: Built on Eio for efficient concurrent operations

Tools Provided

search

Search DuckDuckGo and return formatted results.

Parameters:

  • query (string, required): The search query string
  • max_results (integer, optional): Maximum number of results to return (default: 10)

Example:

{
  "query": "OCaml programming language",
  "max_results": 5
}

search_wikipedia

Search Wikipedia and return formatted results.

Parameters:

  • query (string, required): The search query string
  • max_results (integer, optional): Maximum number of results to return (default: 10)

Example:

{
  "query": "OCaml programming language",
  "max_results": 5
}

fetch_content

Fetch and parse content from a webpage URL.

Parameters:

  • url (string, required): The webpage URL to fetch content from
  • max_length (integer, optional): Maximum length (in bytes) of content to return (default: 8192). Set -1 to disable length limit.
  • start_from (integer, optional): Byte offset to start returning content from (default: 0)

Example:

{
  "url": "https://example.com/article",
  "max_length": 16384,
  "start_from": 1024
}

fetch_markdown

Fetch and parse content from a webpage URL as Markdown.

Parameters:

  • url (string, required): The webpage URL to fetch content from
  • max_length (integer, optional): Maximum length (in bytes) of content to return (default: 8192). Set -1 to disable length limit.
  • start_from (integer, optional): Byte offset to start returning content from (default: 0)

Example:

{
  "url": "https://example.com/article",
  "max_length": 16384,
  "start_from": 1024
}

Usage

Running the Server

The snf-mcp binary supports two modes of operation:

  1. HTTP Server Mode (default): Listens on a network port
  2. Standard I/O Mode: Communicates through stdin/stdout

Caveat: the installed binary is called snf-mcp

Start the MCP server in HTTP mode on port 3000:

dune exec snf-mcp -- --serve 3000

Use Standard I/O mode (useful for integrating with LLM clients):

dune exec snf-mcp

When installed via OPAM, you can run it directly:

snf_mcp [--serve PORT | --stdio]
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →