mmnt_search
Search the Mamont search engine to find web content using specific queries and page navigation.
Instructions
Search in Mamont search engine
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | query string | |
| page | Yes | page number |
Implementation Reference
- src/mmnt/search.ts:11-40 (handler)The core handler function `searchMamont` that fetches search results from mmnt.ru, decodes the response, parses HTML with cheerio, and extracts title, description, URL, cache, and web_archive for each result.export async function searchMamont(request: string, page: number = 0): Promise<SearchResult> { const ot = page * 10 + 1; const response = await fetch(`https://www.mmnt.ru/get?st=${encodeURIComponent(request)}&in=w&ot=${ot}`); const buffer = await response.arrayBuffer(); const text = iconv.decode(Buffer.from(buffer), "windows-1251"); // convert win1251 -> utf8 const $ = cheerio.load(text); const result: SearchResult = []; $(".link_block").each((i, elem) => { if (i == 0) return; const linkElement = $(elem).find("p.link_p a").first(); const title = linkElement.text().trim(); const description = $(elem).find("p.desc_p").text().trim(); const url = $(elem).find("p.link_p a").first().attr("href")!; const cache = $(elem).find("p.cache_p a").first().attr("href")?.match(/\/cache\/([a-f0-9]+)\.html/)?.[1]; const web_archive = $(elem).find("p.arch_p a").first()?.attr("href"); result.push({ title, description, url, ...(cache ? {cache} : {}), ...(web_archive ? {web_archive} : {}), }); }); return result; }
- src/types.ts:13-16 (schema)Zod schema definition for input parameters of the mmnt_search tool: query (string) and page (number). Also defines SearchResult type used by the handler.export const SearchParams = { query: z.string({description: "query string"}), page: z.number({description: "page number"}) };
- src/index.ts:15-25 (registration)MCP server tool registration for 'mmnt_search', specifying name, description, input schema (SearchParams), and inline handler that calls searchMamont and returns JSON stringified result.server.tool( "mmnt_search", "Search in Mamont search engine", SearchParams, async ({query, page}) => ({ content: [{ type: "text", text: JSON.stringify(await searchMamont(query, page)) }] }) );