UNPKG

@mokei/mcp-fetch

Version:
66 lines 1.95 kB
import type { ExtractServerTypes } from '@mokei/context-server'; import Turndown from 'turndown'; /** * Options for creating fetch tools. */ export type FetchToolsOptions = { /** * Custom Turndown service instance for HTML to markdown conversion. * If not provided, a default instance with GFM support is created. */ turndownService?: Turndown; }; /** * Create a default Turndown service instance with GFM support. */ export declare function createTurndownService(): Turndown; /** * Create fetch tool definitions. * * @example * ```typescript * import { createFetchTools } from '@mokei/mcp-fetch' * * const tools = createFetchTools() * ``` */ export declare function createFetchTools(options?: FetchToolsOptions): { get_markdown: import("@mokei/context-server").ToolDefinition<{ url: string; }>; }; /** * Create a server config for the fetch MCP server. * * @example * ```typescript * import { createFetchConfig } from '@mokei/mcp-fetch' * import { ContextServer } from '@mokei/context-server' * * const config = createFetchConfig() * const server = new ContextServer({ ...config, transport }) * ``` */ export declare function createFetchConfig(options?: FetchToolsOptions): { readonly name: "fetch"; readonly version: "0.1.0"; readonly protocolVersions: ["2026-07-28", "2025-11-25"]; readonly tools: { get_markdown: import("@mokei/context-server").ToolDefinition<{ url: string; }>; }; }; /** * Type-safe context types for the Fetch MCP server. * * @example * ```typescript * import type { FetchServerTypes } from '@mokei/mcp-fetch' * import { ContextClient } from '@mokei/context-client' * * const client = new ContextClient<FetchServerTypes>({ protocolVersion: '2025-11-25', transport }) * ``` */ export type FetchServerTypes = ExtractServerTypes<ReturnType<typeof createFetchConfig>>; //# sourceMappingURL=config.d.ts.map