mmnt_cache
Extract cached web pages from the Mamont search engine by providing a unique cache ID, with options for text-only or HTML output.
Instructions
Extract page from Mamont cache
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | unique cache id | |
| onlyText | Yes | Should the result be text only (no html) |
Implementation Reference
- src/mmnt/cache.ts:10-21 (handler)The core handler function that fetches the cached HTML page from mmnt.ru, decodes from windows-1251 to UTF-8, and extracts plain text from the <pre> element if onlyText is true.export async function extractCache(id: string, onlyText: boolean = true): Promise<string> { const response = await fetch(`https://www.mmnt.ru/cache2/${id}.html`); const buffer = await response.arrayBuffer(); const html = iconv.decode(Buffer.from(buffer), "windows-1251"); // convert win1251 -> utf8 if (!onlyText) { return html; } const $ = cheerio.load(html); return $("pre").first().text(); }
- src/index.ts:27-37 (registration)Registers the 'mmnt_cache' tool with the MCP server, using CacheParams schema and wrapping the extractCache handler.server.tool( "mmnt_cache", "Extract page from Mamont cache", CacheParams, async ({id, onlyText}) => ({ content: [{ type: "text", text: JSON.stringify(await extractCache(id, onlyText)) }] }) );
- src/types.ts:18-21 (schema)Zod schema defining input parameters for the mmnt_cache tool: id (string) and onlyText (boolean).export const CacheParams = { id: z.string({description: "unique cache id"}), onlyText: z.boolean({description: "Should the result be text only (no html)"}) };